[vala] Fix private fixed-length array fields



commit 8856b7ea969084de76df674209b071a7e8ddf0b6
Author: Jürg Billeter <j bitron ch>
Date:   Mon Mar 22 23:18:06 2010 +0100

    Fix private fixed-length array fields
    
    Fixes bug 609171.

 codegen/valagtypemodule.vala |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/codegen/valagtypemodule.vala b/codegen/valagtypemodule.vala
index bda3332..b95e375 100644
--- a/codegen/valagtypemodule.vala
+++ b/codegen/valagtypemodule.vala
@@ -413,18 +413,20 @@ internal class Vala.GTypeModule : GErrorModule {
 				if (f.access == SymbolAccessibility.PRIVATE)  {
 					generate_type_declaration (f.field_type, decl_space);
 
-					instance_priv_struct.add_field (field_ctype, f.get_cname ());
+					instance_priv_struct.add_field (field_ctype, f.get_cname (), f.field_type.get_cdeclarator_suffix ());
 					if (f.field_type is ArrayType && !f.no_array_length) {
 						// create fields to store array dimensions
 						var array_type = (ArrayType) f.field_type;
 						var len_type = int_type.copy ();
 
-						for (int dim = 1; dim <= array_type.rank; dim++) {
-							instance_priv_struct.add_field (len_type.get_cname (), head.get_array_length_cname (f.name, dim));
-						}
+						if (!array_type.fixed_length) {
+							for (int dim = 1; dim <= array_type.rank; dim++) {
+								instance_priv_struct.add_field (len_type.get_cname (), head.get_array_length_cname (f.name, dim));
+							}
 
-						if (array_type.rank == 1 && f.is_internal_symbol ()) {
-							instance_priv_struct.add_field (len_type.get_cname (), head.get_array_size_cname (f.name));
+							if (array_type.rank == 1 && f.is_internal_symbol ()) {
+								instance_priv_struct.add_field (len_type.get_cname (), head.get_array_size_cname (f.name));
+							}
 						}
 					} else if (f.field_type is DelegateType) {
 						var delegate_type = (DelegateType) f.field_type;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]