giscanner/scannerparser.y: Avoid C99ism
authorChun-wei Fan <fanchunwei@src.gnome.org>
Fri, 10 Aug 2012 04:26:29 +0000 (12:26 +0800)
committerColin Walters <walters@verbum.org>
Sat, 27 Oct 2012 16:06:09 +0000 (12:06 -0400)
Move variable declarations to the start of block.

https://bugzilla.gnome.org/show_bug.cgi?id=681820

giscanner/scannerparser.y

index 06a10ef..81a9374 100644 (file)
@@ -814,11 +814,12 @@ type_specifier
 struct_or_union_specifier
        : struct_or_union identifier_or_typedef_name '{' struct_declaration_list '}'
          {
+               GISourceSymbol *sym;
                $$ = $1;
                $$->name = $2;
                $$->child_list = $4;
 
-               GISourceSymbol *sym = gi_source_symbol_new (CSYMBOL_TYPE_INVALID, scanner->current_filename, lineno);
+               sym = gi_source_symbol_new (CSYMBOL_TYPE_INVALID, scanner->current_filename, lineno);
                if ($$->type == CTYPE_STRUCT) {
                        sym->type = CSYMBOL_TYPE_STRUCT;
                } else if ($$->type == CTYPE_UNION) {
@@ -1468,9 +1469,9 @@ gi_source_scanner_parse_macros (GISourceScanner *scanner, GList *filenames)
   FILE *fmacros =
     fdopen (g_file_open_tmp ("gen-introspect-XXXXXX.h", &tmp_name, &error),
             "w+");
+  GList *l;
   g_unlink (tmp_name);
 
-  GList *l;
   for (l = filenames; l != NULL; l = l->next)
     {
       FILE *f = fopen (l->data, "r");