diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/qapi-types.py | 2 | ||||
-rw-r--r-- | scripts/qapi-visit.py | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/scripts/qapi-types.py b/scripts/qapi-types.py index 5118151..5b0bc5d 100644 --- a/scripts/qapi-types.py +++ b/scripts/qapi-types.py @@ -193,7 +193,7 @@ const int %(name)s_qtypes[QTYPE_MAX] = { def generate_union(expr, meta): - name = expr[meta] + name = c_name(expr[meta]) typeinfo = expr['data'] base = expr.get('base') diff --git a/scripts/qapi-visit.py b/scripts/qapi-visit.py index b500724..d1ec70b 100644 --- a/scripts/qapi-visit.py +++ b/scripts/qapi-visit.py @@ -255,9 +255,9 @@ def generate_visit_union(expr): disc_type = 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 as "'%sKind' % (name)" - ret = generate_visit_enum('%sKind' % name, members.keys()) - disc_type = '%sKind' % (name) + # it is an enum type generated silently + ret = generate_visit_enum(name + 'Kind', members.keys()) + disc_type = c_name(name) + 'Kind' if base: assert discriminator @@ -281,7 +281,7 @@ void visit_type_%(name)s(Visitor *m, %(name)s **obj, const char *name, Error **e } if (*obj) { ''', - name=name) + name=c_name(name)) if base: ret += mcgen(''' |