[vala] GVariant: Fix C warning in array serialization



commit 2227d1f01c175bfd9800a7c341460720c0dbd462
Author: Jürg Billeter <j bitron ch>
Date:   Mon Oct 25 10:28:29 2010 +0200

    GVariant: Fix C warning in array serialization

 codegen/valagvariantmodule.vala |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/codegen/valagvariantmodule.vala b/codegen/valagvariantmodule.vala
index 5efc2f6..d05742e 100644
--- a/codegen/valagvariantmodule.vala
+++ b/codegen/valagvariantmodule.vala
@@ -590,9 +590,12 @@ public class Vala.GVariantModule : GAsyncModule {
 		ccode.add_declaration ("GVariantBuilder", new CCodeVariableDeclarator (builder_name));
 		ccode.add_declaration ("int", new CCodeVariableDeclarator (index_name));
 
+		var gvariant_type = new CCodeFunctionCall (new CCodeIdentifier ("G_VARIANT_TYPE"));
+		gvariant_type.add_argument (new CCodeConstant ("\"%s\"".printf (get_type_signature (array_type))));
+
 		var builder_init = new CCodeFunctionCall (new CCodeIdentifier ("g_variant_builder_init"));
 		builder_init.add_argument (new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, new CCodeIdentifier (builder_name)));
-		builder_init.add_argument (new CCodeConstant ("\"%s\"".printf (get_type_signature (array_type))));
+		builder_init.add_argument (gvariant_type);
 		ccode.add_expression (builder_init);
 
 		var cforinit = new CCodeAssignment (new CCodeIdentifier (index_name), new CCodeConstant ("0"));



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