diff options
author | Eric Blake <eblake@redhat.com> | 2015-05-04 09:05:00 -0600 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2015-05-05 18:39:00 +0200 |
commit | b52c4b9cf0bbafdf8cede4ea1f62770d86815718 (patch) | |
tree | 22f61e3eed024e1331d1e54a5c7748d3f6648363 /scripts/qapi-visit.py | |
parent | e790e666518e68134ca0570b6b4a707169ea3cb1 (diff) | |
download | qemu-b52c4b9cf0bbafdf8cede4ea1f62770d86815718.tar.gz qemu-b52c4b9cf0bbafdf8cede4ea1f62770d86815718.tar.bz2 qemu-b52c4b9cf0bbafdf8cede4ea1f62770d86815718.zip |
qapi: Simplify builtin type handling
There was some redundancy between builtin_types[] and
builtin_type_qtypes{}. Merge them into one.
Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'scripts/qapi-visit.py')
-rw-r--r-- | scripts/qapi-visit.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/scripts/qapi-visit.py b/scripts/qapi-visit.py index 1be4d67d8a..41596bb95b 100644 --- a/scripts/qapi-visit.py +++ b/scripts/qapi-visit.py @@ -261,7 +261,7 @@ void visit_type_%(name)s(Visitor *m, %(name)s **obj, const char *name, Error **e disc_type = '%sKind' % (name) for key in members: - assert (members[key] in builtin_types + assert (members[key] in builtin_types.keys() or find_struct(members[key]) or find_union(members[key]) or find_enum(members[key])), "Invalid anonymous union member" @@ -538,7 +538,7 @@ exprs = parse_schema(input_file) # to avoid header dependency hell, we always generate declarations # for built-in types in our header files and simply guard them fdecl.write(guardstart("QAPI_VISIT_BUILTIN_VISITOR_DECL")) -for typename in builtin_types: +for typename in builtin_types.keys(): fdecl.write(generate_declaration(typename, None, builtin_type=True)) fdecl.write(guardend("QAPI_VISIT_BUILTIN_VISITOR_DECL")) @@ -546,7 +546,7 @@ fdecl.write(guardend("QAPI_VISIT_BUILTIN_VISITOR_DECL")) # have the functions defined, so we use -b option to provide control # over these cases if do_builtins: - for typename in builtin_types: + for typename in builtin_types.keys(): fdef.write(generate_visit_list(typename, None)) for expr in exprs: |