#include <inttypes.h>
/* Define some portable printing types */
-#if (SIZE_MAX == UINT64_MAX)
-#define PRIsize_t PRIu64
-#elif (SIZE_MAX == UINT32_MAX)
-#define PRIsize_t PRIu32
-#endif
+#define PRIsize_t "Zu"
struct str_list {
struct list list;
{
int s;
int suffix = 1;
- uint64_t byte;
+ uint64_t byte = UINT64_C(0);
uint64_t units = UINT64_C(1024);
char *size_buf = NULL;
const char *size_str[][3] = {
struct pool *mem = dbg_malloc(sizeof(*mem));
if (!mem) {
- log_error("Couldn't create memory pool (size %u)",
+ log_error("Couldn't create memory pool (size %" PRIsize_t ")",
sizeof(*mem));
return NULL;
}
struct pool *p = dbg_malloc(sizeof(*p));
if (!p) {
- log_error("Couldn't create memory pool (size %" PRIuPTR ")",
+ log_error("Couldn't create memory pool (size %" PRIsize_t ")",
sizeof(*p));
return 0;
}
p->spare_chunk = 0;
} else {
if (!(c = dbg_malloc(s))) {
- log_err("Out of memory. Requested %" PRIuPTR " bytes.",
- s);
+ log_err("Out of memory. Requested %" PRIsize_t
+ " bytes.", s);
return NULL;
}