[glib: 10/11] Fix redefinition of local variable in gio/glib-compile-schemas.c




commit 7a5025934546b627368eb01f7888155a8567e3fb
Author: Loic Le Page <llepage fluendo com>
Date:   Wed Jan 19 18:45:20 2022 +0100

    Fix redefinition of local variable in gio/glib-compile-schemas.c

 gio/glib-compile-schemas.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
---
diff --git a/gio/glib-compile-schemas.c b/gio/glib-compile-schemas.c
index 7e1152f6b..83184e1e8 100644
--- a/gio/glib-compile-schemas.c
+++ b/gio/glib-compile-schemas.c
@@ -1038,7 +1038,7 @@ schema_state_add_override (SchemaState  *state,
                            GError      **error)
 {
   SchemaState *parent;
-  KeyState *original;
+  KeyState *original = NULL;
 
   if (state->extends == NULL)
     {
@@ -1386,14 +1386,14 @@ start_element (GMarkupParseContext  *context,
         }
       else if (strcmp (element_name, "override") == 0)
         {
-          const gchar *name, *l10n, *context;
+          const gchar *name, *l10n, *str_context;
 
-          if (COLLECT (STRING,            "name",    &name,
-                       OPTIONAL | STRING, "l10n",    &l10n,
-                       OPTIONAL | STRING, "context", &context))
+          if (COLLECT (STRING, "name", &name,
+                       OPTIONAL | STRING, "l10n", &l10n,
+                       OPTIONAL | STRING, "context", &str_context))
             schema_state_add_override (state->schema_state,
                                        &state->key_state, &state->string,
-                                       name, l10n, context, error);
+                                       name, l10n, str_context, error);
           return;
         }
     }
@@ -1403,11 +1403,11 @@ start_element (GMarkupParseContext  *context,
     {
       if (strcmp (element_name, "default") == 0)
         {
-          const gchar *l10n, *context;
-          if (COLLECT (STRING | OPTIONAL, "l10n",    &l10n,
-                       STRING | OPTIONAL, "context", &context))
+          const gchar *l10n, *str_context;
+          if (COLLECT (STRING | OPTIONAL, "l10n", &l10n,
+                       STRING | OPTIONAL, "context", &str_context))
             state->string = key_state_start_default (state->key_state,
-                                                     l10n, context, error);
+                                                     l10n, str_context, error);
           return;
         }
 


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