Re: [PATCH v2 2/3] strbuf: Add method to convert byte-size to human readable form

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Junio C Hamano wrote:
> 	960 bps
>         0.9 KiB/s
> 	2.3 MiB/s

A pedantic note, but bps is bits per second, whereas Bps or B/s is bytes
per second.  Requiring the same suffix for each would prevent some easily
overlooked issues like this.

> I also am not particularly happy about using "double" in this API.  Most
> of the callers that gather stats in the rest of the codebase count in
> (long) integers as far as I can tell, and it may be conceptually cleaner
> to keep the use of double as an internal implementation issue of this
> particular function.

The function requires the use of a double for fractional parts, so letting 
the compiler perform an upcast were necessary seems innocuous to me.

Also, Yibi-/Zibi-, unlikely to be used as they are, won't fit in a long.

-- 
Marcus Griep
GPG Key ID: 0x5E968152
——
http://www.boohaunt.net
את.ψο´
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux