On 5/30/22 23:59, Philippe Mathieu-Daudé via wrote:
+ assert(exp10 % 3 == 0 && exp10 / 3 < ARRAY_SIZE(prefixes));
Can we add parenthesis to ease code review?
I'm not sure where... I thought about using two asserts too, but
checking both % and / seems clear enough.
Paolo
On 30/5/22 17:07, Paolo Bonzini wrote:
Extract the knowledge of IEC and SI prefixes out of size_to_str and
freq_to_str, so that it can be reused when printing statistics.
Signed-off-by: Paolo Bonzini
---
include/qemu/cutils.h| 18 ++
tests/unit/test-cutils.c | 32
Extract the knowledge of IEC and SI prefixes out of size_to_str and
freq_to_str, so that it can be reused when printing statistics.
Signed-off-by: Paolo Bonzini
---
include/qemu/cutils.h| 18 ++
tests/unit/test-cutils.c | 32
util/cutils.c