From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39613) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZN23V-00017X-Ba for qemu-devel@nongnu.org; Wed, 05 Aug 2015 13:00:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZN23P-0008BC-Ia for qemu-devel@nongnu.org; Wed, 05 Aug 2015 13:00:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57988) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZN23P-0008B6-Cm for qemu-devel@nongnu.org; Wed, 05 Aug 2015 13:00:35 -0400 References: <1438703896-12553-1-git-send-email-armbru@redhat.com> <1438703896-12553-24-git-send-email-armbru@redhat.com> From: Eric Blake Message-ID: <55C2412D.5090906@redhat.com> Date: Wed, 5 Aug 2015 11:00:29 -0600 MIME-Version: 1.0 In-Reply-To: <1438703896-12553-24-git-send-email-armbru@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="tPT4B73vqpKhWbxTXEPS4LlXSwTBWeC14" Subject: Re: [Qemu-devel] [PATCH RFC v3 23/32] qapi: De-duplicate parameter list generation 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) --tPT4B73vqpKhWbxTXEPS4LlXSwTBWeC14 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 08/04/2015 09:58 AM, Markus Armbruster wrote: > Generated qapi-event.[ch] lose line breaks. No change otherwise. >=20 > Signed-off-by: Markus Armbruster ---=20 > scripts/qapi-commands.py | 11 ++--------- scripts/qapi-event.py | > 18 +++--------------- scripts/qapi.py | 16 ++++++++++++++++=20 > 3 files changed, 21 insertions(+), 24 deletions(-) >=20 > +++ b/scripts/qapi-event.py @@ -14,21 +14,9 @@ from qapi import * >=20 > def gen_event_send_proto(name, arg_type): - api_name =3D "void > qapi_event_send_%s(" % c_name(name).lower() - l =3D len(api_name) - = > - if arg_type: - for m in arg_type.members: - if > m.optional: - api_name +=3D "bool has_%s,\n" % > c_name(m.name) - api_name +=3D "".ljust(l) - - > api_name +=3D "%s %s,\n" % (m.type.c_type(is_param=3DTrue), - > c_name(m.name)) Converting from "" % (list) to... > - api_name +=3D "".ljust(l) - - api_name +=3D "Error > **errp)" - return api_name + return 'void > qapi_event_send_%(c_name)s(%(param)s)' % { + 'c_name': > c_name(name.lower()), + 'param': gen_params(arg_type, 'Error > **errp')} =2E..direct "" % {dict}. I hadn't seen that before in any of the qapi*.p= y (I guess I'm too used to seeing mcgen() calls, where the dict is implied via the **kwds magic). But since you don't want to call mcgen() on the same input twice, it looks correct. Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --tPT4B73vqpKhWbxTXEPS4LlXSwTBWeC14 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/ iQEcBAEBCAAGBQJVwkEtAAoJEKeha0olJ0Nq+XsH/0luq6NjWwtNx6oikGWG4sGU d3PEAd1x9f/4xQzDDabtGdpSyfxsW8QE0tGe7xIDOGW1AAsihFwC3QbZey+jf6Ze U4+Aeozxx7K4vmTKVkP1SGhilXe8jYG7f44BeyQL8gSxZS13FCt0HtUtPWDnO6FT j7ZymMFaxhs/8qNJktiZuvsBJIJCNrXoAZROYXppDlEv1GlBknsN6R/7ZyY+MjLO ShaQpCANWE8/NjHvvu4n/7OagAFps7DHuqxu8i6SOsL3+IQSaAzNuruZEt+tQ7Yu +Wu0fNR8K0/5GzRrTThRTshSE+ronUYKCXxvEJzqlydVVkZUhFFgjiCmHOGu3lc= =vC8w -----END PGP SIGNATURE----- --tPT4B73vqpKhWbxTXEPS4LlXSwTBWeC14--