summaryrefslogtreecommitdiff
path: root/source/tools/mudraw.c
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2016-06-08 12:42:57 +0100
committerRobin Watts <robin.watts@artifex.com>2016-06-08 13:53:56 +0100
commit2fd7f11cfe4ebdc6d1035db521e61d15101ab36e (patch)
treecf18d3cc3ab606b4f22684ef4ea2ea3f06d41602 /source/tools/mudraw.c
parentfea0f8467f983cc5c1075d19787a4b398d0d5e22 (diff)
downloadmupdf-2fd7f11cfe4ebdc6d1035db521e61d15101ab36e.tar.xz
Move to using size_t for all mallocs.
This has knock on effects in the store. fix
Diffstat (limited to 'source/tools/mudraw.c')
-rw-r--r--source/tools/mudraw.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/source/tools/mudraw.c b/source/tools/mudraw.c
index 12d5247a..2773d357 100644
--- a/source/tools/mudraw.c
+++ b/source/tools/mudraw.c
@@ -1242,7 +1242,7 @@ typedef struct
} trace_header;
static void *
-trace_malloc(void *arg, unsigned int size)
+trace_malloc(void *arg, size_t size)
{
trace_header *p;
if (size == 0)
@@ -1270,7 +1270,7 @@ trace_free(void *arg, void *p_)
}
static void *
-trace_realloc(void *arg, void *p_, unsigned int size)
+trace_realloc(void *arg, void *p_, size_t size)
{
trace_header *p = (trace_header *)p_;
size_t oldsize;
@@ -1764,16 +1764,9 @@ int mudraw_main(int argc, char **argv)
if (showmemory)
{
-#if defined(_WIN64)
-#define FMT "%Iu"
-#elif defined(_WIN32)
-#define FMT "%u"
-#else
-#define FMT "%zu"
-#endif
- fprintf(stderr, "Total memory use = " FMT " bytes\n", memtrace_total);
- fprintf(stderr, "Peak memory use = " FMT " bytes\n", memtrace_peak);
- fprintf(stderr, "Current memory use = " FMT " bytes\n", memtrace_current);
+ fprintf(stderr, "Total memory use = " FMT_zu " bytes\n", memtrace_total);
+ fprintf(stderr, "Peak memory use = " FMT_zu " bytes\n", memtrace_peak);
+ fprintf(stderr, "Current memory use = " FMT_zu " bytes\n", memtrace_current);
}
return (errored != 0);