From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36459) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZIFjY-000179-Qh for qemu-devel@nongnu.org; Thu, 23 Jul 2015 08:36:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZIFjU-0005Mn-4i for qemu-devel@nongnu.org; Thu, 23 Jul 2015 08:36:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56943) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZIFjT-0005Mf-Vo for qemu-devel@nongnu.org; Thu, 23 Jul 2015 08:36:16 -0400 References: <1435782155-31412-1-git-send-email-armbru@redhat.com> <1435782155-31412-23-git-send-email-armbru@redhat.com> From: Eric Blake Message-ID: <55B0DFBE.1010403@redhat.com> Date: Thu, 23 Jul 2015 06:36:14 -0600 MIME-Version: 1.0 In-Reply-To: <1435782155-31412-23-git-send-email-armbru@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="MKkP7PhFWthar20oIbUBNctdT7PMrbR7W" Subject: Re: [Qemu-devel] [PATCH RFC v2 22/47] qapi: QAPISchema code generation helper methods List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster , qemu-devel@nongnu.org Cc: kwolf@redhat.com, berto@igalia.com, mdroth@linux.vnet.ibm.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --MKkP7PhFWthar20oIbUBNctdT7PMrbR7W Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 07/01/2015 02:22 PM, Markus Armbruster wrote: > New methods c_name(), c_type(), c_null(), json_type(), > alternate_qtype(). >=20 > Signed-off-by: Markus Armbruster > --- > scripts/qapi.py | 72 +++++++++++++++++++++++++++++++++++++++++++++++++= ++------ > 1 file changed, 65 insertions(+), 7 deletions(-) >=20 I just noticed: > @@ -779,6 +811,12 @@ class QAPISchemaEnumType(QAPISchemaType): > for v in values: > assert isinstance(v, str) > self.values =3D values > + def c_type(self, is_param=3DFalse): > + return c_name(self.name) > + def c_null(self): > + return c_enum_const(self.name, self.values[0]) What does this return for an empty enum, as in { 'enum':'Empty', 'data':[] }? Our testsuite proves we can do that, even if our normal =2Ejson code doesn't use it. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --MKkP7PhFWthar20oIbUBNctdT7PMrbR7W 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/ iQEcBAEBCAAGBQJVsN++AAoJEKeha0olJ0NqdDkIAKfJpd/YxwQAVlrcvC7OaS7H 0oo54Oe5OFpzK06sr3fvRfHyNeJglZk80uuMguLM3h+Jtt8QF2kctTK1u6L19jSk G+cQAdB5oxloqt93sbC3YixRmkfEp7v2RT0yqh41x/X25aqNJLHBIdY9Fwjh0V5w WPMqdzraNkPaidGHsUl5C9/cmC44hsbCTM1dqzomqDfQ/ksnY1w7Smc0yUsIstaE cCdU+69FCH+aQBgy8peuxCaTBJB6ZkggsL7bnV4rsZiDgxXkZ5/WB524PI0DXpdN yGXYIzhAEvr+iaLhdUYGra4GFfz3bTkWI+0O8iG5Mae3t9TcDEmJuAQlk75silg= =Czqq -----END PGP SIGNATURE----- --MKkP7PhFWthar20oIbUBNctdT7PMrbR7W--