[json-glib] Initialize out variables before using them



commit 80c5178127052e600146ca889500e263da4ebf10
Author: Vincent Untz <vuntz gnome org>
Date:   Sun Dec 27 02:09:44 2009 +0100

    Initialize out variables before using them
    
    Here's a small patch for json-glib, to fix some gcc warnings breaking
    the build with -Werror (gcc can't know if the variable will get
    initialized or not). I didn't find a product for json-glib in bugzilla,
    but I guess a mail will work ;-)
    
    Happy holidays :-)
    
    Signed-off-by: Emmanuele Bassi <ebassi linux intel com>

 json-glib/json-gobject.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/json-glib/json-gobject.c b/json-glib/json-gobject.c
index 462a2c8..ae98b2b 100644
--- a/json-glib/json-gobject.c
+++ b/json-glib/json-gobject.c
@@ -503,7 +503,7 @@ json_deserialize_pspec (GValue     *value,
 
         case G_TYPE_ENUM:
           {
-            gint enum_value;
+            gint enum_value = 0;
 
             if (G_VALUE_HOLDS (&node_value, G_TYPE_INT64))
               {
@@ -524,7 +524,7 @@ json_deserialize_pspec (GValue     *value,
 
         case G_TYPE_FLAGS:
           {
-            gint flags_value;
+            gint flags_value = 0;
 
             if (G_VALUE_HOLDS (&node_value, G_TYPE_INT64))
               {



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