]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
codegen: Fix C warning when deserializing GVariant arrays
authorJürg Billeter <j@bitron.ch>
Wed, 22 Dec 2010 07:42:51 +0000 (08:42 +0100)
committerJürg Billeter <j@bitron.ch>
Wed, 22 Dec 2010 07:42:51 +0000 (08:42 +0100)
codegen/valagvariantmodule.vala

index 87453a94b6e00b48018d91ef364afafd40e33983..2b968aa3938c44f4bda7fddb0ad753e60dd4cb26 100644 (file)
@@ -315,7 +315,7 @@ public class Vala.GVariantModule : GAsyncModule {
                iter_call = new CCodeFunctionCall (new CCodeIdentifier ("g_variant_iter_next_value"));
                iter_call.add_argument (new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, new CCodeIdentifier (subiter_name)));
 
-               var cforcond = new CCodeAssignment (new CCodeIdentifier (element_name), iter_call);
+               var cforcond = new CCodeBinaryExpression (CCodeBinaryOperator.INEQUALITY, new CCodeAssignment (new CCodeIdentifier (element_name), iter_call), new CCodeConstant ("NULL"));
                var cforiter = new CCodeUnaryExpression (CCodeUnaryOperator.POSTFIX_INCREMENT, new CCodeIdentifier ("%s_length%d".printf (temp_name, dim)));
                ccode.open_for (null, cforcond, cforiter);