Git development
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Johannes Sixt <j.sixt@viscovery.net>
Cc: Nicolas Pitre <nico@fluxnic.net>, git@vger.kernel.org
Subject: Re: [PATCH] change throughput display units with fast links
Date: Wed, 14 Oct 2009 02:13:08 -0700	[thread overview]
Message-ID: <7viqeifie3.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <4AD578BD.7080201@viscovery.net> (Johannes Sixt's message of "Wed\, 14 Oct 2009 09\:07\:41 +0200")

Johannes Sixt <j.sixt@viscovery.net> writes:

> Nicolas Pitre schrieb:
>> +	if (rate > 1 << 10) {
>> +		int x = rate + 5;  /* for rounding */
>> +		snprintf(tp->display + sizeof(tp->display) - l, l,
>> +			 " | %u.%2.2u MiB/s",
>
> Shouldn't the fractional part be "%02.2u" (leading zeros instead of blanks)?
>
>> +			 x >> 10, ((x & ((1 << 10) - 1)) * 100) >> 10);
>> +	} else if (rate)
>>  		snprintf(tp->display + sizeof(tp->display) - l, l,
>>  			 " | %u KiB/s", rate);
>>  }
>
> -- Hannes

Judging from the surrounding existing code, I do not think so.

    $ cat <<\EOF >j.c
    #include <stdio.h>

    int main(int ac, char **av)
    {
            printf("%u.%2.2u\n", 4, 5);
            return 0;
    }
    EOF
    $ gcc -o j j.c && ./j
    4.05

      reply	other threads:[~2009-10-14  9:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-14  3:02 [PATCH] change throughput display units with fast links Nicolas Pitre
2009-10-14  7:07 ` Johannes Sixt
2009-10-14  9:13   ` Junio C Hamano [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=7viqeifie3.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=j.sixt@viscovery.net \
    --cc=nico@fluxnic.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox