vala r2207 - in trunk: . gobject
- From: juergbi svn gnome org
- To: svn-commits-list gnome org
- Subject: vala r2207 - in trunk: . gobject
- Date: Wed, 17 Dec 2008 23:15:10 +0000 (UTC)
Author: juergbi
Date: Wed Dec 17 23:15:10 2008
New Revision: 2207
URL: http://svn.gnome.org/viewvc/vala?rev=2207&view=rev
Log:
2008-12-18 JÃrg Billeter <j bitron ch>
* gobject/valaccodebasemodule.vala:
Fix member initializers for array fields, fixes bug 562600
Modified:
trunk/ChangeLog
trunk/gobject/valaccodebasemodule.vala
Modified: trunk/gobject/valaccodebasemodule.vala
==============================================================================
--- trunk/gobject/valaccodebasemodule.vala (original)
+++ trunk/gobject/valaccodebasemodule.vala Wed Dec 17 23:15:10 2008
@@ -2827,6 +2827,19 @@
lhs = new CCodeMemberAccess.pointer (typed_inst, f.get_cname ());
}
ccomma.append_expression (new CCodeAssignment (lhs, (CCodeExpression) init.initializer.ccodenode));
+
+ if (f.field_type is ArrayType && !f.no_array_length) {
+ var array_type = (ArrayType) f.field_type;
+ for (int dim = 1; dim <= array_type.rank; dim++) {
+ if (expr.type_reference.data_type is Struct) {
+ lhs = new CCodeMemberAccess (typed_inst, head.get_array_length_cname (f.get_cname (), dim));
+ } else {
+ lhs = new CCodeMemberAccess.pointer (typed_inst, head.get_array_length_cname (f.get_cname (), dim));
+ }
+ var rhs_array_len = head.get_array_length_cexpression (init.initializer, dim);
+ ccomma.append_expression (new CCodeAssignment (lhs, rhs_array_len));
+ }
+ }
} else if (init.symbol_reference is Property) {
var inst_ma = new MemberAccess.simple ("new");
inst_ma.value_type = expr.type_reference;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]