Commit fd17c8e3fe38a56abf50ce0edec1cde48d4f74cb

Authored by Jay Berkenbilt
Committed by GitHub
2 parents a6d7b79e e6577a13

Merge pull request #963 from m-holger/tidy

Code tidy
Showing 148 changed files with 400 additions and 483 deletions

Too many changes.

To preserve performance only 100 of 148 files are displayed.

examples/pdf-bookmarks.cc
... ... @@ -5,8 +5,8 @@
5 5 #include <qpdf/QTC.hh>
6 6 #include <qpdf/QUtil.hh>
7 7 #include <iostream>
8   -#include <stdlib.h>
9   -#include <string.h>
  8 +#include <cstdlib>
  9 +#include <cstring>
10 10  
11 11 // This program demonstrates extraction of bookmarks using the qpdf
12 12 // outlines API. Note that all the information shown by this program
... ...
examples/pdf-count-strings.cc
... ... @@ -5,14 +5,12 @@
5 5 //
6 6  
7 7 #include <iostream>
8   -#include <stdlib.h>
9   -#include <string.h>
  8 +#include <cstdlib>
10 9  
11 10 #include <qpdf/Pl_StdioFile.hh>
12 11 #include <qpdf/QPDF.hh>
13 12 #include <qpdf/QPDFObjectHandle.hh>
14 13 #include <qpdf/QPDFPageDocumentHelper.hh>
15   -#include <qpdf/QPDFPageObjectHelper.hh>
16 14 #include <qpdf/QUtil.hh>
17 15  
18 16 static char const* whoami = nullptr;
... ... @@ -32,9 +30,9 @@ class StringCounter: public QPDFObjectHandle::TokenFilter
32 30 count(0)
33 31 {
34 32 }
35   - virtual ~StringCounter() = default;
36   - virtual void handleToken(QPDFTokenizer::Token const&);
37   - virtual void handleEOF();
  33 + ~StringCounter() override = default;
  34 + void handleToken(QPDFTokenizer::Token const&) override;
  35 + void handleEOF() override;
38 36 int getCount() const;
39 37  
40 38 private:
... ...
examples/pdf-create.cc
... ... @@ -12,13 +12,11 @@
12 12 #include <qpdf/QPDF.hh>
13 13 #include <qpdf/QPDFObjectHandle.hh>
14 14 #include <qpdf/QPDFPageDocumentHelper.hh>
15   -#include <qpdf/QPDFPageObjectHelper.hh>
16 15 #include <qpdf/QPDFWriter.hh>
17 16 #include <qpdf/QUtil.hh>
18 17 #include <iostream>
19 18 #include <memory>
20   -#include <stdlib.h>
21   -#include <string.h>
  19 +#include <cstdlib>
