mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-27 04:13:53 -06:00
qapi: Suppress unwanted space between type and identifier
We always generate a space between type and identifier in parameter and variable declarations, even when idiomatic C style doesn't have a space there. Suppress it. Signed-off-by: Amos Kong <akong@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
This commit is contained in:
parent
0d14eeb233
commit
05dfb26cd2
2 changed files with 19 additions and 8 deletions
|
@ -102,7 +102,7 @@ def gen_visitor_input_vars_decl(args):
|
|||
bool has_%(argname)s = false;
|
||||
''',
|
||||
argname=c_var(argname))
|
||||
if c_type(argtype).endswith("*"):
|
||||
if is_c_ptr(argtype):
|
||||
ret += mcgen('''
|
||||
%(argtype)s %(argname)s = NULL;
|
||||
''',
|
||||
|
@ -227,7 +227,7 @@ def gen_marshal_input(name, args, ret_type, middle_mode):
|
|||
''')
|
||||
|
||||
if ret_type:
|
||||
if c_type(ret_type).endswith("*"):
|
||||
if is_c_ptr(ret_type):
|
||||
retval = " %s retval = NULL;" % c_type(ret_type)
|
||||
else:
|
||||
retval = " %s retval;" % c_type(ret_type)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue