From 110f5902133db4e8a46c9cc18ed0d4ed2e99aec2 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Wed, 27 Jul 2016 07:34:59 +0200 Subject: [PATCH 01/16] json-parser: drop superfluous assignment for token variable RH-Author: Markus Armbruster Message-id: <1469604913-12442-3-git-send-email-armbru@redhat.com> Patchwork-id: 71470 O-Subject: [RHEL-7.3 qemu-kvm PATCH v2 01/15] json-parser: drop superfluous assignment for token variable Bugzilla: 1276036 RH-Acked-by: Miroslav Rezanina RH-Acked-by: John Snow RH-Acked-by: Paolo Bonzini From: Gonglei Signed-off-by: ChenLiang Signed-off-by: Gonglei Reviewed-by: Eric Blake Reviewed-by: Paolo Bonzini Signed-off-by: Luiz Capitulino (cherry picked from commit a491af471bf8f1188b2665f54d109065d4591e45) Signed-off-by: Markus Armbruster Signed-off-by: Miroslav Rezanina --- qobject/json-parser.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/qobject/json-parser.c b/qobject/json-parser.c index e7947b3..fa09769 100644 --- a/qobject/json-parser.c +++ b/qobject/json-parser.c @@ -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); -- 1.8.3.1