Re: [PATCH v5 05/10] cutils: add functions for IEC and SI prefixes

2022-05-31 Thread Paolo Bonzini
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

Re: [PATCH v5 05/10] cutils: add functions for IEC and SI prefixes

2022-05-30 Thread Philippe Mathieu-Daudé via
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

[PATCH v5 05/10] cutils: add functions for IEC and SI prefixes

2022-05-30 Thread Paolo Bonzini
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