summary refs log tree commit diff stats
path: root/scripts/qapi-types.py
diff options
context:
space:
mode:
authorWenchao Xia <wenchaoqemu@gmail.com>2014-03-04 18:44:35 -0800
committerLuiz Capitulino <lcapitulino@redhat.com>2014-03-11 09:07:42 -0400
commit6299659f54420955419c4995283f7dd770367939 (patch)
tree744a4933677691056b7c8c1d6309e6e5eecfee3a /scripts/qapi-types.py
parentb86b05ed60d8d49c5770851860d4e6b89c133e7e (diff)
downloadfocaccia-qemu-6299659f54420955419c4995283f7dd770367939.tar.gz
focaccia-qemu-6299659f54420955419c4995283f7dd770367939.zip
qapi script: code move for generate_enum_name()
Later both qapi-types.py and qapi-visit.py need a common function
for enum name generation.

Signed-off-by: Wenchao Xia <wenchaoqemu@gmail.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Diffstat (limited to 'scripts/qapi-types.py')
-rw-r--r--scripts/qapi-types.py10
1 files changed, 0 insertions, 10 deletions
diff --git a/scripts/qapi-types.py b/scripts/qapi-types.py
index 2c6e0dcd5c..35ad9931b6 100644
--- a/scripts/qapi-types.py
+++ b/scripts/qapi-types.py
@@ -127,16 +127,6 @@ const char *%(name)s_lookup[] = {
 ''')
     return ret
 
-def generate_enum_name(name):
-    if name.isupper():
-        return c_fun(name, False)
-    new_name = ''
-    for c in c_fun(name, False):
-        if c.isupper():
-            new_name += '_'
-        new_name += c
-    return new_name.lstrip('_').upper()
-
 def generate_enum(name, values):
     lookup_decl = mcgen('''
 extern const char *%(name)s_lookup[];