#include <ccan/tally/tally.h>
#define SUMMARY_FORMAT \
- "Size of file/data: %zu/%zu\n" \
+ "Size of file/data: %u/%zu\n" \
"Number of records: %zu\n" \
"Smallest/average/largest keys: %zu/%zu/%zu\n%s" \
"Smallest/average/largest data: %zu/%zu/%zu\n%s" \
typedef uint32_t tdb_off_t;
#ifndef offsetof
-#define offsetof(t,f) ((unsigned int)&((t *)0)->f)
+#define offsetof(t,f) ((size_t)&((t *)0)->f)
#endif
#define TDB_MAGIC_FOOD "TDB file\n"
/* Strip trailing \n: diag adds it. */
if (line[0] && line[strlen(line)-1] == '\n')
- diag("%s%.*s", log_prefix, strlen(line)-1, line);
+ diag("%s%.*s", log_prefix, (unsigned)strlen(line)-1, line);
else
diag("%s%s", log_prefix, line);
}