From 073808aa50f0c78e2d6fea4f56f0b814b314eb42 Mon Sep 17 00:00:00 2001 From: m-holger Date: Tue, 26 Jul 2022 12:37:50 +0100 Subject: Code tidy : replace 0 with nullptr or true --- examples/pdf-attach-file.cc | 12 ++++++------ examples/pdf-bookmarks.cc | 2 +- examples/pdf-count-strings.cc | 2 +- examples/pdf-create.cc | 2 +- examples/pdf-custom-filter.cc | 6 +++--- examples/pdf-double-page-size.cc | 2 +- examples/pdf-filter-tokens.cc | 2 +- examples/pdf-invert-images.cc | 5 +++-- examples/pdf-mod-info.cc | 6 +++--- examples/pdf-name-number-tree.cc | 2 +- examples/pdf-npages.cc | 2 +- examples/pdf-overlay-page.cc | 2 +- examples/pdf-parse-content.cc | 2 +- examples/pdf-set-form-values.cc | 2 +- examples/qpdf-job.cc | 2 +- 15 files changed, 26 insertions(+), 25 deletions(-) (limited to 'examples') diff --git a/examples/pdf-attach-file.cc b/examples/pdf-attach-file.cc index eb12a002..c04f5b9f 100644 --- a/examples/pdf-attach-file.cc +++ b/examples/pdf-attach-file.cc @@ -15,7 +15,7 @@ // the use of the qpdf literal syntax introduced in qpdf 10.6. // -static char const* whoami = 0; +static char const* whoami = nullptr; static void usage(std::string const& msg) @@ -167,11 +167,11 @@ main(int argc, char* argv[]) { whoami = QUtil::getWhoami(argv[0]); - char const* infilename = 0; - char const* password = 0; - char const* attachment = 0; - char const* outfilename = 0; - char const* mimetype = 0; + char const* infilename = nullptr; + char const* password = nullptr; + char const* attachment = nullptr; + char const* outfilename = nullptr; + char const* mimetype = nullptr; auto check_arg = [](char const* arg, std::string const& msg) { if (arg == nullptr) { diff --git a/examples/pdf-bookmarks.cc b/examples/pdf-bookmarks.cc index f6c91b21..1cee51ef 100644 --- a/examples/pdf-bookmarks.cc +++ b/examples/pdf-bookmarks.cc @@ -14,7 +14,7 @@ // // Ignore calls to QTC::TC - they are for qpdf CI testing only. -static char const* whoami = 0; +static char const* whoami = nullptr; static enum { st_none, st_numbers, st_lines } style = st_none; static bool show_open = false; static bool show_targets = false; diff --git a/examples/pdf-count-strings.cc b/examples/pdf-count-strings.cc index 85e05a5f..c762e7f8 100644 --- a/examples/pdf-count-strings.cc +++ b/examples/pdf-count-strings.cc @@ -15,7 +15,7 @@ #include #include -static char const* whoami = 0; +static char const* whoami = nullptr; void usage() diff --git a/examples/pdf-create.cc b/examples/pdf-create.cc index 785021da..f730b743 100644 --- a/examples/pdf-create.cc +++ b/examples/pdf-create.cc @@ -20,7 +20,7 @@ #include #include -static char const* whoami = 0; +static char const* whoami = nullptr; // This is a simple StreamDataProvider that writes image data for an // orange square of the given width and height. diff --git a/examples/pdf-custom-filter.cc b/examples/pdf-custom-filter.cc index e7877bea..2ea5fd42 100644 --- a/examples/pdf-custom-filter.cc +++ b/examples/pdf-custom-filter.cc @@ -37,7 +37,7 @@ // of running this example on test files that are specifically crafted // for it. -static char const* whoami = 0; +static char const* whoami = nullptr; class Pl_XOR: public Pipeline { @@ -447,8 +447,8 @@ main(int argc, char* argv[]) { whoami = QUtil::getWhoami(argv[0]); - char const* infilename = 0; - char const* outfilename = 0; + char const* infilename = nullptr; + char const* outfilename = nullptr; bool decode_specialized = false; for (int i = 1; i < argc; ++i) { if (strcmp(argv[i], "--decode-specialized") == 0) { diff --git a/examples/pdf-double-page-size.cc b/examples/pdf-double-page-size.cc index f0f86d02..fb0584e9 100644 --- a/examples/pdf-double-page-size.cc +++ b/examples/pdf-double-page-size.cc @@ -8,7 +8,7 @@ #include #include -static char const* whoami = 0; +static char const* whoami = nullptr; void usage() diff --git a/examples/pdf-filter-tokens.cc b/examples/pdf-filter-tokens.cc index ccacc8c2..c9a71e64 100644 --- a/examples/pdf-filter-tokens.cc +++ b/examples/pdf-filter-tokens.cc @@ -18,7 +18,7 @@ #include #include -static char const* whoami = 0; +static char const* whoami = nullptr; void usage() diff --git a/examples/pdf-invert-images.cc b/examples/pdf-invert-images.cc index 94392ac3..9ffb9c1f 100644 --- a/examples/pdf-invert-images.cc +++ b/examples/pdf-invert-images.cc @@ -9,7 +9,7 @@ #include #include -static char const* whoami = 0; +static char const* whoami = nullptr; void usage() @@ -142,7 +142,8 @@ main(int argc, char* argv[]) // pipeStreamData with a null pipeline to determine // whether the image is filterable. Directly inspect // keys to determine the image type. - if (image.pipeStreamData(0, qpdf_ef_compress, qpdf_dl_all) && + if (image.pipeStreamData( + nullptr, qpdf_ef_compress, qpdf_dl_all) && color_space.isNameAndEquals("/DeviceGray") && bits_per_component.isInteger() && (bits_per_component.getIntValue() == 8)) { diff --git a/examples/pdf-mod-info.cc b/examples/pdf-mod-info.cc index 2b8e3c47..fa49738b 100644 --- a/examples/pdf-mod-info.cc +++ b/examples/pdf-mod-info.cc @@ -11,7 +11,7 @@ #include static char const* version = "1.1"; -static char const* whoami = 0; +static char const* whoami = nullptr; void usage() @@ -77,8 +77,8 @@ main(int argc, char* argv[]) exit(0); } - char* fl_in = 0; - char* fl_out = 0; + char* fl_in = nullptr; + char* fl_out = nullptr; std::string cur_key; for (int i = 1; i < argc; ++i) { diff --git a/examples/pdf-name-number-tree.cc b/examples/pdf-name-number-tree.cc index 939105e9..381085ba 100644 --- a/examples/pdf-name-number-tree.cc +++ b/examples/pdf-name-number-tree.cc @@ -6,7 +6,7 @@ #include #include -static char const* whoami = 0; +static char const* whoami = nullptr; void usage() diff --git a/examples/pdf-npages.cc b/examples/pdf-npages.cc index f430935c..3d34d489 100644 --- a/examples/pdf-npages.cc +++ b/examples/pdf-npages.cc @@ -5,7 +5,7 @@ #include #include -static char const* whoami = 0; +static char const* whoami = nullptr; void usage() diff --git a/examples/pdf-overlay-page.cc b/examples/pdf-overlay-page.cc index 594f139e..d055d279 100644 --- a/examples/pdf-overlay-page.cc +++ b/examples/pdf-overlay-page.cc @@ -12,7 +12,7 @@ // --overlay and --underlay options provide a more general version of // this capability. -static char const* whoami = 0; +static char const* whoami = nullptr; void usage() diff --git a/examples/pdf-parse-content.cc b/examples/pdf-parse-content.cc index 6bc94da2..481633e6 100644 --- a/examples/pdf-parse-content.cc +++ b/examples/pdf-parse-content.cc @@ -8,7 +8,7 @@ #include #include -static char const* whoami = 0; +static char const* whoami = nullptr; void usage() diff --git a/examples/pdf-set-form-values.cc b/examples/pdf-set-form-values.cc index cc328cf3..1398c0dd 100644 --- a/examples/pdf-set-form-values.cc +++ b/examples/pdf-set-form-values.cc @@ -8,7 +8,7 @@ #include #include -static char const* whoami = 0; +static char const* whoami = nullptr; void usage() diff --git a/examples/qpdf-job.cc b/examples/qpdf-job.cc index b71b612a..614abbe6 100644 --- a/examples/qpdf-job.cc +++ b/examples/qpdf-job.cc @@ -8,7 +8,7 @@ // This program is a simple demonstration of different ways to use the // QPDFJob API. -static char const* whoami = 0; +static char const* whoami = nullptr; static void usage() -- cgit v1.2.3-54-g00ecf