mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-27 04:13:53 -06:00
qapi: do not protect enum values from namespace pollution
Enum values are always preceded by the uppercase name of the enum, so they do not conflict with reserved words. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
This commit is contained in:
parent
f513cbf750
commit
eda50a656f
3 changed files with 7 additions and 7 deletions
|
@ -91,9 +91,9 @@ const char *%(name)s_lookup[] = {
|
|||
|
||||
def generate_enum_name(name):
|
||||
if name.isupper():
|
||||
return c_fun(name)
|
||||
return c_fun(name, False)
|
||||
new_name = ''
|
||||
for c in c_fun(name):
|
||||
for c in c_fun(name, False):
|
||||
if c.isupper():
|
||||
new_name += '_'
|
||||
new_name += c
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue