diff options
author | Eric Blake <eblake@redhat.com> | 2015-05-14 06:50:56 -0600 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2015-05-14 18:21:09 +0200 |
commit | fce384b8e5193e02421f6b2c2880f3684abcbdc0 (patch) | |
tree | 280923134e2ea8e0ee612a2184cce364b57ecfbf /scripts/qapi-visit.py | |
parent | c6405b54b7b09a876f2f2fba2aa6f8ac87189cb9 (diff) |
qapi: Support downstream enums
Enhance the testsuite to cover a downstream enum type and enum
string. Update the generator to mangle the enum name 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 | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/qapi-visit.py b/scripts/qapi-visit.py index 0368e62d23..7697ec65cc 100644 --- a/scripts/qapi-visit.py +++ b/scripts/qapi-visit.py @@ -173,7 +173,7 @@ out: error_propagate(errp, err); } ''', - name=name) + name=type_name(name)) def generate_visit_enum(name, members): return mcgen(''' @@ -183,7 +183,7 @@ void visit_type_%(name)s(Visitor *m, %(name)s *obj, const char *name, Error **er visit_type_enum(m, (int *)obj, %(name)s_lookup, "%(name)s", name, errp); } ''', - name=name) + name=c_name(name)) def generate_visit_alternate(name, members): ret = mcgen(''' @@ -364,7 +364,7 @@ def generate_enum_declaration(name, members): ret = mcgen(''' void visit_type_%(name)sList(Visitor *m, %(name)sList **obj, const char *name, Error **errp); ''', - name=name) + name=c_name(name)) return ret @@ -373,7 +373,7 @@ def generate_decl_enum(name, members): void visit_type_%(name)s(Visitor *m, %(name)s *obj, const char *name, Error **errp); ''', - name=name) + name=c_name(name)) try: opts, args = getopt.gnu_getopt(sys.argv[1:], "chbp:i:o:", |