22 20  
23 21 static char const* whoami = nullptr;
24 22  
... ... @@ -28,8 +26,8 @@ class ImageProvider: public QPDFObjectHandle::StreamDataProvider
28 26 {
29 27 public:
30 28 ImageProvider(std::string const& color_space, std::string const& filter);
31   - virtual ~ImageProvider() = default;
32   - virtual void provideStreamData(QPDFObjGen const&, Pipeline* pipeline);
  29 + ~ImageProvider() override = default;
  30 + void provideStreamData(QPDFObjGen const&, Pipeline* pipeline) override;
33 31 size_t getWidth() const;
34 32 size_t getHeight() const;
35 33  
... ... @@ -168,7 +166,7 @@ add_page(
168 166 // mode. Since we are not specifying, QPDFWriter will compress
169 167 // with /FlateDecode if we don't provide any other form of
170 168 // compression.
171   - ImageProvider* p = new ImageProvider(color_space, filter);
  169 + auto* p = new ImageProvider(color_space, filter);
172 170 std::shared_ptr<QPDFObjectHandle::StreamDataProvider> provider(p);
173 171 size_t width = p->getWidth();
174 172 size_t height = p->getHeight();
... ... @@ -288,7 +286,7 @@ check(
288 286 if (!this_errors) {
289 287 // Check image data
290 288 auto actual_data = image.getStreamData(qpdf_dl_all);
291   - ImageProvider* p = new ImageProvider(desired_color_space, "null");
  289 + auto* p = new ImageProvider(desired_color_space, "null");
292 290 std::shared_ptr<QPDFObjectHandle::StreamDataProvider> provider(p);
293 291 Pl_Buffer b_p("get image data");
294 292 provider->provideStreamData(QPDFObjGen(), &b_p);
... ...
examples/pdf-custom-filter.cc
... ... @@ -48,9 +48,9 @@ class Pl_XOR: public Pipeline
48 48  
49 49 public:
50 50 Pl_XOR(char const* identifier, Pipeline* next, unsigned char key);
51   - virtual ~Pl_XOR() = default;
52   - virtual void write(unsigned char const* data, size_t len) override;
53   - virtual void finish() override;
  51 + ~Pl_XOR() override = default;
  52 + void write(unsigned char const* data, size_t len) override;
  53 + void finish() override;
54 54  
55 55 private:
56 56 unsigned char key;
... ... @@ -91,10 +91,10 @@ class SF_XORDecode: public QPDFStreamFilter
91 91 // filter, which just means QPDF assumes that it should not
92 92 // "uncompress" the stream by default.
93 93 public:
94   - virtual ~SF_XORDecode() = default;
95   - virtual bool setDecodeParms(QPDFObjectHandle decode_parms) override;
96   - virtual Pipeline* getDecodePipeline(Pipeline* next) override;
97   - virtual bool isSpecializedCompression() override;
  94 + ~SF_XORDecode() override = default;
  95 + bool setDecodeParms(QPDFObjectHandle decode_parms) override;
  96 + Pipeline* getDecodePipeline(Pipeline* next) override;
  97 + bool isSpecializedCompression() override;
98 98  
99 99 private:
100 100 unsigned char key;
... ... @@ -199,8 +199,8 @@ class StreamReplacer: public QPDFObjectHandle::StreamDataProvider
199 199  
200 200 public:
201 201 StreamReplacer(QPDF* pdf);
202   - virtual ~StreamReplacer() = default;
203   - virtual void
  202 + ~StreamReplacer() override = default;
  203 + void
204 204 provideStreamData(QPDFObjGen const& og, Pipeline* pipeline) override;
205 205  
206 206 void registerStream(
... ... @@ -409,7 +409,7 @@ process(
409 409 // Create a single StreamReplacer instance. The interface requires
410 410 // a std::shared_ptr in various places, so allocate a StreamReplacer
411 411 // and stash it in a std::shared_ptr.
412   - StreamReplacer* replacer = new StreamReplacer(&qpdf);
  412 + auto* replacer = new StreamReplacer(&qpdf);
413 413 std::shared_ptr<QPDFObjectHandle::StreamDataProvider> p(replacer);
414 414  
415 415 for (auto& o: qpdf.getAllObjects()) {
... ...
examples/pdf-double-page-size.cc
... ... @@ -5,8 +5,8 @@
5 5 #include <qpdf/QPDFWriter.hh>
6 6 #include <qpdf/QUtil.hh>
7 7 #include <iostream>
8   -#include <stdlib.h>
9   -#include <string.h>
  8 +#include <cstdlib>
  9 +#include <cstring>
10 10  
11 11 static char const* whoami = nullptr;
12 12  
... ...
examples/pdf-filter-tokens.cc
... ... @@ -8,13 +8,11 @@
8 8 #include <algorithm>
9 9 #include <deque>
10 10 #include <iostream>
11   -#include <stdlib.h>
12   -#include <string.h>
  11 +#include <cstdlib>
13 12  
14 13 #include <qpdf/QPDF.hh>
15 14 #include <qpdf/QPDFObjectHandle.hh>
16 15 #include <qpdf/QPDFPageDocumentHelper.hh>
17   -#include <qpdf/QPDFPageObjectHelper.hh>
18 16 #include <qpdf/QPDFWriter.hh>
19 17 #include <qpdf/QUtil.hh>
20 18  
... ... @@ -35,8 +33,8 @@ usage()
35 33 class StringReverser: public QPDFObjectHandle::TokenFilter
36 34 {
37 35 public:
38   - virtual ~StringReverser() = default;
39   - virtual void handleToken(QPDFTokenizer::Token const&);
  36 + ~StringReverser() override = default;
  37 + void handleToken(QPDFTokenizer::Token const&) override;
40 38 };
41 39  
42 40 void
... ... @@ -68,9 +66,9 @@ StringReverser::handleToken(QPDFTokenizer::Token const&amp; token)
68 66 class ColorToGray: public QPDFObjectHandle::TokenFilter
69 67 {
70 68 public:
71   - virtual ~ColorToGray() = default;
72   - virtual void handleToken(QPDFTokenizer::Token const&);
73   - virtual void handleEOF();
  69 + ~ColorToGray() override = default;
  70 + void handleToken(QPDFTokenizer::Token const&) override;
  71 + void handleEOF() override;
74 72  
75 73 private:
76 74 bool isNumeric(QPDFTokenizer::token_type_e);
... ...
examples/pdf-invert-images.cc
... ... @@ -6,8 +6,8 @@
6 6 #include <qpdf/QPDFWriter.hh>
7 7 #include <qpdf/QUtil.hh>
8 8 #include <iostream>
9   -#include <stdlib.h>
10   -#include <string.h>
  9 +#include <cstdlib>
  10 +#include <cstring>
11 11  
12 12 static char const* whoami = nullptr;
13 13  
... ... @@ -33,8 +33,8 @@ usage()
33 33 class ImageInverter: public QPDFObjectHandle::StreamDataProvider
34 34 {
35 35 public:
36   - virtual ~ImageInverter() = default;
37   - virtual void
  36 + ~ImageInverter() override = default;
  37 + void
38 38 provideStreamData(QPDFObjGen const& og, Pipeline* pipeline) override;
39 39  
40 40 void registerImage(
... ... @@ -124,7 +124,7 @@ main(int argc, char* argv[])
124 124 QPDF qpdf;
125 125 qpdf.processFile(infilename, password);
126 126  
127   - ImageInverter* inv = new ImageInverter;
  127 + auto* inv = new ImageInverter;
128 128 auto p = std::shared_ptr<QPDFObjectHandle::StreamDataProvider>(inv);
129 129  
130 130 // For each page...
... ...
examples/pdf-mod-info.cc
... ... @@ -6,9 +6,9 @@
6 6 #include <qpdf/QTC.hh>
7 7 #include <qpdf/QUtil.hh>
8 8 #include <iostream>
9   -#include <stdio.h>
10   -#include <stdlib.h>
11   -#include <string.h>
  9 +#include <cstdio>
  10 +#include <cstdlib>
  11 +#include <cstring>
12 12  
13 13 static char const* version = "1.1";
14 14 static char const* whoami = nullptr;
... ...
examples/pdf-name-number-tree.cc
... ... @@ -3,7 +3,6 @@
3 3 #include <qpdf/QPDFNumberTreeObjectHelper.hh>
4 4 #include <qpdf/QPDFWriter.hh>
5 5 #include <qpdf/QUtil.hh>
6   -#include <cstring>
7 6 #include <iostream>
8 7  
9 8 static char const* whoami = nullptr;
... ...
examples/pdf-npages.cc
1 1 #include <iostream>
2   -#include <stdlib.h>
3   -#include <string.h>
  2 +#include <cstdlib>
  3 +#include <cstring>
4 4  
5 5 #include <qpdf/QPDF.hh>
6 6 #include <qpdf/QUtil.hh>
... ...
examples/pdf-overlay-page.cc
... ... @@ -4,8 +4,7 @@
4 4 #include <qpdf/QPDFWriter.hh>
5 5 #include <qpdf/QUtil.hh>
6 6 #include <iostream>
7   -#include <stdlib.h>
8   -#include <string.h>
  7 +#include <cstdlib>
9 8  
10 9 // This program demonstrates use of form XObjects to overlay a page
11 10 // from one file onto all pages of another file. The qpdf program's
... ...
examples/pdf-parse-content.cc
1 1 #include <iostream>
2   -#include <stdlib.h>
3   -#include <string.h>
  2 +#include <cstdlib>
4 3  
5 4 #include <qpdf/QIntC.hh>
6 5 #include <qpdf/QPDF.hh>
... ... @@ -23,10 +22,10 @@ usage()
23 22 class ParserCallbacks: public QPDFObjectHandle::ParserCallbacks
24 23 {
25 24 public:
26   - virtual ~ParserCallbacks() = default;
27   - virtual void contentSize(size_t);
28   - virtual void handleObject(QPDFObjectHandle, size_t offset, size_t length);
29   - virtual void handleEOF();
  25 + ~ParserCallbacks() override = default;
  26 + void contentSize(size_t) override;
  27 + void handleObject(QPDFObjectHandle, size_t offset, size_t length) override;
  28 + void handleEOF() override;
30 29 };
31 30  
32 31 void
... ...
examples/pdf-set-form-values.cc
... ... @@ -4,9 +4,7 @@
4 4 #include <qpdf/QPDFWriter.hh>
5 5 #include <qpdf/QUtil.hh>
6 6 #include <iostream>
7   -#include <stdio.h>
8   -#include <stdlib.h>
9   -#include <string.h>
  7 +#include <cstdlib>
10 8  
11 9 static char const* whoami = nullptr;
12 10  
... ...
examples/pdf-split-pages.cc
... ... @@ -12,7 +12,7 @@
12 12  
13 13 #include <cstring>
14 14 #include <iostream>
15   -#include <stdlib.h>
  15 +#include <cstdlib>
16 16 #include <string>
17 17  
18 18 static bool static_id = false;
... ...
examples/qpdf-job.cc
1   -#include <qpdf/QIntC.hh>
2 1 #include <qpdf/QPDFJob.hh>
3 2 #include <qpdf/QUtil.hh>
4 3  
5   -#include <cstring>
6 4 #include <iostream>
7 5  
8 6 // This program is a simple demonstration of different ways to use the
... ...
examples/qpdfjob-c-save-attachment.c
1   -#include <qpdf/Constants.h>
2 1 #include <qpdf/qpdfjob-c.h>
3 2 #include <qpdf/qpdflogger-c.h>
4 3  
... ...
examples/qpdfjob-remove-annotations.cc
... ... @@ -4,7 +4,6 @@
4 4  
5 5 #include <cstdio>
6 6 #include <cstdlib>
7   -#include <cstring>
8 7 #include <iostream>
9 8  
10 9 // This example demonstrates how we can use the QPDFJob createQPDF and writeQPDF
... ... @@ -12,7 +11,7 @@
12 11 // The example is a full copy of the qpdf program modified to allways remove all
13 12 // annotations from the final output.
14 13  
15   -static char const* whoami = 0;
  14 +static char const* whoami = nullptr;
16 15  
17 16 static void
18 17 usageExit(std::string const& msg)
... ...
fuzz/qpdf_fuzzer.cc
... ... @@ -14,13 +14,13 @@
14 14 class DiscardContents: public QPDFObjectHandle::ParserCallbacks
15 15 {
16 16 public:
17   - virtual ~DiscardContents() = default;
18   - virtual void
19   - handleObject(QPDFObjectHandle)
  17 + ~DiscardContents() override = default;
  18 + void
  19 + handleObject(QPDFObjectHandle) override
20 20 {
21 21 }
22   - virtual void
23   - handleEOF()
  22 + void
  23 + handleEOF() override
24 24 {
25 25 }
26 26 };
... ...
include/qpdf/Buffer.hh
... ... @@ -26,7 +26,7 @@
26 26 #include <qpdf/PointerHolder.hh> // unused -- remove in qpdf 12 (see #785)
27 27  
28 28 #include <memory>
29   -#include <stddef.h>
  29 +#include <cstddef>
30 30  
31 31 class Buffer
32 32 {
... ...
include/qpdf/InputSource.hh
... ... @@ -27,7 +27,7 @@
27 27 #include <qpdf/Types.h>
28 28  
29 29 #include <memory>
30   -#include <stdio.h>
  30 +#include <cstdio>
31 31 #include <string>
32 32  
33 33 // Remember to use QPDF_DLL_CLASS on anything derived from InputSource
... ...
include/qpdf/JSON.hh
... ... @@ -369,8 +369,8 @@ class JSON
369 369 JSON_value(vt_dictionary)
370 370 {
371 371 }
372   - virtual ~JSON_dictionary() = default;
373   - virtual void write(Pipeline*, size_t depth) const;
  372 + ~JSON_dictionary() override = default;
  373 + void write(Pipeline*, size_t depth) const override;
374 374 std::map<std::string, JSON> members;
375 375 std::set<std::string> parsed_keys;
376 376 };
... ... @@ -380,15 +380,15 @@ class JSON
380 380 JSON_value(vt_array)
381 381 {
382 382 }
383   - virtual ~JSON_array() = default;
384   - virtual void write(Pipeline*, size_t depth) const;
  383 + ~JSON_array() override = default;
  384 + void write(Pipeline*, size_t depth) const override;
385 385 std::vector<JSON> elements;
386 386 };
387 387 struct JSON_string: public JSON_value
388 388 {
389 389 JSON_string(std::string const& utf8);
390   - virtual ~JSON_string() = default;
391   - virtual void write(Pipeline*, size_t depth) const;
  390 + ~JSON_string() override = default;
  391 + void write(Pipeline*, size_t depth) const override;
392 392 std::string utf8;
393 393 std::string encoded;
394 394 };
... ... @@ -397,15 +397,15 @@ class JSON
397 397 JSON_number(long long val);
398 398 JSON_number(double val);
399 399 JSON_number(std::string const& val);
400   - virtual ~JSON_number() = default;
401   - virtual void write(Pipeline*, size_t depth) const;
  400 + ~JSON_number() override = default;
  401 + void write(Pipeline*, size_t depth) const override;
402 402 std::string encoded;
403 403 };
404 404 struct JSON_bool: public JSON_value
405 405 {
406 406 JSON_bool(bool val);
407   - virtual ~JSON_bool() = default;
408   - virtual void write(Pipeline*, size_t depth) const;
  407 + ~JSON_bool() override = default;
  408 + void write(Pipeline*, size_t depth) const override;
409 409 bool value;
410 410 };
411 411 struct JSON_null: public JSON_value
... ... @@ -414,14 +414,14 @@ class JSON
414 414 JSON_value(vt_null)
415 415 {
416 416 }
417   - virtual ~JSON_null() = default;
418   - virtual void write(Pipeline*, size_t depth) const;
  417 + ~JSON_null() override = default;
  418 + void write(Pipeline*, size_t depth) const override;
419 419 };
420 420 struct JSON_blob: public JSON_value
421 421 {
422 422 JSON_blob(std::function<void(Pipeline*)> fn);
423   - virtual ~JSON_blob() = default;
424   - virtual void write(Pipeline*, size_t depth) const;
  423 + ~JSON_blob() override = default;
  424 + void write(Pipeline*, size_t depth) const override;
425 425 std::function<void(Pipeline*)> fn;
426 426 };
427 427  
... ...
include/qpdf/Pl_Buffer.hh
... ... @@ -43,13 +43,13 @@ class QPDF_DLL_CLASS Pl_Buffer: public Pipeline
43 43 {
44 44 public:
45 45 QPDF_DLL
46   - Pl_Buffer(char const* identifier, Pipeline* next = 0);
  46 + Pl_Buffer(char const* identifier, Pipeline* next = nullptr);
47 47 QPDF_DLL
48   - virtual ~Pl_Buffer();
  48 + ~Pl_Buffer() override;
49 49 QPDF_DLL
50   - virtual void write(unsigned char const*, size_t);
  50 + void write(unsigned char const*, size_t) override;
51 51 QPDF_DLL
52   - virtual void finish();
  52 + void finish() override;
53 53  
54 54 // Each call to getBuffer() resets this object -- see notes above.
55 55 // The caller is responsible for deleting the returned Buffer
... ...
include/qpdf/Pl_DCT.hh
... ... @@ -57,7 +57,7 @@ class QPDF_DLL_CLASS Pl_DCT: public Pipeline
57 57 JDIMENSION image_height,
58 58 int components,
59 59 J_COLOR_SPACE color_space,
60   - CompressConfig* config_callback = 0);
  60 + CompressConfig* config_callback = nullptr);
61 61  
62 62 QPDF_DLL
63 63 virtual ~Pl_DCT();
... ... @@ -91,7 +91,7 @@ class QPDF_DLL_CLASS Pl_DCT: public Pipeline
91 91 JDIMENSION image_height = 0,
92 92 int components = 1,
93 93 J_COLOR_SPACE color_space = JCS_GRAYSCALE,
94   - CompressConfig* config_callback = 0);
  94 + CompressConfig* config_callback = nullptr);
95 95 Members(Members const&) = delete;
96 96  
97 97 action_e action;
... ...
include/qpdf/Pl_QPDFTokenizer.hh
... ... @@ -51,7 +51,7 @@ class QPDF_DLL_CLASS Pl_QPDFTokenizer: public Pipeline
51 51 Pl_QPDFTokenizer(
52 52 char const* identifier,
53 53 QPDFObjectHandle::TokenFilter* filter,
54   - Pipeline* next = 0);
  54 + Pipeline* next = nullptr);
55 55 QPDF_DLL
56 56 virtual ~Pl_QPDFTokenizer();
57 57 QPDF_DLL
... ...
include/qpdf/Pl_StdioFile.hh
... ... @@ -26,7 +26,7 @@
26 26  
27 27 #include <qpdf/Pipeline.hh>
28 28  
29   -#include <stdio.h>
  29 +#include <cstdio>
30 30  
31 31 //
32 32 // This pipeline is reusable.
... ...
include/qpdf/QPDF.hh
... ... @@ -30,7 +30,7 @@
30 30 #include <list>
31 31 #include <map>
32 32 #include <memory>
33   -#include <stdio.h>
  33 +#include <cstdio>
34 34 #include <string>
35 35 #include <string_view>
36 36 #include <vector>
... ... @@ -83,7 +83,7 @@ class QPDF
83 83 // interpreted as a raw encryption key. See comments on
84 84 // setPasswordIsHexKey for more information.
85 85 QPDF_DLL
86   - void processFile(char const* filename, char const* password = 0);
  86 + void processFile(char const* filename, char const* password = nullptr);
87 87  
88 88 // Parse a PDF from a stdio FILE*. The FILE must be open in
89 89 // binary mode and must be seekable. It may be open read only.
... ... @@ -96,7 +96,7 @@ class QPDF
96 96 char const* description,
97 97 FILE* file,
98 98 bool close_file,
99   - char const* password = 0);
  99 + char const* password = nullptr);
100 100  
101 101 // Parse a PDF file loaded into a memory buffer. This works
102 102 // exactly like processFile except that the PDF file is in memory
... ... @@ -107,14 +107,14 @@ class QPDF
107 107 char const* description,
108 108 char const* buf,
109 109 size_t length,
110   - char const* password = 0);
  110 + char const* password = nullptr);
