diff options
author | Robin Watts <robin.watts@artifex.com> | 2016-03-21 18:52:20 +0000 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2016-03-21 19:03:51 +0000 |
commit | e5eb6ade2cfbc3493d4462b4aa8c92bd26f7a0c8 (patch) | |
tree | c6adbcd356b0a797e52d30d2ef0794c124f7dc15 /source/fitz/output.c | |
parent | c4d3a9142761a567fce9f66946a917e087c0de67 (diff) | |
download | mupdf-e5eb6ade2cfbc3493d4462b4aa8c92bd26f7a0c8.tar.xz |
Tweak NULL output code.
In the quest for better mutool draw timings, make fz_outputs going
to /dev/null be represented by a NULL pointer.
Spot this in the output routines and just exit.
Diffstat (limited to 'source/fitz/output.c')
-rw-r--r-- | source/fitz/output.c | 31 |
1 files changed, 1 insertions, 30 deletions
diff --git a/source/fitz/output.c b/source/fitz/output.c index 1904ee85..9ea2d169 100644 --- a/source/fitz/output.c +++ b/source/fitz/output.c @@ -62,35 +62,6 @@ fz_new_output_with_file_ptr(fz_context *ctx, FILE *file, int close) return out; } -static void -null_write(fz_context *ctx, void *opaque, const void *buffer, int count) -{ - return; -} - -static void -null_seek(fz_context *ctx, void *opaque, fz_off_t off, int whence) -{ -} - -static fz_off_t -null_tell(fz_context *ctx, void *opaque) -{ - return 0; -} - -static fz_output * -null_filename(fz_context *ctx) -{ - fz_output *out = fz_malloc_struct(ctx, fz_output); - out->opaque = NULL; - out->write = null_write; - out->seek = null_seek; - out->tell = null_tell; - out->close = NULL; - return out; -} - fz_output * fz_new_output_with_path(fz_context *ctx, const char *filename, int append) { @@ -98,7 +69,7 @@ fz_new_output_with_path(fz_context *ctx, const char *filename, int append) FILE *file; if (!strcmp(filename, "/dev/null") || !fz_strcasecmp(filename, "nul:")) - return null_filename(ctx); + return NULL; file = fz_fopen(filename, append ? "ab" : "wb"); if (!file) |