From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35383) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZkCdS-0003KL-8y for qemu-devel@nongnu.org; Thu, 08 Oct 2015 10:57:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZkCdO-0002Rw-1C for qemu-devel@nongnu.org; Thu, 08 Oct 2015 10:57:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36640) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZkCdN-0002Rh-Rb for qemu-devel@nongnu.org; Thu, 08 Oct 2015 10:57:29 -0400 References: <1443930073-19359-8-git-send-email-eblake@redhat.com> <1444307217-16306-1-git-send-email-armbru@redhat.com> From: Eric Blake Message-ID: <5616843B.1080101@redhat.com> Date: Thu, 8 Oct 2015 08:56:59 -0600 MIME-Version: 1.0 In-Reply-To: <1444307217-16306-1-git-send-email-armbru@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="8T9TJFF6HAFG3kIf6pX3H9J1gH95qFhh7" Subject: Re: [Qemu-devel] [RFC PATCH] qapi: Rename simple union's generated tag member to type List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster , qemu-devel@nongnu.org Cc: marcandre.lureau@redhat.com, mdroth@linux.vnet.ibm.com, ehabkost@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --8T9TJFF6HAFG3kIf6pX3H9J1gH95qFhh7 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 10/08/2015 06:26 AM, Markus Armbruster wrote: > Struct and union type members are generally named alike in QMP and C, > except for a simple union's implicit tag member, which is "type" in > QMP, and "kind" in C. Can't change QMP, so rename it in C. >=20 > Since the implicit enumeration type is still called *Kind, this > doesn't clean up the type vs. kind mess completely. Looks very similar to my v5 31/46 https://lists.gnu.org/archive/html/qemu-devel/2015-09/msg05445.html and still waiting for us to get that far into the reviews. I guess pulling it earlier into the series is worth doing, if it will help us avoid some hacks. >=20 > Signed-off-by: Markus Armbruster > --- > +++ b/scripts/qapi-types.py > @@ -135,10 +135,9 @@ struct %(c_name)s { > /* Own members: */ > ''') > else: > - ret +=3D mcgen(''' > - %(c_type)s kind; > -''', > - c_type=3Dc_name(variants.tag_member.type.name)) > + ret +=3D gen_struct_field(variants.tag_member.name, > + variants.tag_member.type, > + False); Hmm, I hadn't even thought to use that. But it would require tweaks to work with my pending change to alternates to use 'qtype_code', because in that patch I intentionally left variants.tag_member.type as None (and instead used variants.tag_member.c_type() to get the string 'qtype_code')= : https://lists.gnu.org/archive/html/qemu-devel/2015-10/msg01985.html --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --8T9TJFF6HAFG3kIf6pX3H9J1gH95qFhh7 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/ iQEcBAEBCAAGBQJWFoQ7AAoJEKeha0olJ0NqGcwH/3rwyy0oTam6QZGbU+6QiolV 01pBykfmmwwprhPHKVl3zqZ1tNk8M57EzR/D+wCaYMklzqjlEKNFLSFQcXX67JfA OZkxG2X23l+wxq3vn+xwxTTF9bxZbVqSrdH2GPtuZNozwHJC1XCMBSN7Sn/zMG3q 84hiwNg8QTwR/a74fRSgaaZn4+y+jAogCC9a6scfnbKAyY7dDxK0ohz+ZKa/mFCO PydTa/ZBlu5dZp5NOQOJbOW2wna8gJ6WdLK6lCBnV3MQfBTOZ05JQzgwBOQUp5xU 0ILTGeHa6S8DVnHBMHVkisM1VTnqIejAbvyJbNNIDNdKcFvlDkaxjMlkXZPWbGs= =jnus -----END PGP SIGNATURE----- --8T9TJFF6HAFG3kIf6pX3H9J1gH95qFhh7--