]> Git Repo - qemu.git/commitdiff
json-parser: drop superfluous assignment for token variable
authorGonglei <[email protected]>
Tue, 10 Jun 2014 09:20:24 +0000 (17:20 +0800)
committerLuiz Capitulino <[email protected]>
Wed, 11 Jun 2014 14:10:29 +0000 (10:10 -0400)
Signed-off-by: ChenLiang <[email protected]>
Signed-off-by: Gonglei <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Reviewed-by: Paolo Bonzini <[email protected]>
Signed-off-by: Luiz Capitulino <[email protected]>
qobject/json-parser.c

index e46c26448ee0c2132da9cd48046d1ce813a3c47e..4288267bd3efd5d5bc9035cef78245da7f21faad 100644 (file)
@@ -423,7 +423,6 @@ static QObject *parse_object(JSONParserContext *ctxt, va_list *ap)
     if (!token_is_operator(token, '{')) {
         goto out;
     }
-    token = NULL;
 
     dict = qdict_new();
 
@@ -449,7 +448,6 @@ static QObject *parse_object(JSONParserContext *ctxt, va_list *ap)
                 parse_error(ctxt, token, "expected separator in dict");
                 goto out;
             }
-            token = NULL;
 
             if (parse_pair(ctxt, dict, ap) == -1) {
                 goto out;
@@ -461,10 +459,8 @@ static QObject *parse_object(JSONParserContext *ctxt, va_list *ap)
                 goto out;
             }
         }
-        token = NULL;
     } else {
-        token = parser_context_pop_token(ctxt);
-        token = NULL;
+        (void)parser_context_pop_token(ctxt);
     }
 
     return QOBJECT(dict);
@@ -487,10 +483,8 @@ static QObject *parse_array(JSONParserContext *ctxt, va_list *ap)
     }
 
     if (!token_is_operator(token, '[')) {
-        token = NULL;
         goto out;
     }
-    token = NULL;
 
     list = qlist_new();
 
@@ -523,8 +517,6 @@ static QObject *parse_array(JSONParserContext *ctxt, va_list *ap)
                 goto out;
             }
 
-            token = NULL;
-
             obj = parse_value(ctxt, ap);
             if (obj == NULL) {
                 parse_error(ctxt, token, "expecting value");
@@ -539,11 +531,8 @@ static QObject *parse_array(JSONParserContext *ctxt, va_list *ap)
                 goto out;
             }
         }
-
-        token = NULL;
     } else {
-        token = parser_context_pop_token(ctxt);
-        token = NULL;
+        (void)parser_context_pop_token(ctxt);
     }
 
     return QOBJECT(list);
This page took 0.023822 seconds and 4 git commands to generate.