yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

Blame SOURCES/kvm-json-parser-drop-superfluous-assignment-for-token-va.patch

34b321
From 110f5902133db4e8a46c9cc18ed0d4ed2e99aec2 Mon Sep 17 00:00:00 2001
34b321
From: Markus Armbruster <armbru@redhat.com>
34b321
Date: Wed, 27 Jul 2016 07:34:59 +0200
34b321
Subject: [PATCH 01/16] json-parser: drop superfluous assignment for token
34b321
 variable
34b321
34b321
RH-Author: Markus Armbruster <armbru@redhat.com>
34b321
Message-id: <1469604913-12442-3-git-send-email-armbru@redhat.com>
34b321
Patchwork-id: 71470
34b321
O-Subject: [RHEL-7.3 qemu-kvm PATCH v2 01/15] json-parser: drop superfluous assignment for token variable
34b321
Bugzilla: 1276036
34b321
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
34b321
RH-Acked-by: John Snow <jsnow@redhat.com>
34b321
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
34b321
34b321
From: Gonglei <arei.gonglei@huawei.com>
34b321
34b321
Signed-off-by: ChenLiang <chenliang88@huawei.com>
34b321
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
34b321
Reviewed-by: Eric Blake <eblake@redhat.com>
34b321
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
34b321
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
34b321
(cherry picked from commit a491af471bf8f1188b2665f54d109065d4591e45)
34b321
Signed-off-by: Markus Armbruster <armbru@redhat.com>
34b321
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
34b321
---
34b321
 qobject/json-parser.c | 15 ++-------------
34b321
 1 file changed, 2 insertions(+), 13 deletions(-)
34b321
34b321
diff --git a/qobject/json-parser.c b/qobject/json-parser.c
34b321
index e7947b3..fa09769 100644
34b321
--- a/qobject/json-parser.c
34b321
+++ b/qobject/json-parser.c
34b321
@@ -423,7 +423,6 @@ static QObject *parse_object(JSONParserContext *ctxt, va_list *ap)
34b321
     if (!token_is_operator(token, '{')) {
34b321
         goto out;
34b321
     }
34b321
-    token = NULL;
34b321
 
34b321
     dict = qdict_new();
34b321
 
34b321
@@ -449,7 +448,6 @@ static QObject *parse_object(JSONParserContext *ctxt, va_list *ap)
34b321
                 parse_error(ctxt, token, "expected separator in dict");
34b321
                 goto out;
34b321
             }
34b321
-            token = NULL;
34b321
 
34b321
             if (parse_pair(ctxt, dict, ap) == -1) {
34b321
                 goto out;
34b321
@@ -461,10 +459,8 @@ static QObject *parse_object(JSONParserContext *ctxt, va_list *ap)
34b321
                 goto out;
34b321
             }
34b321
         }
34b321
-        token = NULL;
34b321
     } else {
34b321
-        token = parser_context_pop_token(ctxt);
34b321
-        token = NULL;
34b321
+        (void)parser_context_pop_token(ctxt);
34b321
     }
34b321
 
34b321
     return QOBJECT(dict);
34b321
@@ -487,10 +483,8 @@ static QObject *parse_array(JSONParserContext *ctxt, va_list *ap)
34b321
     }
34b321
 
34b321
     if (!token_is_operator(token, '[')) {
34b321
-        token = NULL;
34b321
         goto out;
34b321
     }
34b321
-    token = NULL;
34b321
 
34b321
     list = qlist_new();
34b321
 
34b321
@@ -523,8 +517,6 @@ static QObject *parse_array(JSONParserContext *ctxt, va_list *ap)
34b321
                 goto out;
34b321
             }
34b321
 
34b321
-            token = NULL;
34b321
-
34b321
             obj = parse_value(ctxt, ap);
34b321
             if (obj == NULL) {
34b321
                 parse_error(ctxt, token, "expecting value");
34b321
@@ -539,11 +531,8 @@ static QObject *parse_array(JSONParserContext *ctxt, va_list *ap)
34b321
                 goto out;
34b321
             }
34b321
         }
34b321
-
34b321
-        token = NULL;
34b321
     } else {
34b321
-        token = parser_context_pop_token(ctxt);
34b321
-        token = NULL;
34b321
+        (void)parser_context_pop_token(ctxt);
34b321
     }
34b321
 
34b321
     return QOBJECT(list);
34b321
-- 
34b321
1.8.3.1
34b321