From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45014) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WxI4b-0005ep-Tt for qemu-devel@nongnu.org; Wed, 18 Jun 2014 11:46:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WxI4V-0007BH-8u for qemu-devel@nongnu.org; Wed, 18 Jun 2014 11:46:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54028) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WxI4U-0007Ax-W1 for qemu-devel@nongnu.org; Wed, 18 Jun 2014 11:46:47 -0400 Message-ID: <53A1B462.90604@redhat.com> Date: Wed, 18 Jun 2014 09:46:42 -0600 From: Eric Blake MIME-Version: 1.0 References: <1403105835-25535-1-git-send-email-mst@redhat.com> In-Reply-To: <1403105835-25535-1-git-send-email-mst@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="COMuhn0IPQqcDM6E6tCXMC3mHp63V0hnU" Subject: Re: [Qemu-devel] [PATCH] qapi/string-putput-visitor: fix bugs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" , qemu-devel@nongnu.org Cc: Michael Roth , Luiz Capitulino This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --COMuhn0IPQqcDM6E6tCXMC3mHp63V0hnU Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 06/18/2014 09:37 AM, Michael S. Tsirkin wrote: > in human mode, we are creating the string: >=20 > 16-31 (16-31) >=20 > instead of >=20 > 16-17 (10-1f) >=20 > because we forgot to pass 'true' as the human parameter on one of the > two calls to format_string. > Also, this is a worsening of quality; previously we would produce >=20 > 16 (0x10) >=20 > to make it obvious which number was hex. > Fix these issues. >=20 > Reported-by: Eric Blake > Signed-off-by: Michael S. Tsirkin > --- > qapi/string-output-visitor.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) >=20 > diff --git a/qapi/string-output-visitor.c b/qapi/string-output-visitor.= c > index 8735b00..e9aca3b 100644 > --- a/qapi/string-output-visitor.c > +++ b/qapi/string-output-visitor.c > @@ -98,7 +98,7 @@ static void format_string(StringOutputVisitor *sov, R= ange *r, bool next, > { > if (r->end - r->begin > 1) { > if (human) { > - g_string_append_printf(sov->string, "%" PRIx64 "-%" PRIx64= , > + g_string_append_printf(sov->string, "0x%" PRIx64 "-%" PRIx= 64, The pre-series code used "%#"PRIx64 instead of "0x%"PRIx64; the only difference is that you now output 0x0 instead of 0 if that happens to be one of the values of the range. I personally think "0 (0x0)" is nicer than the shorter "0 (0)", so I'm okay with it. Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --COMuhn0IPQqcDM6E6tCXMC3mHp63V0hnU Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJTobRiAAoJEKeha0olJ0Nqm/QH/jl858WHHDg60higOgEQlMb3 KRT+GtNzD/u0F0OCz2nhIgPPX/1tHSTDdr1+3U9aHRGEkZ9kPQadCu6EGQrdviPP MmoTedppO4YXUbZkCLPWD3VFovumb1aCQm7P0M6H+Tm/tZfuMPQZ6JXGCjs8oDsq /seDwrOj4ynFlAbzR0OM8LtmSYmpCg9WTNTHZwoClbf5nHKqvuKumahSd0/SBJCC L3BaY5KAcHpmaGopVTxmHYmDPVSLZjj7ALBwcuv+0+t1jQsWmJ5Rr6bTTALn+NTO tJt9fZms3LoFaNZwfLbDcwTsgvnkPJeLu5FBoXtNahj/TBBbTtiq9pmMQRIanxE= =ABLx -----END PGP SIGNATURE----- --COMuhn0IPQqcDM6E6tCXMC3mHp63V0hnU--