111 111  
112 112 // Parse a PDF file loaded from a custom InputSource. If you have
113 113 // your own method of retrieving a PDF file, you can subclass
114 114 // InputSource and use this method.
115 115 QPDF_DLL
116 116 void
117   - processInputSource(std::shared_ptr<InputSource>, char const* password = 0);
  117 + processInputSource(std::shared_ptr<InputSource>, char const* password = nullptr);
118 118  
119 119 // Create a PDF from an input source that contains JSON as written
120 120 // by writeJSON (or qpdf --json-output, version 2 or higher). The
... ...
include/qpdf/QPDFCryptoImpl.hh
... ... @@ -80,7 +80,7 @@ class QPDF_DLL_CLASS QPDFCryptoImpl
80 80 virtual void RC4_process(
81 81 unsigned char const* in_data,
82 82 size_t len,
83   - unsigned char* out_data = 0) = 0;
  83 + unsigned char* out_data = nullptr) = 0;
84 84 QPDF_DLL
85 85 virtual void RC4_finalize() = 0;
86 86  
... ...
include/qpdf/QPDFJob.hh
... ... @@ -497,7 +497,7 @@ class QPDFJob
497 497  
498 498 // Helper functions
499 499 static void usage(std::string const& msg);
500   - static JSON json_schema(int json_version, std::set<std::string>* keys = 0);
  500 + static JSON json_schema(int json_version, std::set<std::string>* keys = nullptr);
501 501 static void parse_object_id(
502 502 std::string const& objspec, bool& trailer, int& obj, int& gen);
503 503 void parseRotationParameter(std::string const&);
... ...
include/qpdf/QPDFObjectHandle.hh
... ... @@ -526,7 +526,7 @@ class QPDFObjectHandle
526 526 QPDF_DLL
527 527 void parsePageContents(ParserCallbacks* callbacks);
528 528 QPDF_DLL
529   - void filterPageContents(TokenFilter* filter, Pipeline* next = 0);
  529 + void filterPageContents(TokenFilter* filter, Pipeline* next = nullptr);
530 530 // See comments for QPDFPageObjectHelper::pipeContents.
531 531 QPDF_DLL
532 532 void pipePageContents(Pipeline* p);
... ... @@ -538,7 +538,7 @@ class QPDFObjectHandle
538 538 // contents. This can be used to apply a TokenFilter to a form
539 539 // XObject, whose data is in the same format as a content stream.
540 540 QPDF_DLL
541   - void filterAsContents(TokenFilter* filter, Pipeline* next = 0);
  541 + void filterAsContents(TokenFilter* filter, Pipeline* next = nullptr);
542 542 // Called on a stream to parse the stream as page contents. This
543 543 // can be used to parse a form XObject.
544 544 QPDF_DLL
... ...
include/qpdf/QPDFOutlineObjectHelper.hh
... ... @@ -42,7 +42,7 @@ class QPDFOutlineObjectHelper: public QPDFObjectHelper
42 42 {
43 43 // This must be cleared explicitly to avoid circular references
44 44 // that prevent cleanup of pointer holders.
45   - this->m->parent = 0;
  45 + this->m->parent = nullptr;
46 46 }
47 47  
48 48 // All constructors are private. You can only create one of these
... ...
include/qpdf/QPDFPageObjectHelper.hh
... ... @@ -320,12 +320,12 @@ class QPDFPageObjectHelper: public QPDFObjectHelper
320 320 // examples/pdf-count-strings.cc for an example.
321 321 QPDF_DLL
322 322 void
323   - filterContents(QPDFObjectHandle::TokenFilter* filter, Pipeline* next = 0);
  323 + filterContents(QPDFObjectHandle::TokenFilter* filter, Pipeline* next = nullptr);
324 324  
325 325 // Old name -- calls filterContents()
326 326 QPDF_DLL
327 327 void filterPageContents(
328   - QPDFObjectHandle::TokenFilter* filter, Pipeline* next = 0);
  328 + QPDFObjectHandle::TokenFilter* filter, Pipeline* next = nullptr);
329 329  
330 330 // Pipe a page's contents through the given pipeline. This method
331 331 // works whether the contents are a single stream or an array of
... ...
include/qpdf/QPDFTokenizer.hh
... ... @@ -28,7 +28,7 @@
28 28 #include <qpdf/PointerHolder.hh> // unused -- remove in qpdf 12 (see #785)
29 29  
30 30 #include <memory>
31   -#include <stdio.h>
  31 +#include <cstdio>
32 32 #include <string>
33 33  
34 34 class QPDFTokenizer
... ...
include/qpdf/QPDFWriter.hh
... ... @@ -34,7 +34,7 @@
34 34 #include <map>
35 35 #include <memory>
36 36 #include <set>
37   -#include <stdio.h>
  37 +#include <cstdio>
38 38 #include <string>
39 39 #include <string_view>
40 40 #include <vector>
... ... @@ -102,7 +102,7 @@ class QPDFWriter
102 102 QPDF_DLL
103 103 virtual ~FunctionProgressReporter();
104 104 QPDF_DLL
105   - virtual void reportProgress(int) override;
  105 + void reportProgress(int) override;
106 106  
107 107 private:
108 108 std::function<void(int)> handler;
... ... @@ -539,7 +539,7 @@ class QPDFWriter
539 539 friend class QPDFWriter;
540 540  
541 541 public:
542   - PipelinePopper(QPDFWriter* qw, std::shared_ptr<Buffer>* bp = 0) :
  542 + PipelinePopper(QPDFWriter* qw, std::shared_ptr<Buffer>* bp = nullptr) :
