- const char *unitstr[] = { "", "/s", "B", "bit", "B/s", "bit/s" };
- const unsigned int thousand[] = { 1000, 1024 };
- unsigned int modulo, decimals;
- int unit_index = 0, post_index, carry = 0;
- char tmp[32];
+ static const char *const unitstr[] = {
+ [N2S_NONE] = "",
+ [N2S_PERSEC] = "/s",
+ [N2S_BYTE] = "B",
+ [N2S_BIT] = "bit",
+ [N2S_BYTEPERSEC]= "B/s",
+ [N2S_BITPERSEC] = "bit/s"
+ };
+ const unsigned int thousand = pow2 ? 1024 : 1000;
+ unsigned int modulo;
+ int post_index, carry = 0;
+ char tmp[32], fmt[32];