diff options
Diffstat (limited to 'scripts/qapi-commands.py')
-rw-r--r-- | scripts/qapi-commands.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/scripts/qapi-commands.py b/scripts/qapi-commands.py index 7d93d01..053ba85 100644 --- a/scripts/qapi-commands.py +++ b/scripts/qapi-commands.py @@ -29,9 +29,7 @@ def type_visitor(name): def generate_command_decl(name, args, ret_type): arglist="" for argname, argtype, optional, structured in parse_args(args): - argtype = c_type(argtype) - if argtype == "char *": - argtype = "const char *" + argtype = c_type(argtype, is_param=True) if optional: arglist += "bool has_%s, " % c_var(argname) arglist += "%s %s, " % (argtype, c_var(argname)) @@ -104,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; ''', @@ -229,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) |