From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55206) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a1iKp-0000Np-UR for qemu-devel@nongnu.org; Wed, 25 Nov 2015 17:14:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a1iKl-0006Pt-0l for qemu-devel@nongnu.org; Wed, 25 Nov 2015 17:14:43 -0500 Received: from mx1.redhat.com ([209.132.183.28]:54692) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a1iKk-0006Pp-Qw for qemu-devel@nongnu.org; Wed, 25 Nov 2015 17:14:38 -0500 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id D250A68E00 for ; Wed, 25 Nov 2015 22:14:37 +0000 (UTC) References: <1448486613-17634-1-git-send-email-armbru@redhat.com> <1448486613-17634-8-git-send-email-armbru@redhat.com> From: Eric Blake Message-ID: <565632CC.1010501@redhat.com> Date: Wed, 25 Nov 2015 15:14:36 -0700 MIME-Version: 1.0 In-Reply-To: <1448486613-17634-8-git-send-email-armbru@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="EXtpDWQp0slA4ltQOLQwt9DVaMSd91luj" Subject: Re: [Qemu-devel] [PATCH v3 for-2.5 07/12] qjson: Inline token_is_escape() and simplify List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster , qemu-devel@nongnu.org Cc: pbonzini@redhat.com, lcapitulino@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --EXtpDWQp0slA4ltQOLQwt9DVaMSd91luj Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 11/25/2015 02:23 PM, Markus Armbruster wrote: > Signed-off-by: Markus Armbruster > --- > qobject/json-parser.c | 32 +++++++++++++++----------------- > 1 file changed, 15 insertions(+), 17 deletions(-) >=20 > + if (!strcmp(val, "%p")) { > obj =3D va_arg(*ap, QObject *); > - } else if (token_is_escape(token, "%i")) { > + } else if (!strcmp(val, "%i")) { > obj =3D QOBJECT(qbool_from_bool(va_arg(*ap, int))); > - } else if (token_is_escape(token, "%d")) { > + } else if (!strcmp(val, "%d")) { > obj =3D QOBJECT(qint_from_int(va_arg(*ap, int))); > - } else if (token_is_escape(token, "%ld")) { > + } else if (!strcmp(val, "%ld")) { Not for this patch, but I'd love to kill our support for "%ld" - it has behavior that differs between 32-bit and 64-bit platforms, and is therefore useless for our goal of using fixed-width integer types. > obj =3D QOBJECT(qint_from_int(va_arg(*ap, long))); > - } else if (token_is_escape(token, "%lld") || > - token_is_escape(token, "%I64d")) { > + } else if (!strcmp(val, "%lld") || > + !strcmp(val, "%I64d")) { Not for this patch, but I'd love to kill our support for "%I64d". Isn't modern mingw friendlier to using POSIX escape sequences in printf()? I'm assuming mingw is the only reason we have this hold-out? Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --EXtpDWQp0slA4ltQOLQwt9DVaMSd91luj 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/ iQEcBAEBCAAGBQJWVjLMAAoJEKeha0olJ0NqU7EH/1fYX55aArvOHudJj2MMR7Z8 MpBF4kIlO7kAyInwZNI4sUkr4G3K6Z8EEMxMz48fZY6++MKCC3Zlols1n31IPFuf yf3MKBFgGq9d1ydiDwU4nbHMHF/xMMEWiNrIz9DfbGHUGQ6ri4Np+2NkSy+DTKQ9 eqTjmYXY1wvjA7xWoe8NmW/4e0k34oJEAAwSwmKiQJkFNvgMQ0nkmfiUdk72WC3y SvhwRiL0UseT6FAxkd1MZWBbX1iYGHPcMZGPn8VLwzWoTbTWrHTF/Z053lx5HTWo rcxHjn8KojlCpFk4wgqnrlOoL7jTlKRMxx2Rlz5pTVmJfqegbeKy0UE95yuh3u4= =gw7i -----END PGP SIGNATURE----- --EXtpDWQp0slA4ltQOLQwt9DVaMSd91luj--