From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54198) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a1iG7-0006XK-0g for qemu-devel@nongnu.org; Wed, 25 Nov 2015 17:09:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a1iG3-0005JM-Qs for qemu-devel@nongnu.org; Wed, 25 Nov 2015 17:09:50 -0500 Received: from mx1.redhat.com ([209.132.183.28]:37025) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a1iG3-0005JI-Ko for qemu-devel@nongnu.org; Wed, 25 Nov 2015 17:09:47 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 3F78F32D3BC for ; Wed, 25 Nov 2015 22:09:47 +0000 (UTC) References: <1448486613-17634-1-git-send-email-armbru@redhat.com> <1448486613-17634-7-git-send-email-armbru@redhat.com> From: Eric Blake Message-ID: <565631AA.2090301@redhat.com> Date: Wed, 25 Nov 2015 15:09:46 -0700 MIME-Version: 1.0 In-Reply-To: <1448486613-17634-7-git-send-email-armbru@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="JwW6lOuHWqXbolFqwqT3i5KaBttEcMUxP" Subject: Re: [Qemu-devel] [PATCH v3 for-2.5 06/12] qjson: Inline token_is_keyword() 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) --JwW6lOuHWqXbolFqwqT3i5KaBttEcMUxP 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 | 20 +++++++------------- > 1 file changed, 7 insertions(+), 13 deletions(-) >=20 > =20 > - if (token_is_keyword(token, "true")) { > + val =3D token_get_value(token); > + > + if (!strcmp(val, "true")) { > ret =3D QOBJECT(qbool_from_bool(true)); > - } else if (token_is_keyword(token, "false")) { > + } else if (!strcmp(val, "false")) { > ret =3D QOBJECT(qbool_from_bool(false)); > - } else if (token_is_keyword(token, "null")) { > + } else if (!strcmp(val, "null")) { > ret =3D qnull(); > } else { > - parse_error(ctxt, token, "invalid keyword `%s'", token_get_val= ue(token)); > + parse_error(ctxt, token, "invalid keyword '%s'", val); Yay - fewer `' in error messages. (Great back in the day when fonts rendered them symmetrically, and still useful in m4; but lousy for pasting into shell code and in modern fonts) Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --JwW6lOuHWqXbolFqwqT3i5KaBttEcMUxP 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/ iQEcBAEBCAAGBQJWVjGqAAoJEKeha0olJ0Nq+AEH/288IykvMFHiBc0LNNqvl/WZ hZJ+zkb0h1EDAStGDPtd4bplbeLBKj7eJhPiqLbtPmVxFjDVcEXuwd+OWXpOu4vV llN/yYd7IGYkIxERNPsHkPmZuE89iwBzjPc6lvrqsOHDZ45aIRTzRvpOqEY2uyU5 Ib7NN5HbpEyAL39WbT4j0gByba6OWFRwoSbb9XDFafsAYt29mu7E73OHmRGxdP8u bEaMNLRJyl1d8tXNbzfugIXam21JJ7u/kROaFvxaWq1h55ginYIM42PuGFGsrDr8 sgzyqkTu5gKU1tLPZ1y0vLmDgw57v8wYuA5x3dXeSafmSboCyH1N5sDCQLKqIHI= =Ia02 -----END PGP SIGNATURE----- --JwW6lOuHWqXbolFqwqT3i5KaBttEcMUxP--