All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>, qemu-devel@nongnu.org
Cc: Michael Roth <mdroth@linux.vnet.ibm.com>,
	Luiz Capitulino <lcapitulino@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] qapi/string-putput-visitor: fix bugs
Date: Wed, 18 Jun 2014 09:46:42 -0600	[thread overview]
Message-ID: <53A1B462.90604@redhat.com> (raw)
In-Reply-To: <1403105835-25535-1-git-send-email-mst@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1559 bytes --]

On 06/18/2014 09:37 AM, Michael S. Tsirkin wrote:
> in human mode, we are creating the string:
> 
> 16-31 (16-31)
> 
> instead of
> 
> 16-17 (10-1f)
> 
> 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
> 
> 16 (0x10)
> 
> to make it obvious which number was hex.
> Fix these issues.
> 
> Reported-by: Eric Blake <eblake@redhat.com>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> ---
>  qapi/string-output-visitor.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)

> 
> 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, Range *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 "-%" PRIx64,

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 <eblake@redhat.com>

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

      reply	other threads:[~2014-06-18 15:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-18 15:37 [Qemu-devel] [PATCH] qapi/string-putput-visitor: fix bugs Michael S. Tsirkin
2014-06-18 15:46 ` Eric Blake [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53A1B462.90604@redhat.com \
    --to=eblake@redhat.com \
    --cc=lcapitulino@redhat.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.