From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39081) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZMeu4-00019s-13 for qemu-devel@nongnu.org; Tue, 04 Aug 2015 12:17:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZMetx-00060n-Fk for qemu-devel@nongnu.org; Tue, 04 Aug 2015 12:17:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34519) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZMetx-00060h-9n for qemu-devel@nongnu.org; Tue, 04 Aug 2015 12:17:17 -0400 References: <1438679896-5077-1-git-send-email-armbru@redhat.com> <1438679896-5077-8-git-send-email-armbru@redhat.com> From: Eric Blake Message-ID: <55C0E583.9020606@redhat.com> Date: Tue, 4 Aug 2015 10:17:07 -0600 MIME-Version: 1.0 In-Reply-To: <1438679896-5077-8-git-send-email-armbru@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="PPLSB0IVTNMeoRCe79iU7md7HcxoSP6cE" Subject: Re: [Qemu-devel] [PATCH 07/26] qapi: Fix generated code when flat union has member 'kind' List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster , qemu-devel@nongnu.org Cc: mdroth@linux.vnet.ibm.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --PPLSB0IVTNMeoRCe79iU7md7HcxoSP6cE Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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'. >=20 > Example, adapted from qapi-schema-test.json: >=20 > { 'struct': 'UserDefUnionBase', > 'data': { 'kind': 'str', 'enum1': 'EnumOne' } } >=20 > We generate: >=20 > struct UserDefFlatUnion > { > EnumOne kind; > union { > void *data; > UserDefA *value1; > UserDefB *value2; > UserDefB *value3; > }; > char *kind; > }; >=20 > Kill the silly rename. >=20 > Reported-by: Eric Blake > Signed-off-by: Markus Armbruster > --- > 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 --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --PPLSB0IVTNMeoRCe79iU7md7HcxoSP6cE Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJVwOWEAAoJEKeha0olJ0NqUTUIAJBXqg+xu7CsClwuSPMISVI3 l+WThBU8rlPgkVtSUxyEf7VZ+HCYi37HXwX40NYM9MUNY5N9KJu4d6VOBwOETXxu b9OWB1/upJxDui/lwxSwaYaXgUnE+uHKGh7kJ9kYMu17+pvw34FZsXGxUJH5jcOa Nipdpvk7adFh/KCU46mpBb08d8mAM/Hdz+J240zVxbtTPIgv5q8bnJCcnrSEy+rR +eF7NJsdY5O240rF5+sOi742l6cToW6DFqr77wXcjBGhgatsvG9ac75mKxYKfchG qZ2pehl4iN7FvlRLPNEUwZNaUni2mVe879/oSA1QvdgOv3KuG3tbLh8UE07c/XM= =W5X7 -----END PGP SIGNATURE----- --PPLSB0IVTNMeoRCe79iU7md7HcxoSP6cE--