qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH v8 29.5/35] fixup! qapi: Canonicalize missing object


From: Eric Blake
Subject: [Qemu-devel] [PATCH v8 29.5/35] fixup! qapi: Canonicalize missing object to :empty
Date: Wed, 23 Dec 2015 10:54:34 -0700

[original message is fine; here's a couple more related changes
that can be squashed in]

Signed-off-by: Eric Blake <address@hidden>
---
 scripts/qapi-commands.py | 10 +++++-----
 scripts/qapi.py          |  3 +--
 2 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/scripts/qapi-commands.py b/scripts/qapi-commands.py
index 632350d..9d455c3 100644
--- a/scripts/qapi-commands.py
+++ b/scripts/qapi-commands.py
@@ -29,11 +29,11 @@ def gen_call(name, arg_type, ret_type):
     ret = ''

     argstr = ''
-    if arg_type:
-        for memb in arg_type.members:
-            if memb.optional:
-                argstr += 'has_%s, ' % c_name(memb.name)
-            argstr += '%s, ' % c_name(memb.name)
+    assert arg_type
+    for memb in arg_type.members:
+        if memb.optional:
+            argstr += 'has_%s, ' % c_name(memb.name)
+        argstr += '%s, ' % c_name(memb.name)

     lhs = ''
     if ret_type:
diff --git a/scripts/qapi.py b/scripts/qapi.py
index 2da43a5..e9006e4 100644
--- a/scripts/qapi.py
+++ b/scripts/qapi.py
@@ -1612,8 +1612,7 @@ extern const char *const %(c_name)s_lookup[];


 def gen_params(arg_type, extra):
-    if not arg_type:
-        return extra
+    assert arg_type
     assert not arg_type.variants
     ret = ''
     sep = ''
-- 
2.4.3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]