mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-27 04:13:53 -06:00
qapi: Rename identical c_fun()/c_var() into c_name()
Now that the two functions are identical, we only need one of them, and we might as well give it a more descriptive name. Basically, the function serves as the translation from a QAPI name into a (portion of a) C identifier, without regards to whether it is a variable or function name. Signed-off-by: Eric Blake <eblake@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
This commit is contained in:
parent
47299262de
commit
18df515ebb
5 changed files with 36 additions and 38 deletions
|
@ -68,11 +68,11 @@ def generate_struct_fields(members):
|
|||
ret += mcgen('''
|
||||
bool has_%(c_name)s;
|
||||
''',
|
||||
c_name=c_var(argname))
|
||||
c_name=c_name(argname))
|
||||
ret += mcgen('''
|
||||
%(c_type)s %(c_name)s;
|
||||
''',
|
||||
c_type=c_type(argentry), c_name=c_var(argname))
|
||||
c_type=c_type(argentry), c_name=c_name(argname))
|
||||
|
||||
return ret
|
||||
|
||||
|
@ -184,7 +184,7 @@ const int %(name)s_qtypes[QTYPE_MAX] = {
|
|||
''',
|
||||
qtype = qtype,
|
||||
abbrev = de_camel_case(name).upper(),
|
||||
enum = c_fun(de_camel_case(key),False).upper())
|
||||
enum = c_name(de_camel_case(key),False).upper())
|
||||
|
||||
ret += mcgen('''
|
||||
};
|
||||
|
@ -221,7 +221,7 @@ struct %(name)s
|
|||
%(c_type)s %(c_name)s;
|
||||
''',
|
||||
c_type=c_type(typeinfo[key]),
|
||||
c_name=c_fun(key))
|
||||
c_name=c_name(key))
|
||||
|
||||
ret += mcgen('''
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue