> Sorry but this is very dangerous and it leads to very subtle bug: what
> happens if someone wrote:
"very dangerous"? I disagree.
If you're worried about the value and units getting out of sync then you
offer some helper macros:
> printf("%d%s - %d%s\n", scale(123), unit_string(123),
> scale(123), unit_string(456) );
#define pty_fmt "%llu%s"
#define pty_arg(v) scale(v), unit_string(v)
printf(pty_fmt, pty_arg(v));
The kernel used to print ipv4 addresses like this before it grew its own
%pI4 format specifier.
- z
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html