mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-01-09 22:35:39 +00:00
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. Backports commit bdd2d42b890b3a908fa3fbdc9661541e1b57eb15 from qemu
This commit is contained in:
parent
81f8a1be80
commit
4a8e094958
|
@ -2078,16 +2078,14 @@ extern const char *const %(c_name)s_lookup[];
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
|
||||||
def build_params(arg_type, boxed, extra):
|
def build_params(arg_type, boxed, extra=None):
|
||||||
if not arg_type:
|
|
||||||
assert not boxed
|
|
||||||
return extra
|
|
||||||
ret = ''
|
ret = ''
|
||||||
sep = ''
|
sep = ''
|
||||||
if boxed:
|
if boxed:
|
||||||
|
assert arg_type
|
||||||
ret += '%s arg' % arg_type.c_param_type()
|
ret += '%s arg' % arg_type.c_param_type()
|
||||||
sep = ', '
|
sep = ', '
|
||||||
else:
|
elif arg_type:
|
||||||
assert not arg_type.variants
|
assert not arg_type.variants
|
||||||
for memb in arg_type.members:
|
for memb in arg_type.members:
|
||||||
ret += sep
|
ret += sep
|
||||||
|
@ -2098,7 +2096,7 @@ def build_params(arg_type, boxed, extra):
|
||||||
c_name(memb.name))
|
c_name(memb.name))
|
||||||
if extra:
|
if extra:
|
||||||
ret += sep + extra
|
ret += sep + extra
|
||||||
return ret
|
return ret if ret else 'void'
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
Loading…
Reference in a new issue