diff options
author | Sebastian Rasmussen <sebras@gmail.com> | 2016-03-31 01:05:58 +0200 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2016-03-31 13:01:36 +0200 |
commit | 09a80805da7f7ed46eae1836cfec383238a991b9 (patch) | |
tree | 4b2c1da2fa85402147e7954922f0dafc6f81e61b | |
parent | f8b35b0fe546c9f34626155f19dafe16a8f82829 (diff) | |
download | mupdf-09a80805da7f7ed46eae1836cfec383238a991b9.tar.xz |
Initialize disabled document writing flags to zero
Also remove redundant assignments.
Fixes http://bugs.ghostscript.com/show_bug.cgi?id=695968
-rw-r--r-- | platform/android/viewer/jni/mupdf.c | 7 | ||||
-rw-r--r-- | platform/ios/Classes/MuDocumentController.m | 7 | ||||
-rw-r--r-- | platform/x11/pdfapp.c | 6 | ||||
-rw-r--r-- | source/tools/pdfclean.c | 7 | ||||
-rw-r--r-- | source/tools/pdfposter.c | 6 |
5 files changed, 5 insertions, 28 deletions
diff --git a/platform/android/viewer/jni/mupdf.c b/platform/android/viewer/jni/mupdf.c index bc23b9ca..5e04ff8e 100644 --- a/platform/android/viewer/jni/mupdf.c +++ b/platform/android/viewer/jni/mupdf.c @@ -2598,12 +2598,9 @@ JNI_FN(MuPDFCore_saveInternal)(JNIEnv * env, jobject thiz) if (idoc && glo->current_path) { char *tmp; - pdf_write_options opts; + pdf_write_options opts = { 0 }; + opts.do_incremental = 1; - opts.do_ascii = 0; - opts.do_expand = 0; - opts.do_garbage = 0; - opts.do_linear = 0; tmp = tmp_path(glo->current_path); if (tmp) diff --git a/platform/ios/Classes/MuDocumentController.m b/platform/ios/Classes/MuDocumentController.m index d1c685d0..745cc6c0 100644 --- a/platform/ios/Classes/MuDocumentController.m +++ b/platform/ios/Classes/MuDocumentController.m @@ -71,12 +71,9 @@ static void saveDoc(char *current_path, fz_document *doc) { char *tmp; pdf_document *idoc = pdf_specifics(ctx, doc); - pdf_write_options opts; + pdf_write_options opts = { 0 }; + opts.do_incremental = 1; - opts.do_ascii = 0; - opts.do_expand = 0; - opts.do_garbage = 0; - opts.do_linear = 0; if (!idoc) return; diff --git a/platform/x11/pdfapp.c b/platform/x11/pdfapp.c index 37ef2181..77b6244a 100644 --- a/platform/x11/pdfapp.c +++ b/platform/x11/pdfapp.c @@ -527,13 +527,9 @@ static int pdfapp_save(pdfapp_t *app) if (wingetsavepath(app, buf, PATH_MAX)) { - pdf_write_options opts; + pdf_write_options opts = { 0 }; opts.do_incremental = 1; - opts.do_ascii = 0; - opts.do_expand = 0; - opts.do_garbage = 0; - opts.do_linear = 0; if (strcmp(buf, app->docpath) != 0) { diff --git a/source/tools/pdfclean.c b/source/tools/pdfclean.c index 8d599de9..94e2b91b 100644 --- a/source/tools/pdfclean.c +++ b/source/tools/pdfclean.c @@ -41,15 +41,8 @@ int pdfclean_main(int argc, char **argv) int errors = 0; fz_context *ctx; - opts.do_incremental = 0; - opts.do_garbage = 0; - opts.do_expand = 0; - opts.do_ascii = 0; - opts.do_deflate = 0; - opts.do_linear = 0; opts.continue_on_error = 1; opts.errors = &errors; - opts.do_clean = 0; while ((c = fz_getopt(argc, argv, "adfgilp:sz")) != -1) { diff --git a/source/tools/pdfposter.c b/source/tools/pdfposter.c index a598fb21..0393f137 100644 --- a/source/tools/pdfposter.c +++ b/source/tools/pdfposter.c @@ -161,12 +161,6 @@ int pdfposter_main(int argc, char **argv) pdf_document *doc; fz_context *ctx; - opts.do_incremental = 0; - opts.do_garbage = 0; - opts.do_expand = 0; - opts.do_ascii = 0; - opts.do_linear = 0; - while ((c = fz_getopt(argc, argv, "x:y:")) != -1) { switch (c) |