mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-27 04:13:53 -06:00
qapi: add const prefix to 'char *' insider c_type()
It's ugly to add const prefix for parameter type by an if statement outside c_type(). This patch adds a parameter to do it. Signed-off-by: Amos Kong <akong@redhat.com> Suggested-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
This commit is contained in:
parent
638ca8ad98
commit
0d14eeb233
2 changed files with 4 additions and 4 deletions
|
@ -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))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue