mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-02-02 09:30:58 +00:00
qapi: De-duplicate parameter list generation
Generated qapi-event.[ch] lose line breaks. No change otherwise. Backports commit 03b4367a556179e3e59affa535493427bd009e9d from qemu
This commit is contained in:
parent
b4187c01da
commit
66def00922
|
@ -1465,6 +1465,22 @@ extern const char *const %(c_name)s_lookup[];
|
|||
c_name=c_name(name))
|
||||
return ret
|
||||
|
||||
def gen_params(arg_type, extra):
|
||||
if not arg_type:
|
||||
return extra
|
||||
assert not arg_type.variants
|
||||
ret = ''
|
||||
sep = ''
|
||||
for memb in arg_type.members:
|
||||
ret += sep
|
||||
sep = ', '
|
||||
if memb.optional:
|
||||
ret += 'bool has_%s, ' % c_name(memb.name)
|
||||
ret += '%s %s' % (memb.type.c_type(is_param=True), c_name(memb.name))
|
||||
if extra:
|
||||
ret += sep + extra
|
||||
return ret
|
||||
|
||||
#
|
||||
# Common command line parsing
|
||||
#
|
||||
|
|
Loading…
Reference in a new issue