[vala] GDBus: Initialize array length variable in property get wrappers



commit ceefedb2ce62712f4bbebd72baceb13104fbc675
Author: JÃrg Billeter <j bitron ch>
Date:   Fri Oct 19 23:46:17 2012 +0200

    GDBus: Initialize array length variable in property get wrappers
    
    This fixes a gcc warning when building with -O3.
    
    Based on patch by Marc-Antoine Perennou.
    
    Fixes bug 686123.

 codegen/valagdbusservermodule.vala |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/codegen/valagdbusservermodule.vala b/codegen/valagdbusservermodule.vala
index c92a444..9da2bb8 100644
--- a/codegen/valagdbusservermodule.vala
+++ b/codegen/valagdbusservermodule.vala
@@ -505,7 +505,7 @@ public class Vala.GDBusServerModule : GDBusClientModule {
 				for (int dim = 1; dim <= array_type.rank; dim++) {
 					string length_cname = get_array_length_cname ("result", dim);
 
-					ccode.add_declaration ("int", new CCodeVariableDeclarator (length_cname));
+					ccode.add_declaration ("int", new CCodeVariableDeclarator.zero (length_cname, new CCodeConstant ("0")));
 					ccall.add_argument (new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, new CCodeIdentifier (length_cname)));
 				}
 			}



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