summary refs log tree commit diff stats
path: root/scripts/qapi-commands.py
diff options
context:
space:
mode:
authorAmos Kong <akong@redhat.com>2014-06-10 19:25:53 +0800
committerLuiz Capitulino <lcapitulino@redhat.com>2014-06-23 11:01:24 -0400
commit05dfb26cd2bf3f50a0fbf08a68a3bd415301edc5 (patch)
tree20632f405ec37031d16ab1747627a8fede02daed /scripts/qapi-commands.py
parent0d14eeb23325b6b1f0f9adce8baf7d1b415cba81 (diff)
downloadfocaccia-qemu-05dfb26cd2bf3f50a0fbf08a68a3bd415301edc5.tar.gz
focaccia-qemu-05dfb26cd2bf3f50a0fbf08a68a3bd415301edc5.zip
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>
Diffstat (limited to 'scripts/qapi-commands.py')
-rw-r--r--scripts/qapi-commands.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/qapi-commands.py b/scripts/qapi-commands.py
index 34f200a11c..053ba85b5f 100644
--- a/scripts/qapi-commands.py
+++ b/scripts/qapi-commands.py
@@ -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)