mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-01-08 22:45:43 +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
|
||||
|
||||
|
||||
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
|
||||
|
@ -2098,7 +2096,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'
|
||||
|
||||
|
||||
#
|
||||
|
|
Loading…
Reference in a new issue