Ensure that calculated length is an integer.

This commit is contained in:
Johan Wikman 2015-12-07 15:12:32 +02:00
parent 6870d77acb
commit a67a637b11

View File

@ -33,7 +33,7 @@
#define MB MEGABYTE_BYTE
#define GB GIGABYTE_BYTE
#define CALCLEN(i) (floor(log10(abs(i))) + 1)
#define CALCLEN(i) ((size_t)(floor(log10(abs(i))) + 1))
#define UINTLEN(i) (i<10 ? 1 : (i<100 ? 2 : (i<1000 ? 3 : CALCLEN(i))))