aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/qapi-types.py2
-rw-r--r--scripts/qapi-visit.py4
2 files changed, 3 insertions, 3 deletions
diff --git a/scripts/qapi-types.py b/scripts/qapi-types.py
index 5b0bc5d353..13e4b530f9 100644
--- a/scripts/qapi-types.py
+++ b/scripts/qapi-types.py
@@ -213,7 +213,7 @@ struct %(name)s
void *data;
''',
name=name,
- discriminator_type_name=discriminator_type_name)
+ discriminator_type_name=c_name(discriminator_type_name))
for key in typeinfo:
ret += mcgen('''
diff --git a/scripts/qapi-visit.py b/scripts/qapi-visit.py
index d1ec70b964..c15305ffac 100644
--- a/scripts/qapi-visit.py
+++ b/scripts/qapi-visit.py
@@ -252,7 +252,7 @@ def generate_visit_union(expr):
if enum_define:
# Use the enum type as discriminator
ret = ""
- disc_type = enum_define['enum_name']
+ disc_type = c_name(enum_define['enum_name'])
else:
# There will always be a discriminator in the C switch code, by default
# it is an enum type generated silently
@@ -290,7 +290,7 @@ void visit_type_%(name)s(Visitor *m, %(name)s **obj, const char *name, Error **e
goto out_obj;
}
''',
- name=name)
+ name=c_name(name))
if not discriminator:
disc_key = "type"