aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/qapi-types.py7
-rw-r--r--scripts/qapi-visit.py6
2 files changed, 7 insertions, 6 deletions
diff --git a/scripts/qapi-types.py b/scripts/qapi-types.py
index 13e4b530f9..56651451c9 100644
--- a/scripts/qapi-types.py
+++ b/scripts/qapi-types.py
@@ -174,16 +174,17 @@ def generate_alternate_qtypes(expr):
ret = mcgen('''
const int %(name)s_qtypes[QTYPE_MAX] = {
''',
- name=name)
+ name=c_name(name))
for key in members:
qtype = find_alternate_member_qtype(members[key])
assert qtype, "Invalid alternate member"
ret += mcgen('''
- [ %(qtype)s ] = %(enum_const)s,
+ [%(qtype)s] = %(enum_const)s,
''',
- qtype = qtype, enum_const = c_enum_const(name + 'Kind', key))
+ qtype = qtype,
+ enum_const = c_enum_const(name + 'Kind', key))
ret += mcgen('''
};
diff --git a/scripts/qapi-visit.py b/scripts/qapi-visit.py
index c15305ffac..e511be357d 100644
--- a/scripts/qapi-visit.py
+++ b/scripts/qapi-visit.py
@@ -202,11 +202,11 @@ void visit_type_%(name)s(Visitor *m, %(name)s **obj, const char *name, Error **e
}
switch ((*obj)->kind) {
''',
- name=name)
+ name=c_name(name))
# For alternate, always use the default enum type automatically generated
- # as "'%sKind' % (name)"
- disc_type = '%sKind' % (name)
+ # as name + 'Kind'
+ disc_type = c_name(name) + 'Kind'
for key in members:
assert (members[key] in builtin_types.keys()