X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=lib%2Fnum2str.c;h=ed3545d95634553640d3ccaf537e0e436d432ac2;hb=dcf9844e850e01d7c4db59960bbc4450a8cbf7ef;hp=940d4a5e289133a03c89569dc3cca01a5e604b4c;hpb=d694a6a7c02f577b2bb5d0ad24331b775acf6869;p=fio.git diff --git a/lib/num2str.c b/lib/num2str.c index 940d4a5e..ed3545d9 100644 --- a/lib/num2str.c +++ b/lib/num2str.c @@ -4,8 +4,6 @@ #include "../fio.h" -#define ARRAY_LENGTH(arr) sizeof(arr) / sizeof((arr)[0]) - /** * num2str() - Cheesy number->string conversion, complete with carry rounding error. * @num: quantity (e.g., number of blocks, bytes or bits) @@ -75,7 +73,7 @@ char *num2str(uint64_t num, int maxlen, int base, int pow2, int units) if (modulo == -1U) { done: - if (post_index >= ARRAY_LENGTH(sistr)) + if (post_index >= ARRAY_SIZE(sistr)) post_index = 0; sprintf(buf, "%llu%s%s", (unsigned long long) num,