qapi: Don't use c_var() on enum strings
authorLuiz Capitulino <lcapitulino@redhat.com>
Wed, 28 Sep 2011 19:56:56 +0000 (16:56 -0300)
committerLuiz Capitulino <lcapitulino@redhat.com>
Tue, 4 Oct 2011 14:00:46 +0000 (11:00 -0300)
Otherwise if we have something like 'foo-bar' in the schema,
it will be generated as 'foo_bar' in the string lookup table.

c_var() is good for C variables, but not for enum strings.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
scripts/qapi-types.py

index 4797a70..3bacc0c 100644 (file)
@@ -70,7 +70,7 @@ const char *%(name)s_lookup[] = {
         ret += mcgen('''
     "%(value)s",
 ''',
-                     value=c_var(value).lower())
+                     value=value.lower())
 
     ret += mcgen('''
     NULL,