mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-27 12:23: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
|
@ -470,8 +470,10 @@ def find_enum(name):
|
|||
def is_enum(name):
|
||||
return find_enum(name) != None
|
||||
|
||||
def c_type(name):
|
||||
def c_type(name, is_param=False):
|
||||
if name == 'str':
|
||||
if is_param:
|
||||
return 'const char *'
|
||||
return 'char *'
|
||||
elif name == 'int':
|
||||
return 'int64_t'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue