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:
Amos Kong 2014-06-10 19:25:53 +08:00 committed by Luiz Capitulino
parent 0d14eeb233
commit 05dfb26cd2
2 changed files with 19 additions and 8 deletions

View file

@ -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)