summaryrefslogtreecommitdiff
path: root/source/fitz/memory.c
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2017-04-24 11:39:47 +0200
committerTor Andersson <tor.andersson@artifex.com>2017-04-27 12:02:58 +0200
commit1724a8ccd667c6ec468e2e8a01161c32bf59d706 (patch)
tree9fc69a8342e21422c8ab96da524588c605530b5a /source/fitz/memory.c
parent147b081bde160f879b941ad1f2a46c643f5da414 (diff)
downloadmupdf-1724a8ccd667c6ec468e2e8a01161c32bf59d706.tar.xz
Rename FMT_zu to FZ_FMT_zu.
Don't use FMT_zu macro for fz_throw/fz_warn, since we can portably handle '%zu' in our own printf formatting.
Diffstat (limited to 'source/fitz/memory.c')
-rw-r--r--source/fitz/memory.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/source/fitz/memory.c b/source/fitz/memory.c
index 870ec973..10e6f318 100644
--- a/source/fitz/memory.c
+++ b/source/fitz/memory.c
@@ -56,7 +56,7 @@ fz_malloc(fz_context *ctx, size_t size)
p = do_scavenging_malloc(ctx, size);
if (!p)
- fz_throw(ctx, FZ_ERROR_MEMORY, "malloc of " FMT_zu " bytes failed", size);
+ fz_throw(ctx, FZ_ERROR_MEMORY, "malloc of %zu bytes failed", size);
return p;
}
@@ -75,11 +75,11 @@ fz_malloc_array(fz_context *ctx, size_t count, size_t size)
return 0;
if (count > SIZE_MAX / size)
- fz_throw(ctx, FZ_ERROR_MEMORY, "malloc of array (" FMT_zu " x " FMT_zu " bytes) failed (size_t overflow)", count, size);
+ fz_throw(ctx, FZ_ERROR_MEMORY, "malloc of array (%zu x %zu bytes) failed (size_t overflow)", count, size);
p = do_scavenging_malloc(ctx, count * size);
if (!p)
- fz_throw(ctx, FZ_ERROR_MEMORY, "malloc of array (" FMT_zu " x " FMT_zu " bytes) failed", count, size);
+ fz_throw(ctx, FZ_ERROR_MEMORY, "malloc of array (%zu x %zu bytes) failed", count, size);
return p;
}
@@ -91,7 +91,7 @@ fz_malloc_array_no_throw(fz_context *ctx, size_t count, size_t size)
if (count > SIZE_MAX / size)
{
- fprintf(stderr, "error: malloc of array (" FMT_zu " x " FMT_zu " bytes) failed (size_t overflow)", count, size);
+ fprintf(stderr, "error: malloc of array (" FZ_FMT_zu " x " FZ_FMT_zu " bytes) failed (size_t overflow)", count, size);
return NULL;
}
@@ -108,13 +108,13 @@ fz_calloc(fz_context *ctx, size_t count, size_t size)
if (count > SIZE_MAX / size)
{
- fz_throw(ctx, FZ_ERROR_MEMORY, "calloc (" FMT_zu " x " FMT_zu " bytes) failed (size_t overflow)", count, size);
+ fz_throw(ctx, FZ_ERROR_MEMORY, "calloc (%zu x %zu bytes) failed (size_t overflow)", count, size);
}
p = do_scavenging_malloc(ctx, count * size);
if (!p)
{
- fz_throw(ctx, FZ_ERROR_MEMORY, "calloc (" FMT_zu " x " FMT_zu " bytes) failed", count, size);
+ fz_throw(ctx, FZ_ERROR_MEMORY, "calloc (%zu x %zu bytes) failed", count, size);
}
memset(p, 0, count*size);
return p;
@@ -130,7 +130,7 @@ fz_calloc_no_throw(fz_context *ctx, size_t count, size_t size)
if (count > SIZE_MAX / size)
{
- fprintf(stderr, "error: calloc (" FMT_zu " x " FMT_zu " bytes) failed (size_t overflow)\n", count, size);
+ fprintf(stderr, "error: calloc (" FZ_FMT_zu " x " FZ_FMT_zu " bytes) failed (size_t overflow)\n", count, size);
return NULL;
}
@@ -154,11 +154,11 @@ fz_resize_array(fz_context *ctx, void *p, size_t count, size_t size)
}
if (count > SIZE_MAX / size)
- fz_throw(ctx, FZ_ERROR_MEMORY, "resize array (" FMT_zu " x " FMT_zu " bytes) failed (size_t overflow)", count, size);
+ fz_throw(ctx, FZ_ERROR_MEMORY, "resize array (%zu x %zu bytes) failed (size_t overflow)", count, size);
np = do_scavenging_realloc(ctx, p, count * size);
if (!np)
- fz_throw(ctx, FZ_ERROR_MEMORY, "resize array (" FMT_zu " x " FMT_zu " bytes) failed", count, size);
+ fz_throw(ctx, FZ_ERROR_MEMORY, "resize array (%zu x %zu bytes) failed", count, size);
return np;
}
@@ -173,7 +173,7 @@ fz_resize_array_no_throw(fz_context *ctx, void *p, size_t count, size_t size)
if (count > SIZE_MAX / size)
{
- fprintf(stderr, "error: resize array (" FMT_zu " x " FMT_zu " bytes) failed (size_t overflow)\n", count, size);
+ fprintf(stderr, "error: resize array (" FZ_FMT_zu " x " FZ_FMT_zu " bytes) failed (size_t overflow)\n", count, size);
return NULL;
}