From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35377) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZektU-00082H-C5 for qemu-devel@nongnu.org; Wed, 23 Sep 2015 10:19:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZektR-000294-8D for qemu-devel@nongnu.org; Wed, 23 Sep 2015 10:19:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35100) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZektR-00028u-3A for qemu-devel@nongnu.org; Wed, 23 Sep 2015 10:19:33 -0400 References: <1442872682-6523-1-git-send-email-eblake@redhat.com> <1442872682-6523-4-git-send-email-eblake@redhat.com> <87h9mmfpf7.fsf@blackfin.pond.sub.org> <5601955B.4050109@redhat.com> <87a8sda2t8.fsf@blackfin.pond.sub.org> <56029F04.3040407@redhat.com> <87r3lp5j4f.fsf@blackfin.pond.sub.org> From: Eric Blake Message-ID: <5602B4EE.8010903@redhat.com> Date: Wed, 23 Sep 2015 08:19:26 -0600 MIME-Version: 1.0 In-Reply-To: <87r3lp5j4f.fsf@blackfin.pond.sub.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="IfmKJkdhiIoNMv1bobntocKixJ2gQQ6sg" Subject: Re: [Qemu-devel] [PATCH v5 03/46] qapi: Test for C member name collisions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: marcandre.lureau@redhat.com, DirtY.iCE.hu@gmail.com, Michael Roth , ehabkost@redhat.com, qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --IfmKJkdhiIoNMv1bobntocKixJ2gQQ6sg Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 09/23/2015 08:02 AM, Markus Armbruster wrote: >> However, I'm not sure it would always help. The conversion of >> netdev_add to full qapi relies on being able to access the variant >> through a named struct (such as NetdevTapOptions); unboxing the varian= t >> would get rid of the convenient access to these named sub-structs. >=20 > struct Union { > EnumType type; > /* union tag is @type */ > union { > One one; > Two two; > }; > }; >=20 > For base, we go one step further and peel off the struct, to save some > notational overhead. Pointless for unions. Ah, I see. Instead of malloc'ing a sub-struct and calling (roughly) ptr =3D visit_start_struct(Union) // mallocs subptr =3D visit_start_implicit_struct(One) // also mallocs visit_type_fields(subptr) visit_end_implicit_struct() we would instead use inline allocation, with: ptr =3D visit_start_struct(Union) // mallocs visit_type_fields(&ptr->one) seems straightforward enough; I'll play with the idea on top of my series= =2E --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --IfmKJkdhiIoNMv1bobntocKixJ2gQQ6sg 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/ iQEcBAEBCAAGBQJWArTuAAoJEKeha0olJ0NqUE8H/iZLkCdv0W54wFNPzxBxTx3e XdLFFkjWeLnQnWg0o4uIx4jQVRNTsvodS/JfLeK75kBnDLHwfhaszodTjUng3vMT fc466kDmBSVlFHDlF2cn9reoj0Jh2JbQzrZroQSgBC3I8KRhyOnzPdRsA0JAuepu kvhvtEDjZXyQJzCVcJ3xKuClFtKNBwrVbI3zYggaMkY3FXqVdCUJwH41+2Ct9jxU O8PVisdLrlhXE9QzsBbXlwZfEmVeqxg/154gsL/QZo17BEFldRSRhnP2D6UPGSFa v0WOnCvdd5Y2x9T0JPmGVpASf6R4ByxjfkaK1xtHf3RHglxey/NhEqI3ktiVMzE= =bv0D -----END PGP SIGNATURE----- --IfmKJkdhiIoNMv1bobntocKixJ2gQQ6sg--