diff options
author | Eric Blake <eblake@redhat.com> | 2015-05-14 06:50:59 -0600 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2015-05-14 18:21:21 +0200 |
commit | 857af5f06c3fb097d1bb6bc8a23b9992aac99e75 (patch) | |
tree | 7007532f36bdb0ab5194e4fbe2f47764b0f74b17 /scripts/qapi-visit.py | |
parent | bb33729043ceda56b4068db13bdc17786ebd0ed0 (diff) |
qapi: Support downstream flat unions
Enhance the testsuite to cover downstream flat unions, including
the base type, discriminator name and type, and branch name and
type. Update the generator to mangle the union names in the
appropriate places.
Signed-off-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'scripts/qapi-visit.py')
-rw-r--r-- | scripts/qapi-visit.py | 4 |
1 files changed, 2 insertions, 2 deletions
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" |