543 543 qw(qw),
544 544 bp(bp)
545 545 {
... ...
include/qpdf/QUtil.hh
... ... @@ -30,9 +30,9 @@
30 30 #include <list>
31 31 #include <memory>
32 32 #include <stdexcept>
33   -#include <stdio.h>
  33 +#include <cstdio>
34 34 #include <string>
35   -#include <time.h>
  35 +#include <ctime>
36 36 #include <vector>
37 37  
38 38 class RandomDataProvider;
... ... @@ -245,7 +245,7 @@ namespace QUtil
245 245 // Returns true iff the variable is defined. If `value' is
246 246 // non-null, initializes it with the value of the variable.
247 247 QPDF_DLL
248   - bool get_env(std::string const& var, std::string* value = 0);
  248 + bool get_env(std::string const& var, std::string* value = nullptr);
249 249  
250 250 QPDF_DLL
251 251 time_t get_current_time();
... ...
include/qpdf/RandomDataProvider.hh
... ... @@ -23,7 +23,7 @@
23 23 #define RANDOMDATAPROVIDER_HH
24 24  
25 25 #include <qpdf/DLL.h>
26   -#include <string.h> // for size_t
  26 +#include <cstring> // for size_t
27 27  
28 28 class QPDF_DLL_CLASS RandomDataProvider
29 29 {
... ...
libqpdf/BufferInputSource.cc
... ... @@ -2,10 +2,8 @@
2 2  
3 3 #include <qpdf/QIntC.hh>
4 4 #include <algorithm>
5   -#include <limits>
6 5 #include <sstream>
7   -#include <stdexcept>
8   -#include <string.h>
  6 +#include <cstring>
9 7  
10 8 BufferInputSource::BufferInputSource(
11 9 std::string const& description, Buffer* buf, bool own_memory) :
... ...
libqpdf/FileInputSource.cc
... ... @@ -3,7 +3,7 @@
3 3 #include <qpdf/QPDFExc.hh>
4 4 #include <qpdf/QUtil.hh>
5 5 #include <algorithm>
6   -#include <string.h>
  6 +#include <cstring>
7 7  
8 8 FileInputSource::FileInputSource() :
9 9 close_file(false),
... ...
libqpdf/InputSource.cc
... ... @@ -3,7 +3,7 @@
3 3 #include <qpdf/QIntC.hh>
4 4 #include <qpdf/QTC.hh>
5 5 #include <stdexcept>
6   -#include <string.h>
  6 +#include <cstring>
7 7  
8 8 void
9 9 InputSource::setLastOffset(qpdf_offset_t offset)
... ...
libqpdf/InsecureRandomDataProvider.cc
... ... @@ -2,7 +2,7 @@
2 2  
3 3 #include <qpdf/QUtil.hh>
4 4 #include <qpdf/qpdf-config.h>
5   -#include <stdlib.h>
  5 +#include <cstdlib>
6 6  
7 7 InsecureRandomDataProvider::InsecureRandomDataProvider() :
8 8 seeded_random(false)
... ... @@ -24,7 +24,7 @@ InsecureRandomDataProvider::random()
24 24 // Seed the random number generator with something simple, but
25 25 // just to be interesting, don't use the unmodified current
26 26 // time. It would be better if this were a more secure seed.
27   - unsigned int seed =
  27 + auto seed =
28 28 static_cast<unsigned int>(QUtil::get_current_time() ^ 0xcccc);
29 29 #ifdef HAVE_RANDOM
30 30 ::srandom(seed);
... ...
libqpdf/JSON.cc
... ... @@ -294,7 +294,7 @@ JSON::addDictionaryMember(std::string const&amp; key, JSON const&amp; val)
294 294 bool
295 295 JSON::checkDictionaryKeySeen(std::string const& key)
296 296 {
297   - JSON_dictionary* obj = dynamic_cast<JSON_dictionary*>(this->m->value.get());
  297 + auto* obj = dynamic_cast<JSON_dictionary*>(this->m->value.get());
298 298 if (nullptr == obj) {
299 299 throw std::logic_error(
300 300 "JSON::checkDictionaryKey called on non-dictionary");
... ... @@ -315,7 +315,7 @@ JSON::makeArray()
315 315 JSON
316 316 JSON::addArrayElement(JSON const& val)
317 317 {
318   - JSON_array* arr = dynamic_cast<JSON_array*>(this->m->value.get());
  318 + auto* arr = dynamic_cast<JSON_array*>(this->m->value.get());
319 319 if (nullptr == arr) {
320 320 throw std::runtime_error("JSON::addArrayElement called on non-array");
321 321 }
... ... @@ -470,13 +470,13 @@ JSON::checkSchemaInternal(
470 470 std::list<std::string>& errors,
471 471 std::string prefix)
472 472 {
473   - JSON_array* this_arr = dynamic_cast<JSON_array*>(this_v);
474   - JSON_dictionary* this_dict = dynamic_cast<JSON_dictionary*>(this_v);
  473 + auto* this_arr = dynamic_cast<JSON_array*>(this_v);
  474 + auto* this_dict = dynamic_cast<JSON_dictionary*>(this_v);
475 475  
476   - JSON_array* sch_arr = dynamic_cast<JSON_array*>(sch_v);
477   - JSON_dictionary* sch_dict = dynamic_cast<JSON_dictionary*>(sch_v);
  476 + auto* sch_arr = dynamic_cast<JSON_array*>(sch_v);
  477 + auto* sch_dict = dynamic_cast<JSON_dictionary*>(sch_v);
478 478  
479   - JSON_string* sch_str = dynamic_cast<JSON_string*>(sch_v);
  479 + auto* sch_str = dynamic_cast<JSON_string*>(sch_v);
480 480  
481 481 std::string err_prefix;
482 482 if (prefix.empty()) {
... ...
libqpdf/MD5.cc
... ... @@ -4,11 +4,7 @@
4 4 #include <qpdf/QPDFCryptoProvider.hh>
5 5 #include <qpdf/QUtil.hh>
6 6  
7   -#include <errno.h>
8   -#include <memory.h>
9   -#include <stdio.h>
10   -#include <stdlib.h>
11   -#include <string.h>
  7 +#include <cstring>
12 8  
13 9 MD5::MD5()
14 10 {
... ...
libqpdf/Pipeline.cc
1 1 #include <qpdf/Pipeline.hh>
2 2  
3   -#include <qpdf/QUtil.hh>
4   -
5 3 #include <cstring>
6 4 #include <stdexcept>
7 5  
... ...
libqpdf/Pl_AES_PDF.cc
... ... @@ -5,7 +5,6 @@
5 5 #include <qpdf/QUtil.hh>
6 6 #include <cstring>
7 7 #include <stdexcept>
8   -#include <stdlib.h>
9 8 #include <string>
10 9  
11 10 bool Pl_AES_PDF::use_static_iv = false;
... ...
libqpdf/Pl_ASCII85Decoder.cc
... ... @@ -2,7 +2,7 @@
2 2  
3 3 #include <qpdf/QTC.hh>
4 4 #include <stdexcept>
5   -#include <string.h>
  5 +#include <cstring>
6 6  
7 7 Pl_ASCII85Decoder::Pl_ASCII85Decoder(char const* identifier, Pipeline* next) :
8 8 Pipeline(identifier, next),
... ...
libqpdf/Pl_ASCIIHexDecoder.cc
1 1 #include <qpdf/Pl_ASCIIHexDecoder.hh>
2 2  
3 3 #include <qpdf/QTC.hh>
4   -#include <ctype.h>
  4 +#include <cctype>
5 5 #include <stdexcept>
6   -#include <string.h>
7 6  
8 7 Pl_ASCIIHexDecoder::Pl_ASCIIHexDecoder(char const* identifier, Pipeline* next) :
9 8 Pipeline(identifier, next),
... ... @@ -77,7 +76,7 @@ Pl_ASCIIHexDecoder::flush()
77 76 b[i] = this->inbuf[i] - '0';
78 77 }
79 78 }
80   - unsigned char ch = static_cast<unsigned char>((b[0] << 4) + b[1]);
  79 + auto ch = static_cast<unsigned char>((b[0] << 4) + b[1]);
81 80  
82 81 QTC::TC(
83 82 "libtests",
... ...
libqpdf/Pl_Base64.cc
... ... @@ -2,7 +2,6 @@
2 2  
3 3 #include <qpdf/QIntC.hh>
4 4 #include <qpdf/QUtil.hh>
5   -#include <algorithm>
6 5 #include <cstring>
7 6 #include <stdexcept>
8 7  
... ...
libqpdf/Pl_Buffer.cc
... ... @@ -2,8 +2,8 @@
2 2  
3 3 #include <algorithm>
4 4 #include <stdexcept>
5   -#include <stdlib.h>
6   -#include <string.h>
  5 +#include <cstdlib>
  6 +#include <cstring>
7 7  
8 8 Pl_Buffer::Pl_Buffer(char const* identifier, Pipeline* next) :
9 9 Pipeline(identifier, next),
... ... @@ -45,7 +45,7 @@ Pl_Buffer::getBuffer()
45 45 }
46 46  
47 47 auto size = this->m->data.length();
48   - Buffer* b = new Buffer(size);
  48 + auto* b = new Buffer(size);
49 49 if (size > 0) {
50 50 unsigned char* p = b->getBuffer();
51 51 memcpy(p, this->m->data.data(), size);
... ...
libqpdf/Pl_DCT.cc
... ... @@ -2,12 +2,9 @@
2 2  
3 3 #include <qpdf/QIntC.hh>
4 4 #include <qpdf/QTC.hh>
5   -#include <qpdf/QUtil.hh>
6 5  
7   -#include <cstring>
8   -#include <setjmp.h>
  6 +#include <csetjmp>
9 7 #include <stdexcept>
10   -#include <stdlib.h>
11 8 #include <string>
12 9  
13 10 #if BITS_IN_JSAMPLE != 8
... ... @@ -27,7 +24,7 @@ namespace
27 24 static void
28 25 error_handler(j_common_ptr cinfo)
29 26 {
30   - qpdf_jpeg_error_mgr* jerr =
  27 + auto* jerr =
31 28 reinterpret_cast<qpdf_jpeg_error_mgr*>(cinfo->err);
32 29 char buf[JMSG_LENGTH_MAX];
33 30 (*cinfo->err->format_message)(cinfo, buf);
... ... @@ -170,7 +167,7 @@ static boolean
170 167 empty_pipeline_output_buffer(j_compress_ptr cinfo)
171 168 {
172 169 QTC::TC("libtests", "Pl_DCT empty_pipeline_output_buffer");
173   - dct_pipeline_dest* dest = reinterpret_cast<dct_pipeline_dest*>(cinfo->dest);
  170 + auto* dest = reinterpret_cast<dct_pipeline_dest*>(cinfo->dest);
174 171 dest->next->write(dest->buffer, dest->size);
175 172 dest->pub.next_output_byte = dest->buffer;
176 173 dest->pub.free_in_buffer = dest->size;
... ... @@ -181,7 +178,7 @@ static void
181 178 term_pipeline_destination(j_compress_ptr cinfo)
182 179 {
183 180 QTC::TC("libtests", "Pl_DCT term_pipeline_destination");
184   - dct_pipeline_dest* dest = reinterpret_cast<dct_pipeline_dest*>(cinfo->dest);
  181 + auto* dest = reinterpret_cast<dct_pipeline_dest*>(cinfo->dest);
185 182 dest->next->write(dest->buffer, dest->size - dest->pub.free_in_buffer);
186 183 }
187 184  
... ... @@ -195,7 +192,7 @@ jpeg_pipeline_dest(
195 192 reinterpret_cast<j_common_ptr>(cinfo),
196 193 JPOOL_PERMANENT,
197 194 sizeof(dct_pipeline_dest)));
198   - dct_pipeline_dest* dest = reinterpret_cast<dct_pipeline_dest*>(cinfo->dest);
  195 + auto* dest = reinterpret_cast<dct_pipeline_dest*>(cinfo->dest);
199 196 dest->pub.init_destination = init_pipeline_destination;
200 197 dest->pub.empty_output_buffer = empty_pipeline_output_buffer;
201 198 dest->pub.term_destination = term_pipeline_destination;
... ... @@ -264,7 +261,7 @@ jpeg_buffer_src(j_decompress_ptr cinfo, Buffer* buffer)
264 261 void
265 262 Pl_DCT::compress(void* cinfo_p, Buffer* b)
266 263 {
267   - struct jpeg_compress_struct* cinfo =
  264 + auto* cinfo =
268 265 reinterpret_cast<jpeg_compress_struct*>(cinfo_p);
269 266  
270 267 #if ( \
... ... @@ -319,7 +316,7 @@ Pl_DCT::compress(void* cinfo_p, Buffer* b)
319 316 void
320 317 Pl_DCT::decompress(void* cinfo_p, Buffer* b)
321 318 {
322   - struct jpeg_decompress_struct* cinfo =
  319 + auto* cinfo =
323 320 reinterpret_cast<jpeg_decompress_struct*>(cinfo_p);
324 321  
325 322 #if ( \
... ...
libqpdf/Pl_Flate.cc
1 1 #include <qpdf/Pl_Flate.hh>
2 2  
3   -#include <limits.h>
4   -#include <string.h>
  3 +#include <climits>
  4 +#include <cstring>
5 5 #include <zlib.h>
6 6  
7 7 #include <qpdf/QIntC.hh>
... ...
libqpdf/Pl_Function.cc
1 1 #include <qpdf/Pl_Function.hh>
2 2  
3   -#include <qpdf/QUtil.hh>
4   -#include <errno.h>
5 3 #include <stdexcept>
6 4  
7 5 Pl_Function::Members::Members(writer_t fn) :
... ...
libqpdf/Pl_LZWDecoder.cc
... ... @@ -4,7 +4,7 @@
4 4 #include <qpdf/QTC.hh>
5 5 #include <qpdf/QUtil.hh>
6 6 #include <stdexcept>
7   -#include <string.h>
  7 +#include <cstring>
8 8  
9 9 Pl_LZWDecoder::Pl_LZWDecoder(
10 10 char const* identifier, Pipeline* next, bool early_code_change) :
... ... @@ -189,7 +189,7 @@ Pl_LZWDecoder::handleCode(unsigned int code)
189 189 }
190 190  
191 191 if (code < 256) {
192   - unsigned char ch = static_cast<unsigned char>(code);
  192 + auto ch = static_cast<unsigned char>(code);
193 193 getNext()->write(&ch, 1);
194 194 } else {
195 195 unsigned int idx = code - 258;
... ...
libqpdf/Pl_OStream.cc
1 1 #include <qpdf/Pl_OStream.hh>
2 2  
3   -#include <qpdf/QUtil.hh>
4   -#include <errno.h>
5 3 #include <stdexcept>
6 4  
7 5 Pl_OStream::Members::Members(std::ostream& os) :
... ...
libqpdf/Pl_PNGFilter.cc
... ... @@ -3,9 +3,9 @@
3 3 #include <qpdf/QTC.hh>
4 4 #include <qpdf/QUtil.hh>
5 5  
6   -#include <limits.h>
  6 +#include <climits>
7 7 #include <stdexcept>
8   -#include <string.h>
  8 +#include <cstring>
9 9  
10 10 static int
11 11 abs_diff(int a, int b)
... ...
libqpdf/Pl_QPDFTokenizer.cc
... ... @@ -2,9 +2,7 @@
2 2  
3 3 #include <qpdf/BufferInputSource.hh>
4 4 #include <qpdf/QTC.hh>
5   -#include <qpdf/QUtil.hh>
6 5 #include <stdexcept>
7   -#include <string.h>
8 6  
9 7 Pl_QPDFTokenizer::Members::Members() :
10 8 filter(nullptr),
... ...
libqpdf/Pl_RunLength.cc
... ... @@ -127,11 +127,11 @@ Pl_RunLength::flush_encode()
127 127 throw std::logic_error(
128 128 "Pl_RunLength: invalid length in flush_encode for run");
129 129 }
130   - unsigned char ch = static_cast<unsigned char>(257 - this->m->length);
  130 + auto ch = static_cast<unsigned char>(257 - this->m->length);
131 131 this->getNext()->write(&ch, 1);
132 132 this->getNext()->write(&this->m->buf[0], 1);
133 133 } else if (this->m->length > 0) {
134   - unsigned char ch = static_cast<unsigned char>(this->m->length - 1);
  134 + auto ch = static_cast<unsigned char>(this->m->length - 1);
135 135 this->getNext()->write(&ch, 1);
136 136 this->getNext()->write(this->m->buf, this->m->length);
137 137 }
... ...
libqpdf/Pl_SHA2.cc
... ... @@ -2,7 +2,6 @@
2 2  
3 3 #include <qpdf/QPDFCryptoProvider.hh>
4 4 #include <qpdf/QUtil.hh>
5   -#include <cstdio>
6 5 #include <stdexcept>
7 6  
8 7 Pl_SHA2::Pl_SHA2(int bits, Pipeline* next) :
... ...
libqpdf/Pl_StdioFile.cc
... ... @@ -3,7 +3,7 @@
3 3 #include <qpdf/Pl_StdioFile.hh>
4 4  
5 5 #include <qpdf/QUtil.hh>
6   -#include <errno.h>
  6 +#include <cerrno>
7 7 #include <stdexcept>
8 8  
9 9 Pl_StdioFile::Members::Members(FILE* f) :
... ...
libqpdf/Pl_String.cc
1 1 #include <qpdf/Pl_String.hh>
2 2  
3   -#include <qpdf/QUtil.hh>
4   -#include <errno.h>
5 3 #include <stdexcept>
6 4  
7 5 Pl_String::Members::Members(std::string& s) :
... ...
libqpdf/Pl_TIFFPredictor.cc
... ... @@ -5,9 +5,9 @@
5 5 #include <qpdf/QTC.hh>
6 6 #include <qpdf/QUtil.hh>
7 7  
8   -#include <limits.h>
  8 +#include <climits>
9 9 #include <stdexcept>
10   -#include <string.h>
  10 +#include <cstring>
11 11 #include <vector>
12 12  
13 13 Pl_TIFFPredictor::Pl_TIFFPredictor(
... ...
libqpdf/QPDF.cc
... ... @@ -9,8 +9,8 @@
9 9 #include <memory.h>
10 10 #include <regex>
11 11 #include <sstream>
12   -#include <stdlib.h>
13   -#include <string.h>
  12 +#include <cstdlib>
  13 +#include <cstring>
14 14 #include <vector>
15 15  
16 16 #include <qpdf/BufferInputSource.hh>
... ... @@ -60,42 +60,42 @@ namespace
60 60 class InvalidInputSource: public InputSource
61 61 {
62 62 public:
63   - virtual ~InvalidInputSource() = default;
64   - virtual qpdf_offset_t
  63 + ~InvalidInputSource() override = default;
  64 + qpdf_offset_t
65 65 findAndSkipNextEOL() override
66 66 {
67 67 throwException();
68 68 return 0;
69 69 }
70   - virtual std::string const&
  70 + std::string const&
71 71 getName() const override
72 72 {
73 73 static std::string name("closed input source");
74 74 return name;
75 75 }
76   - virtual qpdf_offset_t
  76 + qpdf_offset_t
77 77 tell() override
78 78 {
79 79 throwException();
80 80 return 0;
81 81 }
82   - virtual void
  82 + void
83 83 seek(qpdf_offset_t offset, int whence) override
84 84 {
85 85 throwException();
86 86 }
87   - virtual void
  87 + void
88 88 rewind() override
89 89 {
90 90 throwException();
91 91 }
92   - virtual size_t
  92 + size_t
93 93 read(char* buffer, size_t length) override
94 94 {
95 95 throwException();
96 96 return 0;
97 97 }
98   - virtual void
  98 + void
99 99 unreadCh(char ch) override
100 100 {
101 101 throwException();
... ... @@ -264,7 +264,7 @@ QPDF::create()
264 264 void
265 265 QPDF::processFile(char const* filename, char const* password)
266 266 {
267   - FileInputSource* fi = new FileInputSource(filename);
  267 + auto* fi = new FileInputSource(filename);
268 268 processInputSource(std::shared_ptr<InputSource>(fi), password);
269 269 }
270 270  
... ... @@ -272,7 +272,7 @@ void
272 272 QPDF::processFile(
273 273 char const* description, FILE* filep, bool close_file, char const* password)
274 274 {
275   - FileInputSource* fi = new FileInputSource(description, filep, close_file);
  275 + auto* fi = new FileInputSource(description, filep, close_file);
276 276 processInputSource(std::shared_ptr<InputSource>(fi), password);
277 277 }
278 278  
... ... @@ -2537,7 +2537,7 @@ QPDF::getCompressibleObjGens()
2537 2537 if (obj.isStream()) {
2538 2538 QPDFObjectHandle dict = obj.getDict();
2539 2539 std::set<std::string> keys = dict.getKeys();
2540   - for (std::set<std::string>::reverse_iterator iter = keys.rbegin();
  2540 + for (auto iter = keys.rbegin();
2541 2541 iter != keys.rend();
2542 2542 ++iter) {
2543 2543 std::string const& key = *iter;
... ... @@ -2553,7 +2553,7 @@ QPDF::getCompressibleObjGens()
2553 2553 }
2554 2554 } else if (obj.isDictionary()) {
2555 2555 std::set<std::string> keys = obj.getKeys();
2556   - for (std::set<std::string>::reverse_iterator iter = keys.rbegin();
  2556 + for (auto iter = keys.rbegin();
2557 2557 iter != keys.rend();
2558 2558 ++iter) {
2559 2559 queue.push_front(obj.getKey(*iter));
... ...
libqpdf/QPDFAnnotationObjectHelper.cc
... ... @@ -2,7 +2,6 @@
2 2  
3 3 #include <qpdf/QPDF.hh>
4 4 #include <qpdf/QPDFMatrix.hh>
5   -#include <qpdf/QPDFNameTreeObjectHelper.hh>
6 5 #include <qpdf/QTC.hh>
7 6 #include <qpdf/QUtil.hh>
8 7  
... ...
libqpdf/QPDFExc.cc
1 1 #include <qpdf/QPDFExc.hh>
2 2  
3   -#include <qpdf/QUtil.hh>
4   -
5 3 QPDFExc::QPDFExc(
6 4 qpdf_error_code_e error_code,
7 5 std::string const& filename,
... ...
libqpdf/QPDFFormFieldObjectHelper.cc
... ... @@ -6,7 +6,7 @@
6 6 #include <qpdf/QPDFAnnotationObjectHelper.hh>
7 7 #include <qpdf/QTC.hh>
8 8 #include <qpdf/QUtil.hh>
9   -#include <stdlib.h>
  9 +#include <cstdlib>
10 10  
11 11 QPDFFormFieldObjectHelper::QPDFFormFieldObjectHelper(QPDFObjectHandle oh) :
12 12 QPDFObjectHelper(oh),
... ... @@ -515,9 +515,9 @@ namespace
515 515 std::vector<std::string> const& opt,
516 516 double tf,
517 517 QPDFObjectHandle::Rectangle const& bbox);
518   - virtual ~ValueSetter() = default;
519   - virtual void handleToken(QPDFTokenizer::Token const&);
520   - virtual void handleEOF();
  518 + ~ValueSetter() override = default;
  519 + void handleToken(QPDFTokenizer::Token const&) override;
  520 + void handleEOF() override;
521 521 void writeAppearance();
522 522  
523 523 private:
... ... @@ -611,7 +611,7 @@ ValueSetter::writeAppearance()
611 611 // Write one or more lines, centered vertically, possibly with
612 612 // one row highlighted.
613 613  
614   - size_t max_rows = static_cast<size_t>((bbox.ury - bbox.lly) / tfh);
  614 + auto max_rows = static_cast<size_t>((bbox.ury - bbox.lly) / tfh);
615 615 bool highlight = false;
616 616 size_t highlight_idx = 0;
617 617  
... ... @@ -706,10 +706,10 @@ namespace
706 706 {
707 707 public:
708 708 TfFinder();
709   - virtual ~TfFinder()
  709 + ~TfFinder() override
710 710 {
711 711 }
712   - virtual void handleToken(QPDFTokenizer::Token const&);
  712 + void handleToken(QPDFTokenizer::Token const&) override;
713 713 double getTf();
714 714 std::string getFontName();
715 715 std::string getDA();
... ...
libqpdf/QPDFJob.cc
... ... @@ -3,7 +3,7 @@
3 3 #include <cstdio>
4 4 #include <cstdlib>
5 5 #include <cstring>
6   -#include <ctype.h>
  6 +#include <cctype>
7 7 #include <fcntl.h>
8 8 #include <iostream>
9 9 #include <memory>
... ... @@ -48,8 +48,8 @@ namespace
48 48 size_t oi_min_height,
49 49 size_t oi_min_area,
50 50 QPDFObjectHandle& image);
51   - virtual ~ImageOptimizer() = default;
52   - virtual void provideStreamData(QPDFObjGen const&, Pipeline* pipeline);
  51 + ~ImageOptimizer() override = default;
  52 + void provideStreamData(QPDFObjGen const&, Pipeline* pipeline) override;
53 53 std::shared_ptr<Pipeline>
54 54 makePipeline(std::string const& description, Pipeline* next);
55 55 bool evaluate(std::string const& description);
... ... @@ -65,13 +65,13 @@ namespace
65 65 class DiscardContents: public QPDFObjectHandle::ParserCallbacks
66 66 {
67 67 public:
68   - virtual ~DiscardContents() = default;
69   - virtual void
70   - handleObject(QPDFObjectHandle)
  68 + ~DiscardContents() override = default;
  69 + void
  70 + handleObject(QPDFObjectHandle) override
71 71 {
72 72 }
73   - virtual void
74   - handleEOF()
  73 + void
  74 + handleEOF() override
75 75 {
76 76 }
77 77 };
... ... @@ -98,8 +98,8 @@ namespace
98 98 filename(filename)
99 99 {
100 100 }
101   - virtual ~ProgressReporter() = default;
102   - virtual void reportProgress(int);
  101 + ~ProgressReporter() override = default;
  102 + void reportProgress(int) override;
103 103  
104 104 private:
105 105 Pipeline& p;
... ...
libqpdf/QPDFJob_argv.cc
... ... @@ -3,12 +3,12 @@
3 3 // See "HOW TO ADD A COMMAND-LINE ARGUMENT" in README-maintainer.
4 4  
5 5 #include <cstdio>
6   -#include <ctype.h>
  6 +#include <cctype>
7 7 #include <iostream>
8 8 #include <memory>
9 9 #include <sstream>
10   -#include <stdlib.h>
11   -#include <string.h>
  10 +#include <cstdlib>
  11 +#include <cstring>
12 12  
13 13 #include <qpdf/QIntC.hh>
14 14 #include <qpdf/QPDFArgParser.hh>
... ...
libqpdf/QPDFLogger.cc
... ... @@ -17,14 +17,14 @@ namespace
17 17 {
18 18 }
19 19  
20   - virtual void
  20 + void
21 21 write(unsigned char const* data, size_t len) override
22 22 {
23 23 this->used = true;
24 24 getNext()->write(data, len);
25 25 }
26 26  
27   - virtual void
  27 + void
28 28 finish() override
29 29 {
30 30 getNext()->finish();
... ...
libqpdf/QPDFNameTreeObjectHelper.cc
... ... @@ -7,18 +7,18 @@ namespace
7 7 class NameTreeDetails: public NNTreeDetails
8 8 {
9 9 public:
10   - virtual std::string const&
  10 + std::string const&
11 11 itemsKey() const override
12 12 {
13 13 static std::string k("/Names");
14 14 return k;
15 15 }
16   - virtual bool
  16 + bool
17 17 keyValid(QPDFObjectHandle oh) const override
18 18 {
19 19 return oh.isString();
20 20 }
21   - virtual int
  21 + int
22 22 compareKeys(QPDFObjectHandle a, QPDFObjectHandle b) const override
23 23 {
24 24 if (!(keyValid(a) && keyValid(b))) {
... ...
libqpdf/QPDFNumberTreeObjectHelper.cc
... ... @@ -8,18 +8,18 @@ namespace
8 8 class NumberTreeDetails: public NNTreeDetails
9 9 {
10 10 public:
11   - virtual std::string const&
  11 + std::string const&
12 12 itemsKey() const override
13 13 {
14 14 static std::string k("/Nums");
15 15 return k;
16 16 }
17   - virtual bool
  17 + bool
18 18 keyValid(QPDFObjectHandle oh) const override
19 19 {
20 20 return oh.isInteger();
21 21 }
22   - virtual int
  22 + int
23 23 compareKeys(QPDFObjectHandle a, QPDFObjectHandle b) const override
24 24 {
25 25 if (!(keyValid(a) && keyValid(b))) {
... ...
libqpdf/QPDFObjectHandle.cc
... ... @@ -30,10 +30,10 @@
30 30  
31 31 #include <algorithm>
32 32 #include <cstring>
33   -#include <ctype.h>
34   -#include <limits.h>
  33 +#include <cctype>
  34 +#include <climits>
35 35 #include <stdexcept>
36   -#include <stdlib.h>
  36 +#include <cstdlib>
37 37  
38 38 using namespace std::literals;
39 39  
... ... @@ -111,8 +111,8 @@ namespace
111 111 old_contents(old_contents)
112 112 {
113 113 }
114   - virtual ~CoalesceProvider() = default;
115   - virtual void provideStreamData(QPDFObjGen const&, Pipeline* pipeline);
  114 + ~CoalesceProvider() override = default;
  115 + void provideStreamData(QPDFObjGen const&, Pipeline* pipeline) override;
116 116  
117 117 private:
118 118 QPDFObjectHandle containing_page;
... ... @@ -200,9 +200,9 @@ namespace
200 200 {
201 201 public:
202 202 LastChar(Pipeline* next);
203   - virtual ~LastChar() = default;
204   - virtual void write(unsigned char const* data, size_t len);
205   - virtual void finish();
  203 + ~LastChar() override = default;
  204 + void write(unsigned char const* data, size_t len) override;
  205 + void finish() override;
206 206 unsigned char getLastChar();
207 207  
208 208 private:
... ... @@ -1446,13 +1446,13 @@ namespace
1446 1446 {
1447 1447 }
1448 1448  
1449   - virtual void
  1449 + void
1450 1450 provideStreamData(QPDFObjGen const&, Pipeline* pipeline) override
1451 1451 {
1452 1452 p1(pipeline);
1453 1453 }
1454 1454  
1455   - virtual bool
  1455 + bool
1456 1456 provideStreamData(
1457 1457 QPDFObjGen const&,
1458 1458 Pipeline* pipeline,
... ...
libqpdf/QPDFParser.cc
... ... @@ -16,7 +16,6 @@
16 16 #include <qpdf/QPDF_Reserved.hh>
17 17 #include <qpdf/QPDF_Stream.hh>
18 18 #include <qpdf/QPDF_String.hh>
19   -#include <qpdf/QPDF_Unresolved.hh>
20 19 #include <qpdf/QTC.hh>
21 20 #include <qpdf/QUtil.hh>
22 21  
... ...
libqpdf/QPDFSystemError.cc
1 1 #include <qpdf/QPDFSystemError.hh>
2 2  
3   -#include <qpdf/QUtil.hh>
4   -#include <string.h>
  3 +#include <cstring>
5 4  
6 5 QPDFSystemError::QPDFSystemError(
7 6 std::string const& description, int system_errno) :
... ...
libqpdf/QPDFTokenizer.cc
... ... @@ -11,8 +11,8 @@
11 11 #include <qpdf/QUtil.hh>
12 12  
13 13 #include <stdexcept>
14   -#include <stdlib.h>
15   -#include <string.h>
  14 +#include <cstdlib>
  15 +#include <cstring>
16 16  
17 17 static inline bool
18 18 is_delimiter(char ch)
... ... @@ -35,8 +35,8 @@ namespace
35 35 str(str)
36 36 {
37 37 }
38   - virtual ~QPDFWordTokenFinder() = default;
39   - virtual bool check();
  38 + ~QPDFWordTokenFinder() override = default;
  39 + bool check() override;
40 40  
41 41 private:
42 42 std::shared_ptr<InputSource> is;
... ...
libqpdf/QPDFWriter.cc
... ... @@ -24,7 +24,7 @@
24 24  
25 25 #include <algorithm>
26 26 #include <stdexcept>
27   -#include <stdlib.h>
  27 +#include <cstdlib>
28 28  
29 29 QPDFWriter::ProgressReporter::~ProgressReporter()
30 30 {
... ... @@ -997,7 +997,7 @@ void
997 997 QPDFWriter::activatePipelineStack(PipelinePopper& pp)
998 998 {
999 999 std::string stack_id("stack " + std::to_string(this->m->next_stack_id));
1000   - Pl_Count* c =
  1000 + auto* c =
1001 1001 new Pl_Count(stack_id.c_str(), this->m->pipeline_stack.back());
1002 1002 ++this->m->next_stack_id;
1003 1003 this->m->pipeline_stack.push_back(c);
... ... @@ -1030,7 +1030,7 @@ QPDFWriter::PipelinePopper::~PipelinePopper()
1030 1030 qw->m->md5_pipeline = nullptr;
1031 1031 }
1032 1032 qw->m->pipeline_stack.pop_back();
1033   - Pl_Buffer* buf = dynamic_cast<Pl_Buffer*>(p);
  1033 + auto* buf = dynamic_cast<Pl_Buffer*>(p);
1034 1034 if (bp && buf) {
1035 1035 *bp = buf->getBufferSharedPointer();
1036 1036 }
... ...
libqpdf/QPDFXRefEntry.cc
... ... @@ -2,7 +2,6 @@
2 2  
3 3 #include <qpdf/QIntC.hh>
4 4 #include <qpdf/QPDFExc.hh>
5   -#include <qpdf/QUtil.hh>
6 5  
7 6 QPDFXRefEntry::QPDFXRefEntry()
8 7 {
... ...
libqpdf/QPDF_Array.cc
... ... @@ -83,7 +83,7 @@ QPDF_Array::copy(bool shallow)
83 83 return do_create(new QPDF_Array(*this));
84 84 } else {
85 85 if (sparse) {
86   - QPDF_Array* result = new QPDF_Array();
  86 + auto* result = new QPDF_Array();
87 87 result->sp_size = sp_size;
88 88 for (auto const& element: sp_elements) {
89 89 auto const& obj = element.second;
... ...
libqpdf/QPDF_Name.cc
1 1 #include <qpdf/QPDF_Name.hh>
2 2  
3 3 #include <qpdf/QUtil.hh>
4   -#include <stdio.h>
5   -#include <string.h>
6 4  
7 5 QPDF_Name::QPDF_Name(std::string const& name) :
8 6 QPDFValue(::ot_name, "name"),
... ...
libqpdf/QPDF_Stream.cc
... ... @@ -27,10 +27,10 @@ namespace
27 27 {
28 28 public:
29 29 SF_Crypt() = default;
30   - virtual ~SF_Crypt() = default;
  30 + ~SF_Crypt() override = default;
31 31  
32   - virtual bool
33   - setDecodeParms(QPDFObjectHandle decode_parms)
  32 + bool
  33 + setDecodeParms(QPDFObjectHandle decode_parms) override
34 34 {
35 35 if (decode_parms.isNull()) {
36 36 return true;
... ... @@ -49,8 +49,8 @@ namespace
49 49 return filterable;
50 50 }
51 51  
52   - virtual Pipeline*
53   - getDecodePipeline(Pipeline*)
  52 + Pipeline*
  53 + getDecodePipeline(Pipeline*) override
54 54 {
55 55 // Not used -- handled by pipeStreamData
56 56 return nullptr;
... ... @@ -557,7 +557,7 @@ QPDF_Stream::pipeStreamData(
557 557 if (decode_pipeline) {
558 558 pipeline = decode_pipeline;
559 559 }
560   - Pl_Flate* flate = dynamic_cast<Pl_Flate*>(pipeline);
  560 + auto* flate = dynamic_cast<Pl_Flate*>(pipeline);
561 561 if (flate != nullptr) {
562 562 flate->setWarnCallback(
563 563 [this](char const* msg, int code) { warn(msg); });
... ...
libqpdf/QPDF_String.cc
... ... @@ -5,7 +5,6 @@
5 5 // DO NOT USE ctype -- it is locale dependent for some things, and
6 6 // it's not worth the risk of including it in case it may accidentally
7 7 // be used.
8   -#include <string.h>
9 8  
10 9 static bool
11 10 is_iso_latin1_printable(char ch)
... ...
libqpdf/QPDF_encryption.cc
... ... @@ -17,7 +17,7 @@
17 17 #include <qpdf/RC4.hh>
18 18  
19 19 #include <algorithm>
20   -#include <string.h>
  20 +#include <cstring>
21 21  
22 22 static unsigned char const padding_string[] = {
23 23 0x28, 0xbf, 0x4e, 0x5e, 0x4e, 0x75, 0x8a, 0x41, 0x64, 0x00, 0x4e,
... ...
libqpdf/QPDF_json.cc
... ... @@ -242,13 +242,13 @@ class QPDF::JSONReactor: public JSON::Reactor
242 242 }
243 243 }
244 244 virtual ~JSONReactor() = default;
245   - virtual void dictionaryStart() override;
246   - virtual void arrayStart() override;
247   - virtual void containerEnd(JSON const& value) override;
248   - virtual void topLevelScalar() override;
249   - virtual bool
  245 + void dictionaryStart() override;
  246 + void arrayStart() override;
  247 + void containerEnd(JSON const& value) override;
  248 + void topLevelScalar() override;
  249 + bool
250 250 dictionaryItem(std::string const& key, JSON const& value) override;
251   - virtual bool arrayItem(JSON const& value) override;
  251 + bool arrayItem(JSON const& value) override;
252 252  
253 253 bool anyErrors() const;
254 254  
... ...
libqpdf/QPDF_linearization.cc
... ... @@ -13,9 +13,8 @@
13 13 #include <qpdf/QUtil.hh>
14 14  
15 15 #include <algorithm>
16   -#include <iostream>
17   -#include <math.h>
18   -#include <string.h>
  16 +#include <cmath>
  17 +#include <cstring>
19 18  
20 19 template <class T, class int_type>
21 20 static void
... ...
libqpdf/QPDF_optimization.cc
... ... @@ -115,7 +115,7 @@ QPDF::optimize(
115 115 }
116 116  
117 117 ObjUser root_ou = ObjUser(ObjUser::ou_root);
118   - QPDFObjGen root_og = QPDFObjGen(root.getObjGen());
  118 + auto root_og = QPDFObjGen(root.getObjGen());
119 119 this->m->obj_user_to_objects[root_ou].insert(root_og);
120 120 this->m->object_to_obj_users[root_og].insert(root_ou);
121 121  
... ...
libqpdf/QTC.cc
... ... @@ -3,7 +3,7 @@
3 3 #include <qpdf/QUtil.hh>
4 4 #include <map>
5 5 #include <set>
6   -#include <stdio.h>
  6 +#include <cstdio>
7 7  
8 8 static bool
9 9 tc_active(char const* const scope)
... ...
libqpdf/QUtil.cc
... ... @@ -9,9 +9,8 @@
9 9 #include <qpdf/QPDFSystemError.hh>
10 10 #include <qpdf/QTC.hh>
11 11  
12   -#include <cmath>
13   -#include <ctype.h>
14   -#include <errno.h>
  12 +#include <cctype>
  13 +#include <cerrno>
15 14 #include <fcntl.h>
16 15 #include <fstream>
17 16 #include <iomanip>
... ... @@ -22,9 +21,9 @@
22 21 #include <set>
23 22 #include <sstream>
24 23 #include <stdexcept>
25   -#include <stdio.h>
26   -#include <stdlib.h>
27   -#include <string.h>
  24 +#include <cstdio>
  25 +#include <cstdlib>
  26 +#include <cstring>
28 27 #ifndef QPDF_NO_WCHAR_T
29 28 # include <cwchar>
30 29 #endif
... ... @@ -837,8 +836,8 @@ char*
837 836 QUtil::getWhoami(char* argv0)
838 837 {
839 838 char* whoami = nullptr;
840   - if (((whoami = strrchr(argv0, '/')) == NULL) &&
841   - ((whoami = strrchr(argv0, '\\')) == NULL)) {
  839 + if (((whoami = strrchr(argv0, '/')) == nullptr) &&
  840 + ((whoami = strrchr(argv0, '\\')) == nullptr)) {
842 841 whoami = argv0;
843 842 } else {
844 843 ++whoami;
... ...
libqpdf/RC4.cc
... ... @@ -2,7 +2,6 @@
2 2  
3 3 #include <qpdf/QPDFCryptoProvider.hh>
4 4  
5   -#include <string.h>
6 5  
7 6 RC4::RC4(unsigned char const* key_data, int key_len) :
8 7 crypto(QPDFCryptoProvider::getImpl())
... ...
libqpdf/qpdf-c.cc
... ... @@ -15,7 +15,6 @@
15 15 #include <qpdf/qpdf-c_impl.hh>
16 16 #include <qpdf/qpdflogger-c_impl.hh>
17 17  
18   -#include <cstring>
19 18 #include <functional>
20 19 #include <list>
21 20 #include <stdexcept>
... ... @@ -107,7 +106,7 @@ qpdf_data
107 106 qpdf_init()
108 107 {
109 108 QTC::TC("qpdf", "qpdf-c called qpdf_init");
110   - qpdf_data qpdf = new _qpdf_data();
  109 + auto qpdf = new _qpdf_data();
111 110 qpdf->qpdf = QPDF::create();
112 111 return qpdf;
113 112 }
... ...
libqpdf/qpdf/BitStream.hh
... ... @@ -3,7 +3,7 @@
3 3 #ifndef BITSTREAM_HH
4 4 #define BITSTREAM_HH
5 5  
6   -#include <stddef.h>
  6 +#include <cstddef>
7 7  
8 8 class BitStream
9 9 {
... ...
libqpdf/qpdf/BitWriter.hh
... ... @@ -3,7 +3,7 @@
3 3 #ifndef BITWRITER_HH
4 4 #define BITWRITER_HH
5 5  
6   -#include <stddef.h>
  6 +#include <cstddef>
7 7  
8 8 class Pipeline;
9 9  
... ...
libqpdf/qpdf/ContentNormalizer.hh
... ... @@ -7,8 +7,8 @@ class ContentNormalizer: public QPDFObjectHandle::TokenFilter
7 7 {
8 8 public:
9 9 ContentNormalizer();
10   - virtual ~ContentNormalizer() = default;
11   - virtual void handleToken(QPDFTokenizer::Token const&);
  10 + ~ContentNormalizer() override = default;
  11 + void handleToken(QPDFTokenizer::Token const&) override;
12 12  
13 13 bool anyBadTokens() const;
14 14 bool lastTokenWasBad() const;
... ...
libqpdf/qpdf/CryptoRandomDataProvider.hh
... ... @@ -7,8 +7,8 @@ class CryptoRandomDataProvider: public RandomDataProvider
7 7 {
8 8 public:
9 9 CryptoRandomDataProvider() = default;
10   - virtual ~CryptoRandomDataProvider() = default;
11   - virtual void provideRandomData(unsigned char* data, size_t len);
  10 + ~CryptoRandomDataProvider() override = default;
  11 + void provideRandomData(unsigned char* data, size_t len) override;
12 12 static RandomDataProvider* getInstance();
13 13 };
14 14  
... ...
libqpdf/qpdf/InsecureRandomDataProvider.hh
... ... @@ -7,8 +7,8 @@ class InsecureRandomDataProvider: public RandomDataProvider
7 7 {
8 8 public:
9 9 InsecureRandomDataProvider();
10   - virtual ~InsecureRandomDataProvider() = default;
11   - virtual void provideRandomData(unsigned char* data, size_t len);
  10 + ~InsecureRandomDataProvider() override = default;
  11 + void provideRandomData(unsigned char* data, size_t len) override;
12 12 static RandomDataProvider* getInstance();
13 13  
14 14 private:
... ...
libqpdf/qpdf/OffsetInputSource.hh
... ... @@ -11,15 +11,15 @@ class OffsetInputSource: public InputSource
11 11 public:
12 12 OffsetInputSource(
13 13 std::shared_ptr<InputSource>, qpdf_offset_t global_offset);
14   - virtual ~OffsetInputSource() = default;
  14 + ~OffsetInputSource() override = default;
15 15  
16   - virtual qpdf_offset_t findAndSkipNextEOL();
17   - virtual std::string const& getName() const;
18   - virtual qpdf_offset_t tell();
19   - virtual void seek(qpdf_offset_t offset, int whence);
20   - virtual void rewind();
21   - virtual size_t read(char* buffer, size_t length);
22   - virtual void unreadCh(char ch);
  16 + qpdf_offset_t findAndSkipNextEOL() override;
  17 + std::string const& getName() const override;
  18 + qpdf_offset_t tell() override;
  19 + void seek(qpdf_offset_t offset, int whence) override;
  20 + void rewind() override;
  21 + size_t read(char* buffer, size_t length) override;
  22 + void unreadCh(char ch) override;
23 23  
24 24 private:
25 25 std::shared_ptr<InputSource> proxied;
... ...
libqpdf/qpdf/Pl_AES_PDF.hh
... ... @@ -18,10 +18,10 @@ class Pl_AES_PDF: public Pipeline
18 18 bool encrypt,
19 19 unsigned char const* key,
20 20 size_t key_bytes);
21   - virtual ~Pl_AES_PDF() = default;
  21 + ~Pl_AES_PDF() override = default;
22 22  
23   - virtual void write(unsigned char const* data, size_t len);
24   - virtual void finish();
  23 + void write(unsigned char const* data, size_t len) override;
  24 + void finish() override;
25 25  
26 26 // Use zero initialization vector; needed for AESV3
27 27 void useZeroIV();
... ...
libqpdf/qpdf/Pl_ASCII85Decoder.hh
... ... @@ -7,9 +7,9 @@ class Pl_ASCII85Decoder: public Pipeline
7 7 {
8 8 public:
9 9 Pl_ASCII85Decoder(char const* identifier, Pipeline* next);
10   - virtual ~Pl_ASCII85Decoder() = default;
11   - virtual void write(unsigned char const* buf, size_t len);
12   - virtual void finish();
  10 + ~Pl_ASCII85Decoder() override = default;
  11 + void write(unsigned char const* buf, size_t len) override;
  12 + void finish() override;
13 13  
14 14 private:
15 15 void flush();
... ...
libqpdf/qpdf/Pl_ASCIIHexDecoder.hh
... ... @@ -7,9 +7,9 @@ class Pl_ASCIIHexDecoder: public Pipeline
7 7 {
8 8 public:
9 9 Pl_ASCIIHexDecoder(char const* identifier, Pipeline* next);
10   - virtual ~Pl_ASCIIHexDecoder() = default;
11   - virtual void write(unsigned char const* buf, size_t len);
12   - virtual void finish();
  10 + ~Pl_ASCIIHexDecoder() override = default;
  11 + void write(unsigned char const* buf, size_t len) override;
  12 + void finish() override;
13 13  
14 14 private:
15 15 void flush();
... ...
libqpdf/qpdf/Pl_Base64.hh
... ... @@ -8,9 +8,9 @@ class Pl_Base64: public Pipeline
8 8 public:
9 9 enum action_e { a_encode, a_decode };
10 10 Pl_Base64(char const* identifier, Pipeline* next, action_e);
11   - virtual ~Pl_Base64() = default;
12   - virtual void write(unsigned char const* buf, size_t len) override;
13   - virtual void finish() override;
  11 + ~Pl_Base64() override = default;
  12 + void write(unsigned char const* buf, size_t len) override;
  13 + void finish() override;
14 14  
15 15 private:
16 16 void decode(unsigned char const* buf, size_t len);
... ...
libqpdf/qpdf/Pl_PNGFilter.hh
... ... @@ -22,10 +22,10 @@ class Pl_PNGFilter: public Pipeline
22 22 unsigned int columns,
23 23 unsigned int samples_per_pixel = 1,
24 24 unsigned int bits_per_sample = 8);
25   - virtual ~Pl_PNGFilter() = default;
  25 + ~Pl_PNGFilter() override = default;
26 26  
27   - virtual void write(unsigned char const* data, size_t len);
28   - virtual void finish();
  27 + void write(unsigned char const* data, size_t len) override;
  28 + void finish() override;
29 29  
30 30 private:
31 31 void decodeSub();
... ...
libqpdf/qpdf/Pl_RC4.hh
... ... @@ -17,10 +17,10 @@ class Pl_RC4: public Pipeline
17 17 unsigned char const* key_data,
18 18 int key_len = -1,
19 19 size_t out_bufsize = def_bufsize);
20   - virtual ~Pl_RC4() = default;
  20 + ~Pl_RC4() override = default;
21 21  
22   - virtual void write(unsigned char const* data, size_t len);
23   - virtual void finish();
  22 + void write(unsigned char const* data, size_t len) override;
  23 + void finish() override;
24 24  
25 25 private:
26 26 std::shared_ptr<unsigned char> outbuf;
... ...
libqpdf/qpdf/Pl_SHA2.hh
... ... @@ -20,10 +20,10 @@
20 20 class Pl_SHA2: public Pipeline
21 21 {
22 22 public:
23   - Pl_SHA2(int bits = 0, Pipeline* next = 0);
24   - virtual ~Pl_SHA2() = default;
25   - virtual void write(unsigned char const*, size_t);
26   - virtual void finish();
  23 + Pl_SHA2(int bits = 0, Pipeline* next = nullptr);
  24 + ~Pl_SHA2() override = default;
  25 + void write(unsigned char const*, size_t) override;
  26 + void finish() override;
27 27 void resetBits(int bits);
28 28 std::string getHexDigest();
29 29 std::string getRawDigest();
... ...
libqpdf/qpdf/Pl_TIFFPredictor.hh
... ... @@ -18,10 +18,10 @@ class Pl_TIFFPredictor: public Pipeline
18 18 unsigned int columns,
19 19 unsigned int samples_per_pixel = 1,
20 20 unsigned int bits_per_sample = 8);
21   - virtual ~Pl_TIFFPredictor() = default;
  21 + ~Pl_TIFFPredictor() override = default;
22 22  
23   - virtual void write(unsigned char const* data, size_t len);
24   - virtual void finish();
  23 + void write(unsigned char const* data, size_t len) override;
  24 + void finish() override;
25 25  
26 26 private:
27 27 void processRow();
... ...