From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39942) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WxAhU-0008FU-R1 for qemu-devel@nongnu.org; Wed, 18 Jun 2014 03:54:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WxAhQ-0001AH-Iy for qemu-devel@nongnu.org; Wed, 18 Jun 2014 03:54:32 -0400 Received: from mx1.redhat.com ([209.132.183.28]:1714) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WxAhQ-0001AB-AP for qemu-devel@nongnu.org; Wed, 18 Jun 2014 03:54:28 -0400 Date: Wed, 18 Jun 2014 15:54:21 +0800 From: Amos Kong Message-ID: <20140618075421.GD32372@z.redhat.com> References: <1402399553-21692-1-git-send-email-akong@redhat.com> <1402399553-21692-3-git-send-email-akong@redhat.com> <53A10CB9.8010809@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="tKW2IUtsqtDRztdT" Content-Disposition: inline In-Reply-To: <53A10CB9.8010809@redhat.com> Subject: Re: [Qemu-devel] [PATCH v6 2/3] qapi: add const prefix to 'char *' insider c_type() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: armbru@redhat.com, lcapitulino@redhat.com, qemu-devel@nongnu.org, wenchaoqemu@gmail.com, mdroth@linux.vnet.ibm.com --tKW2IUtsqtDRztdT Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jun 17, 2014 at 09:51:21PM -0600, Eric Blake wrote: > On 06/10/2014 05:25 AM, Amos Kong wrote: > > It's ugly to add const prefix for parameter type by an if statement > > outside c_type(). This patch adds a parameter to do it. > >=20 > > Signed-off-by: Amos Kong > > Suggested-by: Markus Armbruster > > Reviewed-by: Eric Blake > > Reviewed-by: Paolo Bonzini > > Reviewed-by: Markus Armbruster > > --- > > scripts/qapi-commands.py | 4 +--- > > scripts/qapi.py | 4 +++- > > 2 files changed, 4 insertions(+), 4 deletions(-) >=20 > Wenchao's series introduces another client that needs this treatment: > https://lists.gnu.org/archive/html/qemu-devel/2014-06/msg01225.html >=20 > Depending on what order things get merged in, you may need followup > patches or conflict resolution. Thanks for the reminder. I just checked the patch, c_type() is only used once, and the output is used insider mcgen(). So it's safe to apply my patchset. > > diff --git a/scripts/qapi-commands.py b/scripts/qapi-commands.py > > index 7d93d01..34f200a 100644 > > --- a/scripts/qapi-commands.py > > +++ b/scripts/qapi-commands.py > > @@ -29,9 +29,7 @@ def type_visitor(name): > > def generate_command_decl(name, args, ret_type): > > arglist=3D"" > > for argname, argtype, optional, structured in parse_args(args): > > - argtype =3D c_type(argtype) > > - if argtype =3D=3D "char *": > > - argtype =3D "const char *" > > + argtype =3D c_type(argtype, is_param=3DTrue) >=20 > --=20 > Eric Blake eblake redhat com +1-919-301-3266 > Libvirt virtualization library http://libvirt.org >=20 --=20 Amos. --tKW2IUtsqtDRztdT Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJToUWtAAoJELxSv6I5vP9j2lsP/1dmsinne/U3ezF1LSE40yQ6 PI7tGkYgMWln1Q4iAjgeWnUY5r6uIb275z6zRvv15cdUIb4s/1g6Z7SgaFHIdU80 PyVi9rexq3QvCP0aIORTg5ITB/bmdXFIr/Y3XP810a72MJnjUctebqXIeQR1jZUM 4BA8BSlmjRj0Q0M9Cnaz3YjdKFBvGFKQvMYgiztFT8h50cvZBWElpCzNPfMYw5Py CJeCVLQ98zrMZN3UzKOjPkIDfPRp4VMMVJPw60TmaQz+AuFS1are7DH6AEiTliPB 7kjSPNBMdU5S1nP8zR5Cv0UDTNejR9dcu2c8Mi7nnu5ruhOPTDMehCI2w7VhLfWA 607xrlEPGe5Tk+Tkq3hAtQgL9+F9XGsUvWWnHaymtAoShytj8aa1EqQboryZWLeh lTktrAX2S/P+syqtQRfPaYOtBUVsCwuH8N+RQCmvsAOqGcRoCbKwRvLJnMkQ3Q2X QQLLhxuyPQlmIonrORYLcEG/eXQDuEruimCgUd+rRVsXcm+5mWhScUaXpwNfEjP/ En5adl/5nrSPp5cwZwvo2R2J9V7sCqX1YjerpsxCqR27/o9zQtkHVgkUysRWfywk ham2d7kuMp9huP0V9axPX4UkRMpmF5rm71mNCItEmnNP2nxZoieul4eRdF7gkaTR tywnPIAgCE2TTk2wylu6 =dcFe -----END PGP SIGNATURE----- --tKW2IUtsqtDRztdT--