[Libguestfs] [PATCH nbdinfo v2 1/3] common/utils: Add function to convert sizes to human-readable
lersek at redhat.com
Mon Sep 20 16:38:44 UTC 2021
On 09/20/21 18:25, Laszlo Ersek wrote:
> On 09/20/21 13:04, Richard W.M. Jones wrote:
>> +#define HUMAN_SIZE_LONGEST 64
> (5) The integer constant expression
> ((sizeof (uint64_t) * 8 + 2) / 3 + 1)
> would be more frugal (but we might not care).
> If we take the number of three-bit groups in the word, and divide that
> by three -- rounded up --, we get the number of necessary octal digits.
> The number of decimal digits needed never exceeds the number of octal
> digits needed, so this is safe. Add one character for the NUL terminator.)
Typo, due to too much editing, of course. Please:
s/number of three-bit groups/number of bits/
Thanks & sorry!
More information about the Libguestfs