提交 bdd2d42b 编写于 作者: M Markus Armbruster

qapi: Fix build_params() for empty parameter list

build_params() returns '' instead of 'void' when there are no
parameters.  Can't happen now, but the next commit will change that.
Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
[peterx: compose the patch from email replies]
Signed-off-by: NPeter Xu <peterx@redhat.com>
Message-Id: <20180815133747.25032-3-peterx@redhat.com>
上级 19b599f7
......@@ -2070,16 +2070,14 @@ extern const QEnumLookup %(c_name)s_lookup;
return ret
def build_params(arg_type, boxed, extra):
if not arg_type:
assert not boxed
return extra
def build_params(arg_type, boxed, extra=None):
ret = ''
sep = ''
if boxed:
assert arg_type
ret += '%s arg' % arg_type.c_param_type()
sep = ', '
else:
elif arg_type:
assert not arg_type.variants
for memb in arg_type.members:
ret += sep
......@@ -2090,7 +2088,7 @@ def build_params(arg_type, boxed, extra):
c_name(memb.name))
if extra:
ret += sep + extra
return ret
return ret if ret else 'void'
#
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册