summaryrefslogtreecommitdiff
path: root/alloc.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-03-23 14:55:46 -0700
committerJunio C Hamano <gitster@pobox.com>2011-03-23 14:55:46 -0700
commit3ed8868474b6309304696a15a1bec184ea235750 (patch)
tree2caf4c5cf21cd3177f9a1feba89b9d054a8dab40 /alloc.c
parentda2584243e4308f10adeb45e95fb090c0110fe4f (diff)
parent28bd70d811391be10c55ce4aee1b6ee991d7a86b (diff)
downloadgit-3ed8868474b6309304696a15a1bec184ea235750.tar.gz
Merge branch 'jn/maint-c99-format'
* jn/maint-c99-format: unbreak and eliminate NO_C99_FORMAT mktag: avoid %td in format string
Diffstat (limited to 'alloc.c')
-rw-r--r--alloc.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/alloc.c b/alloc.c
index 6ef6753d18..aeae55c976 100644
--- a/alloc.c
+++ b/alloc.c
@@ -51,19 +51,12 @@ DEFINE_ALLOCATOR(commit, struct commit)
DEFINE_ALLOCATOR(tag, struct tag)
DEFINE_ALLOCATOR(object, union any_object)
-#ifdef NO_C99_FORMAT
-#define SZ_FMT "%u"
-#else
-#define SZ_FMT "%zu"
-#endif
-
static void report(const char *name, unsigned int count, size_t size)
{
- fprintf(stderr, "%10s: %8u (" SZ_FMT " kB)\n", name, count, size);
+ fprintf(stderr, "%10s: %8u (%"PRIuMAX" kB)\n",
+ name, count, (uintmax_t) size);
}
-#undef SZ_FMT
-
#define REPORT(name) \
report(#name, name##_allocs, name##_allocs*sizeof(struct name) >> 10)