On 08/04/2015 03:17 AM, Markus Armbruster wrote: > A flat union's tag member gets renamed to 'kind' in the generated > code. Breaks when another member is named 'kind' exists.
Too many verbs. Drop either 'is' or 'exists'. > > Example, adapted from qapi-schema-test.json: > > { 'struct': 'UserDefUnionBase', > 'data': { 'kind': 'str', 'enum1': 'EnumOne' } } > > We generate: > > struct UserDefFlatUnion > { > EnumOne kind; > union { > void *data; > UserDefA *value1; > UserDefB *value2; > UserDefB *value3; > }; > char *kind; > }; > > Kill the silly rename. > > Reported-by: Eric Blake <ebl...@redhat.com> > Signed-off-by: Markus Armbruster <arm...@redhat.com> > --- > scripts/qapi-types.py | 3 ++- > scripts/qapi-visit.py | 7 +++++-- > tests/test-qmp-input-visitor.c | 2 +- > tests/test-qmp-output-visitor.c | 2 +- > 4 files changed, 9 insertions(+), 5 deletions(-) Reviewed-by: Eric Blake <ebl...@redhat.com> -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature