Commit d740c6ccced02147f84a39d5e5f0984d12bac6cb
1 parent
5f02c7c9
Rerun format_code (after merging clang-tidy PR)
Showing
65 changed files
with
91 additions
and
105 deletions
examples/pdf-bookmarks.cc
| @@ -4,9 +4,9 @@ | @@ -4,9 +4,9 @@ | ||
| 4 | #include <qpdf/QPDFPageDocumentHelper.hh> | 4 | #include <qpdf/QPDFPageDocumentHelper.hh> |
| 5 | #include <qpdf/QTC.hh> | 5 | #include <qpdf/QTC.hh> |
| 6 | #include <qpdf/QUtil.hh> | 6 | #include <qpdf/QUtil.hh> |
| 7 | -#include <iostream> | ||
| 8 | #include <cstdlib> | 7 | #include <cstdlib> |
| 9 | #include <cstring> | 8 | #include <cstring> |
| 9 | +#include <iostream> | ||
| 10 | 10 | ||
| 11 | // This program demonstrates extraction of bookmarks using the qpdf | 11 | // This program demonstrates extraction of bookmarks using the qpdf |
| 12 | // outlines API. Note that all the information shown by this program | 12 | // outlines API. Note that all the information shown by this program |
examples/pdf-count-strings.cc
| @@ -4,8 +4,8 @@ | @@ -4,8 +4,8 @@ | ||
| 4 | // that uses QPDFObjectHandle::TokenFilter with addContentTokenFilter. | 4 | // that uses QPDFObjectHandle::TokenFilter with addContentTokenFilter. |
| 5 | // | 5 | // |
| 6 | 6 | ||
| 7 | -#include <iostream> | ||
| 8 | #include <cstdlib> | 7 | #include <cstdlib> |
| 8 | +#include <iostream> | ||
| 9 | 9 | ||
| 10 | #include <qpdf/Pl_StdioFile.hh> | 10 | #include <qpdf/Pl_StdioFile.hh> |
| 11 | #include <qpdf/QPDF.hh> | 11 | #include <qpdf/QPDF.hh> |
examples/pdf-create.cc
| @@ -14,9 +14,9 @@ | @@ -14,9 +14,9 @@ | ||
| 14 | #include <qpdf/QPDFPageDocumentHelper.hh> | 14 | #include <qpdf/QPDFPageDocumentHelper.hh> |
| 15 | #include <qpdf/QPDFWriter.hh> | 15 | #include <qpdf/QPDFWriter.hh> |
| 16 | #include <qpdf/QUtil.hh> | 16 | #include <qpdf/QUtil.hh> |
| 17 | +#include <cstdlib> | ||
| 17 | #include <iostream> | 18 | #include <iostream> |
| 18 | #include <memory> | 19 | #include <memory> |
| 19 | -#include <cstdlib> | ||
| 20 | 20 | ||
| 21 | static char const* whoami = nullptr; | 21 | static char const* whoami = nullptr; |
| 22 | 22 |
examples/pdf-custom-filter.cc
| @@ -200,8 +200,7 @@ class StreamReplacer: public QPDFObjectHandle::StreamDataProvider | @@ -200,8 +200,7 @@ class StreamReplacer: public QPDFObjectHandle::StreamDataProvider | ||
| 200 | public: | 200 | public: |
| 201 | StreamReplacer(QPDF* pdf); | 201 | StreamReplacer(QPDF* pdf); |
| 202 | ~StreamReplacer() override = default; | 202 | ~StreamReplacer() override = default; |
| 203 | - void | ||
| 204 | - provideStreamData(QPDFObjGen const& og, Pipeline* pipeline) override; | 203 | + void provideStreamData(QPDFObjGen const& og, Pipeline* pipeline) override; |
| 205 | 204 | ||
| 206 | void registerStream( | 205 | void registerStream( |
| 207 | QPDFObjectHandle stream, | 206 | QPDFObjectHandle stream, |
examples/pdf-double-page-size.cc
| @@ -4,9 +4,9 @@ | @@ -4,9 +4,9 @@ | ||
| 4 | #include <qpdf/QPDFPageObjectHelper.hh> | 4 | #include <qpdf/QPDFPageObjectHelper.hh> |
| 5 | #include <qpdf/QPDFWriter.hh> | 5 | #include <qpdf/QPDFWriter.hh> |
| 6 | #include <qpdf/QUtil.hh> | 6 | #include <qpdf/QUtil.hh> |
| 7 | -#include <iostream> | ||
| 8 | #include <cstdlib> | 7 | #include <cstdlib> |
| 9 | #include <cstring> | 8 | #include <cstring> |
| 9 | +#include <iostream> | ||
| 10 | 10 | ||
| 11 | static char const* whoami = nullptr; | 11 | static char const* whoami = nullptr; |
| 12 | 12 |
examples/pdf-filter-tokens.cc
| @@ -6,9 +6,9 @@ | @@ -6,9 +6,9 @@ | ||
| 6 | // | 6 | // |
| 7 | 7 | ||
| 8 | #include <algorithm> | 8 | #include <algorithm> |
| 9 | +#include <cstdlib> | ||
| 9 | #include <deque> | 10 | #include <deque> |
| 10 | #include <iostream> | 11 | #include <iostream> |
| 11 | -#include <cstdlib> | ||
| 12 | 12 | ||
| 13 | #include <qpdf/QPDF.hh> | 13 | #include <qpdf/QPDF.hh> |
| 14 | #include <qpdf/QPDFObjectHandle.hh> | 14 | #include <qpdf/QPDFObjectHandle.hh> |
examples/pdf-invert-images.cc
| @@ -5,9 +5,9 @@ | @@ -5,9 +5,9 @@ | ||
| 5 | #include <qpdf/QPDFPageObjectHelper.hh> | 5 | #include <qpdf/QPDFPageObjectHelper.hh> |
| 6 | #include <qpdf/QPDFWriter.hh> | 6 | #include <qpdf/QPDFWriter.hh> |
| 7 | #include <qpdf/QUtil.hh> | 7 | #include <qpdf/QUtil.hh> |
| 8 | -#include <iostream> | ||
| 9 | #include <cstdlib> | 8 | #include <cstdlib> |
| 10 | #include <cstring> | 9 | #include <cstring> |
| 10 | +#include <iostream> | ||
| 11 | 11 | ||
| 12 | static char const* whoami = nullptr; | 12 | static char const* whoami = nullptr; |
| 13 | 13 | ||
| @@ -34,8 +34,7 @@ class ImageInverter: public QPDFObjectHandle::StreamDataProvider | @@ -34,8 +34,7 @@ class ImageInverter: public QPDFObjectHandle::StreamDataProvider | ||
| 34 | { | 34 | { |
| 35 | public: | 35 | public: |
| 36 | ~ImageInverter() override = default; | 36 | ~ImageInverter() override = default; |
| 37 | - void | ||
| 38 | - provideStreamData(QPDFObjGen const& og, Pipeline* pipeline) override; | 37 | + void provideStreamData(QPDFObjGen const& og, Pipeline* pipeline) override; |
| 39 | 38 | ||
| 40 | void registerImage( | 39 | void registerImage( |
| 41 | QPDFObjectHandle image, | 40 | QPDFObjectHandle image, |
examples/pdf-mod-info.cc
| @@ -5,10 +5,10 @@ | @@ -5,10 +5,10 @@ | ||
| 5 | #include <qpdf/QPDFWriter.hh> | 5 | #include <qpdf/QPDFWriter.hh> |
| 6 | #include <qpdf/QTC.hh> | 6 | #include <qpdf/QTC.hh> |
| 7 | #include <qpdf/QUtil.hh> | 7 | #include <qpdf/QUtil.hh> |
| 8 | -#include <iostream> | ||
| 9 | #include <cstdio> | 8 | #include <cstdio> |
| 10 | #include <cstdlib> | 9 | #include <cstdlib> |
| 11 | #include <cstring> | 10 | #include <cstring> |
| 11 | +#include <iostream> | ||
| 12 | 12 | ||
| 13 | static char const* version = "1.1"; | 13 | static char const* version = "1.1"; |
| 14 | static char const* whoami = nullptr; | 14 | static char const* whoami = nullptr; |
examples/pdf-npages.cc
examples/pdf-overlay-page.cc
| @@ -3,8 +3,8 @@ | @@ -3,8 +3,8 @@ | ||
| 3 | #include <qpdf/QPDFPageObjectHelper.hh> | 3 | #include <qpdf/QPDFPageObjectHelper.hh> |
| 4 | #include <qpdf/QPDFWriter.hh> | 4 | #include <qpdf/QPDFWriter.hh> |
| 5 | #include <qpdf/QUtil.hh> | 5 | #include <qpdf/QUtil.hh> |
| 6 | -#include <iostream> | ||
| 7 | #include <cstdlib> | 6 | #include <cstdlib> |
| 7 | +#include <iostream> | ||
| 8 | 8 | ||
| 9 | // This program demonstrates use of form XObjects to overlay a page | 9 | // This program demonstrates use of form XObjects to overlay a page |
| 10 | // from one file onto all pages of another file. The qpdf program's | 10 | // from one file onto all pages of another file. The qpdf program's |
examples/pdf-parse-content.cc
examples/pdf-set-form-values.cc
| @@ -3,8 +3,8 @@ | @@ -3,8 +3,8 @@ | ||
| 3 | #include <qpdf/QPDFPageDocumentHelper.hh> | 3 | #include <qpdf/QPDFPageDocumentHelper.hh> |
| 4 | #include <qpdf/QPDFWriter.hh> | 4 | #include <qpdf/QPDFWriter.hh> |
| 5 | #include <qpdf/QUtil.hh> | 5 | #include <qpdf/QUtil.hh> |
| 6 | -#include <iostream> | ||
| 7 | #include <cstdlib> | 6 | #include <cstdlib> |
| 7 | +#include <iostream> | ||
| 8 | 8 | ||
| 9 | static char const* whoami = nullptr; | 9 | static char const* whoami = nullptr; |
| 10 | 10 |
examples/pdf-split-pages.cc
| @@ -10,9 +10,9 @@ | @@ -10,9 +10,9 @@ | ||
| 10 | #include <qpdf/QPDFWriter.hh> | 10 | #include <qpdf/QPDFWriter.hh> |
| 11 | #include <qpdf/QUtil.hh> | 11 | #include <qpdf/QUtil.hh> |
| 12 | 12 | ||
| 13 | +#include <cstdlib> | ||
| 13 | #include <cstring> | 14 | #include <cstring> |
| 14 | #include <iostream> | 15 | #include <iostream> |
| 15 | -#include <cstdlib> | ||
| 16 | #include <string> | 16 | #include <string> |
| 17 | 17 | ||
| 18 | static bool static_id = false; | 18 | static bool static_id = false; |
include/qpdf/Buffer.hh
| @@ -25,8 +25,8 @@ | @@ -25,8 +25,8 @@ | ||
| 25 | #include <qpdf/DLL.h> | 25 | #include <qpdf/DLL.h> |
| 26 | #include <qpdf/PointerHolder.hh> // unused -- remove in qpdf 12 (see #785) | 26 | #include <qpdf/PointerHolder.hh> // unused -- remove in qpdf 12 (see #785) |
| 27 | 27 | ||
| 28 | -#include <memory> | ||
| 29 | #include <cstddef> | 28 | #include <cstddef> |
| 29 | +#include <memory> | ||
| 30 | 30 | ||
| 31 | class Buffer | 31 | class Buffer |
| 32 | { | 32 | { |
include/qpdf/InputSource.hh
| @@ -26,8 +26,8 @@ | @@ -26,8 +26,8 @@ | ||
| 26 | #include <qpdf/PointerHolder.hh> // unused -- remove in qpdf 12 (see #785) | 26 | #include <qpdf/PointerHolder.hh> // unused -- remove in qpdf 12 (see #785) |
| 27 | #include <qpdf/Types.h> | 27 | #include <qpdf/Types.h> |
| 28 | 28 | ||
| 29 | -#include <memory> | ||
| 30 | #include <cstdio> | 29 | #include <cstdio> |
| 30 | +#include <memory> | ||
| 31 | #include <string> | 31 | #include <string> |
| 32 | 32 | ||
| 33 | // Remember to use QPDF_DLL_CLASS on anything derived from InputSource | 33 | // Remember to use QPDF_DLL_CLASS on anything derived from InputSource |
include/qpdf/QPDF.hh
| @@ -25,12 +25,12 @@ | @@ -25,12 +25,12 @@ | ||
| 25 | #include <qpdf/DLL.h> | 25 | #include <qpdf/DLL.h> |
| 26 | #include <qpdf/Types.h> | 26 | #include <qpdf/Types.h> |
| 27 | 27 | ||
| 28 | +#include <cstdio> | ||
| 28 | #include <functional> | 29 | #include <functional> |
| 29 | #include <iostream> | 30 | #include <iostream> |
| 30 | #include <list> | 31 | #include <list> |
| 31 | #include <map> | 32 | #include <map> |
| 32 | #include <memory> | 33 | #include <memory> |
| 33 | -#include <cstdio> | ||
| 34 | #include <string> | 34 | #include <string> |
| 35 | #include <string_view> | 35 | #include <string_view> |
| 36 | #include <vector> | 36 | #include <vector> |
| @@ -113,8 +113,8 @@ class QPDF | @@ -113,8 +113,8 @@ class QPDF | ||
| 113 | // your own method of retrieving a PDF file, you can subclass | 113 | // your own method of retrieving a PDF file, you can subclass |
| 114 | // InputSource and use this method. | 114 | // InputSource and use this method. |
| 115 | QPDF_DLL | 115 | QPDF_DLL |
| 116 | - void | ||
| 117 | - processInputSource(std::shared_ptr<InputSource>, char const* password = nullptr); | 116 | + void processInputSource( |
| 117 | + std::shared_ptr<InputSource>, char const* password = nullptr); | ||
| 118 | 118 | ||
| 119 | // Create a PDF from an input source that contains JSON as written | 119 | // Create a PDF from an input source that contains JSON as written |
| 120 | // by writeJSON (or qpdf --json-output, version 2 or higher). The | 120 | // by writeJSON (or qpdf --json-output, version 2 or higher). The |
include/qpdf/QPDFJob.hh
| @@ -497,7 +497,8 @@ class QPDFJob | @@ -497,7 +497,8 @@ class QPDFJob | ||
| 497 | 497 | ||
| 498 | // Helper functions | 498 | // Helper functions |
| 499 | static void usage(std::string const& msg); | 499 | static void usage(std::string const& msg); |
| 500 | - static JSON json_schema(int json_version, std::set<std::string>* keys = nullptr); | 500 | + static JSON |
| 501 | + json_schema(int json_version, std::set<std::string>* keys = nullptr); | ||
| 501 | static void parse_object_id( | 502 | static void parse_object_id( |
| 502 | std::string const& objspec, bool& trailer, int& obj, int& gen); | 503 | std::string const& objspec, bool& trailer, int& obj, int& gen); |
| 503 | void parseRotationParameter(std::string const&); | 504 | void parseRotationParameter(std::string const&); |
include/qpdf/QPDFPageObjectHelper.hh
| @@ -319,8 +319,8 @@ class QPDFPageObjectHelper: public QPDFObjectHelper | @@ -319,8 +319,8 @@ class QPDFPageObjectHelper: public QPDFObjectHelper | ||
| 319 | // contents, as happens with addContentTokenFilter. See | 319 | // contents, as happens with addContentTokenFilter. See |
| 320 | // examples/pdf-count-strings.cc for an example. | 320 | // examples/pdf-count-strings.cc for an example. |
| 321 | QPDF_DLL | 321 | QPDF_DLL |
| 322 | - void | ||
| 323 | - filterContents(QPDFObjectHandle::TokenFilter* filter, Pipeline* next = nullptr); | 322 | + void filterContents( |
| 323 | + QPDFObjectHandle::TokenFilter* filter, Pipeline* next = nullptr); | ||
| 324 | 324 | ||
| 325 | // Old name -- calls filterContents() | 325 | // Old name -- calls filterContents() |
| 326 | QPDF_DLL | 326 | QPDF_DLL |
include/qpdf/QPDFTokenizer.hh
| @@ -27,8 +27,8 @@ | @@ -27,8 +27,8 @@ | ||
| 27 | #include <qpdf/InputSource.hh> | 27 | #include <qpdf/InputSource.hh> |
| 28 | #include <qpdf/PointerHolder.hh> // unused -- remove in qpdf 12 (see #785) | 28 | #include <qpdf/PointerHolder.hh> // unused -- remove in qpdf 12 (see #785) |
| 29 | 29 | ||
| 30 | -#include <memory> | ||
| 31 | #include <cstdio> | 30 | #include <cstdio> |
| 31 | +#include <memory> | ||
| 32 | #include <string> | 32 | #include <string> |
| 33 | 33 | ||
| 34 | class QPDFTokenizer | 34 | class QPDFTokenizer |
include/qpdf/QPDFWriter.hh
| @@ -29,12 +29,12 @@ | @@ -29,12 +29,12 @@ | ||
| 29 | #include <qpdf/DLL.h> | 29 | #include <qpdf/DLL.h> |
| 30 | #include <qpdf/Types.h> | 30 | #include <qpdf/Types.h> |
| 31 | 31 | ||
| 32 | +#include <cstdio> | ||
| 32 | #include <functional> | 33 | #include <functional> |
| 33 | #include <list> | 34 | #include <list> |
| 34 | #include <map> | 35 | #include <map> |
| 35 | #include <memory> | 36 | #include <memory> |
| 36 | #include <set> | 37 | #include <set> |
| 37 | -#include <cstdio> | ||
| 38 | #include <string> | 38 | #include <string> |
| 39 | #include <string_view> | 39 | #include <string_view> |
| 40 | #include <vector> | 40 | #include <vector> |
include/qpdf/QUtil.hh
| @@ -25,14 +25,14 @@ | @@ -25,14 +25,14 @@ | ||
| 25 | #include <qpdf/DLL.h> | 25 | #include <qpdf/DLL.h> |
| 26 | #include <qpdf/PointerHolder.hh> // unused -- remove in qpdf 12 (see #785) | 26 | #include <qpdf/PointerHolder.hh> // unused -- remove in qpdf 12 (see #785) |
| 27 | #include <qpdf/Types.h> | 27 | #include <qpdf/Types.h> |
| 28 | +#include <cstdio> | ||
| 28 | #include <cstring> | 29 | #include <cstring> |
| 30 | +#include <ctime> | ||
| 29 | #include <functional> | 31 | #include <functional> |
| 30 | #include <list> | 32 | #include <list> |
| 31 | #include <memory> | 33 | #include <memory> |
| 32 | #include <stdexcept> | 34 | #include <stdexcept> |
| 33 | -#include <cstdio> | ||
| 34 | #include <string> | 35 | #include <string> |
| 35 | -#include <ctime> | ||
| 36 | #include <vector> | 36 | #include <vector> |
| 37 | 37 | ||
| 38 | class RandomDataProvider; | 38 | class RandomDataProvider; |
libqpdf/BufferInputSource.cc
| @@ -2,8 +2,8 @@ | @@ -2,8 +2,8 @@ | ||
| 2 | 2 | ||
| 3 | #include <qpdf/QIntC.hh> | 3 | #include <qpdf/QIntC.hh> |
| 4 | #include <algorithm> | 4 | #include <algorithm> |
| 5 | -#include <sstream> | ||
| 6 | #include <cstring> | 5 | #include <cstring> |
| 6 | +#include <sstream> | ||
| 7 | 7 | ||
| 8 | BufferInputSource::BufferInputSource( | 8 | BufferInputSource::BufferInputSource( |
| 9 | std::string const& description, Buffer* buf, bool own_memory) : | 9 | std::string const& description, Buffer* buf, bool own_memory) : |
libqpdf/InputSource.cc
| @@ -2,8 +2,8 @@ | @@ -2,8 +2,8 @@ | ||
| 2 | 2 | ||
| 3 | #include <qpdf/QIntC.hh> | 3 | #include <qpdf/QIntC.hh> |
| 4 | #include <qpdf/QTC.hh> | 4 | #include <qpdf/QTC.hh> |
| 5 | -#include <stdexcept> | ||
| 6 | #include <cstring> | 5 | #include <cstring> |
| 6 | +#include <stdexcept> | ||
| 7 | 7 | ||
| 8 | void | 8 | void |
| 9 | InputSource::setLastOffset(qpdf_offset_t offset) | 9 | InputSource::setLastOffset(qpdf_offset_t offset) |
libqpdf/Pl_ASCII85Decoder.cc
| 1 | #include <qpdf/Pl_ASCII85Decoder.hh> | 1 | #include <qpdf/Pl_ASCII85Decoder.hh> |
| 2 | 2 | ||
| 3 | #include <qpdf/QTC.hh> | 3 | #include <qpdf/QTC.hh> |
| 4 | -#include <stdexcept> | ||
| 5 | #include <cstring> | 4 | #include <cstring> |
| 5 | +#include <stdexcept> | ||
| 6 | 6 | ||
| 7 | Pl_ASCII85Decoder::Pl_ASCII85Decoder(char const* identifier, Pipeline* next) : | 7 | Pl_ASCII85Decoder::Pl_ASCII85Decoder(char const* identifier, Pipeline* next) : |
| 8 | Pipeline(identifier, next), | 8 | Pipeline(identifier, next), |
libqpdf/Pl_Buffer.cc
| 1 | #include <qpdf/Pl_Buffer.hh> | 1 | #include <qpdf/Pl_Buffer.hh> |
| 2 | 2 | ||
| 3 | #include <algorithm> | 3 | #include <algorithm> |
| 4 | -#include <stdexcept> | ||
| 5 | #include <cstdlib> | 4 | #include <cstdlib> |
| 6 | #include <cstring> | 5 | #include <cstring> |
| 6 | +#include <stdexcept> | ||
| 7 | 7 | ||
| 8 | Pl_Buffer::Pl_Buffer(char const* identifier, Pipeline* next) : | 8 | Pl_Buffer::Pl_Buffer(char const* identifier, Pipeline* next) : |
| 9 | Pipeline(identifier, next), | 9 | Pipeline(identifier, next), |
libqpdf/Pl_DCT.cc
| @@ -24,8 +24,7 @@ namespace | @@ -24,8 +24,7 @@ namespace | ||
| 24 | static void | 24 | static void |
| 25 | error_handler(j_common_ptr cinfo) | 25 | error_handler(j_common_ptr cinfo) |
| 26 | { | 26 | { |
| 27 | - auto* jerr = | ||
| 28 | - reinterpret_cast<qpdf_jpeg_error_mgr*>(cinfo->err); | 27 | + auto* jerr = reinterpret_cast<qpdf_jpeg_error_mgr*>(cinfo->err); |
| 29 | char buf[JMSG_LENGTH_MAX]; | 28 | char buf[JMSG_LENGTH_MAX]; |
| 30 | (*cinfo->err->format_message)(cinfo, buf); | 29 | (*cinfo->err->format_message)(cinfo, buf); |
| 31 | jerr->msg = buf; | 30 | jerr->msg = buf; |
| @@ -261,8 +260,7 @@ jpeg_buffer_src(j_decompress_ptr cinfo, Buffer* buffer) | @@ -261,8 +260,7 @@ jpeg_buffer_src(j_decompress_ptr cinfo, Buffer* buffer) | ||
| 261 | void | 260 | void |
| 262 | Pl_DCT::compress(void* cinfo_p, Buffer* b) | 261 | Pl_DCT::compress(void* cinfo_p, Buffer* b) |
| 263 | { | 262 | { |
| 264 | - auto* cinfo = | ||
| 265 | - reinterpret_cast<jpeg_compress_struct*>(cinfo_p); | 263 | + auto* cinfo = reinterpret_cast<jpeg_compress_struct*>(cinfo_p); |
| 266 | 264 | ||
| 267 | #if ( \ | 265 | #if ( \ |
| 268 | (defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 406) || \ | 266 | (defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 406) || \ |
| @@ -316,8 +314,7 @@ Pl_DCT::compress(void* cinfo_p, Buffer* b) | @@ -316,8 +314,7 @@ Pl_DCT::compress(void* cinfo_p, Buffer* b) | ||
| 316 | void | 314 | void |
| 317 | Pl_DCT::decompress(void* cinfo_p, Buffer* b) | 315 | Pl_DCT::decompress(void* cinfo_p, Buffer* b) |
| 318 | { | 316 | { |
| 319 | - auto* cinfo = | ||
| 320 | - reinterpret_cast<jpeg_decompress_struct*>(cinfo_p); | 317 | + auto* cinfo = reinterpret_cast<jpeg_decompress_struct*>(cinfo_p); |
| 321 | 318 | ||
| 322 | #if ( \ | 319 | #if ( \ |
| 323 | (defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 406) || \ | 320 | (defined(__GNUC__) && ((__GNUC__ * 100) + __GNUC_MINOR__) >= 406) || \ |
libqpdf/Pl_LZWDecoder.cc
| @@ -3,8 +3,8 @@ | @@ -3,8 +3,8 @@ | ||
| 3 | #include <qpdf/QIntC.hh> | 3 | #include <qpdf/QIntC.hh> |
| 4 | #include <qpdf/QTC.hh> | 4 | #include <qpdf/QTC.hh> |
| 5 | #include <qpdf/QUtil.hh> | 5 | #include <qpdf/QUtil.hh> |
| 6 | -#include <stdexcept> | ||
| 7 | #include <cstring> | 6 | #include <cstring> |
| 7 | +#include <stdexcept> | ||
| 8 | 8 | ||
| 9 | Pl_LZWDecoder::Pl_LZWDecoder( | 9 | Pl_LZWDecoder::Pl_LZWDecoder( |
| 10 | char const* identifier, Pipeline* next, bool early_code_change) : | 10 | char const* identifier, Pipeline* next, bool early_code_change) : |
libqpdf/Pl_PNGFilter.cc
| @@ -4,8 +4,8 @@ | @@ -4,8 +4,8 @@ | ||
| 4 | #include <qpdf/QUtil.hh> | 4 | #include <qpdf/QUtil.hh> |
| 5 | 5 | ||
| 6 | #include <climits> | 6 | #include <climits> |
| 7 | -#include <stdexcept> | ||
| 8 | #include <cstring> | 7 | #include <cstring> |
| 8 | +#include <stdexcept> | ||
| 9 | 9 | ||
| 10 | static int | 10 | static int |
| 11 | abs_diff(int a, int b) | 11 | abs_diff(int a, int b) |
libqpdf/Pl_TIFFPredictor.cc
| @@ -6,8 +6,8 @@ | @@ -6,8 +6,8 @@ | ||
| 6 | #include <qpdf/QUtil.hh> | 6 | #include <qpdf/QUtil.hh> |
| 7 | 7 | ||
| 8 | #include <climits> | 8 | #include <climits> |
| 9 | -#include <stdexcept> | ||
| 10 | #include <cstring> | 9 | #include <cstring> |
| 10 | +#include <stdexcept> | ||
| 11 | #include <vector> | 11 | #include <vector> |
| 12 | 12 | ||
| 13 | Pl_TIFFPredictor::Pl_TIFFPredictor( | 13 | Pl_TIFFPredictor::Pl_TIFFPredictor( |
libqpdf/QPDF.cc
| @@ -4,13 +4,13 @@ | @@ -4,13 +4,13 @@ | ||
| 4 | 4 | ||
| 5 | #include <algorithm> | 5 | #include <algorithm> |
| 6 | #include <atomic> | 6 | #include <atomic> |
| 7 | +#include <cstdlib> | ||
| 8 | +#include <cstring> | ||
| 7 | #include <limits> | 9 | #include <limits> |
| 8 | #include <map> | 10 | #include <map> |
| 9 | #include <memory.h> | 11 | #include <memory.h> |
| 10 | #include <regex> | 12 | #include <regex> |
| 11 | #include <sstream> | 13 | #include <sstream> |
| 12 | -#include <cstdlib> | ||
| 13 | -#include <cstring> | ||
| 14 | #include <vector> | 14 | #include <vector> |
| 15 | 15 | ||
| 16 | #include <qpdf/BufferInputSource.hh> | 16 | #include <qpdf/BufferInputSource.hh> |
| @@ -2528,9 +2528,7 @@ QPDF::getCompressibleObjGens() | @@ -2528,9 +2528,7 @@ QPDF::getCompressibleObjGens() | ||
| 2528 | if (obj.isStream()) { | 2528 | if (obj.isStream()) { |
| 2529 | QPDFObjectHandle dict = obj.getDict(); | 2529 | QPDFObjectHandle dict = obj.getDict(); |
| 2530 | std::set<std::string> keys = dict.getKeys(); | 2530 | std::set<std::string> keys = dict.getKeys(); |
| 2531 | - for (auto iter = keys.rbegin(); | ||
| 2532 | - iter != keys.rend(); | ||
| 2533 | - ++iter) { | 2531 | + for (auto iter = keys.rbegin(); iter != keys.rend(); ++iter) { |
| 2534 | std::string const& key = *iter; | 2532 | std::string const& key = *iter; |
| 2535 | QPDFObjectHandle value = dict.getKey(key); | 2533 | QPDFObjectHandle value = dict.getKey(key); |
| 2536 | if (key == "/Length") { | 2534 | if (key == "/Length") { |
| @@ -2544,9 +2542,7 @@ QPDF::getCompressibleObjGens() | @@ -2544,9 +2542,7 @@ QPDF::getCompressibleObjGens() | ||
| 2544 | } | 2542 | } |
| 2545 | } else if (obj.isDictionary()) { | 2543 | } else if (obj.isDictionary()) { |
| 2546 | std::set<std::string> keys = obj.getKeys(); | 2544 | std::set<std::string> keys = obj.getKeys(); |
| 2547 | - for (auto iter = keys.rbegin(); | ||
| 2548 | - iter != keys.rend(); | ||
| 2549 | - ++iter) { | 2545 | + for (auto iter = keys.rbegin(); iter != keys.rend(); ++iter) { |
| 2550 | queue.push_front(obj.getKey(*iter)); | 2546 | queue.push_front(obj.getKey(*iter)); |
| 2551 | } | 2547 | } |
| 2552 | } else if (obj.isArray()) { | 2548 | } else if (obj.isArray()) { |
libqpdf/QPDFJob.cc
| 1 | #include <qpdf/QPDFJob.hh> | 1 | #include <qpdf/QPDFJob.hh> |
| 2 | 2 | ||
| 3 | +#include <cctype> | ||
| 3 | #include <cstdio> | 4 | #include <cstdio> |
| 4 | #include <cstdlib> | 5 | #include <cstdlib> |
| 5 | #include <cstring> | 6 | #include <cstring> |
| 6 | -#include <cctype> | ||
| 7 | #include <fcntl.h> | 7 | #include <fcntl.h> |
| 8 | #include <iostream> | 8 | #include <iostream> |
| 9 | #include <memory> | 9 | #include <memory> |
libqpdf/QPDFJob_argv.cc
| @@ -2,13 +2,13 @@ | @@ -2,13 +2,13 @@ | ||
| 2 | 2 | ||
| 3 | // See "HOW TO ADD A COMMAND-LINE ARGUMENT" in README-maintainer. | 3 | // See "HOW TO ADD A COMMAND-LINE ARGUMENT" in README-maintainer. |
| 4 | 4 | ||
| 5 | -#include <cstdio> | ||
| 6 | #include <cctype> | 5 | #include <cctype> |
| 6 | +#include <cstdio> | ||
| 7 | +#include <cstdlib> | ||
| 8 | +#include <cstring> | ||
| 7 | #include <iostream> | 9 | #include <iostream> |
| 8 | #include <memory> | 10 | #include <memory> |
| 9 | #include <sstream> | 11 | #include <sstream> |
| 10 | -#include <cstdlib> | ||
| 11 | -#include <cstring> | ||
| 12 | 12 | ||
| 13 | #include <qpdf/QIntC.hh> | 13 | #include <qpdf/QIntC.hh> |
| 14 | #include <qpdf/QPDFArgParser.hh> | 14 | #include <qpdf/QPDFArgParser.hh> |
libqpdf/QPDFObjectHandle.cc
| @@ -29,11 +29,11 @@ | @@ -29,11 +29,11 @@ | ||
| 29 | #include <qpdf/QUtil.hh> | 29 | #include <qpdf/QUtil.hh> |
| 30 | 30 | ||
| 31 | #include <algorithm> | 31 | #include <algorithm> |
| 32 | -#include <cstring> | ||
| 33 | #include <cctype> | 32 | #include <cctype> |
| 34 | #include <climits> | 33 | #include <climits> |
| 35 | -#include <stdexcept> | ||
| 36 | #include <cstdlib> | 34 | #include <cstdlib> |
| 35 | +#include <cstring> | ||
| 36 | +#include <stdexcept> | ||
| 37 | 37 | ||
| 38 | using namespace std::literals; | 38 | using namespace std::literals; |
| 39 | 39 |
libqpdf/QPDFTokenizer.cc
| @@ -10,9 +10,9 @@ | @@ -10,9 +10,9 @@ | ||
| 10 | #include <qpdf/QTC.hh> | 10 | #include <qpdf/QTC.hh> |
| 11 | #include <qpdf/QUtil.hh> | 11 | #include <qpdf/QUtil.hh> |
| 12 | 12 | ||
| 13 | -#include <stdexcept> | ||
| 14 | #include <cstdlib> | 13 | #include <cstdlib> |
| 15 | #include <cstring> | 14 | #include <cstring> |
| 15 | +#include <stdexcept> | ||
| 16 | 16 | ||
| 17 | static inline bool | 17 | static inline bool |
| 18 | is_delimiter(char ch) | 18 | is_delimiter(char ch) |
libqpdf/QPDFWriter.cc
| @@ -23,8 +23,8 @@ | @@ -23,8 +23,8 @@ | ||
| 23 | #include <qpdf/RC4.hh> | 23 | #include <qpdf/RC4.hh> |
| 24 | 24 | ||
| 25 | #include <algorithm> | 25 | #include <algorithm> |
| 26 | -#include <stdexcept> | ||
| 27 | #include <cstdlib> | 26 | #include <cstdlib> |
| 27 | +#include <stdexcept> | ||
| 28 | 28 | ||
| 29 | QPDFWriter::ProgressReporter::~ProgressReporter() | 29 | QPDFWriter::ProgressReporter::~ProgressReporter() |
| 30 | { | 30 | { |
| @@ -997,8 +997,7 @@ void | @@ -997,8 +997,7 @@ void | ||
| 997 | QPDFWriter::activatePipelineStack(PipelinePopper& pp) | 997 | QPDFWriter::activatePipelineStack(PipelinePopper& pp) |
| 998 | { | 998 | { |
| 999 | std::string stack_id("stack " + std::to_string(this->m->next_stack_id)); | 999 | std::string stack_id("stack " + std::to_string(this->m->next_stack_id)); |
| 1000 | - auto* c = | ||
| 1001 | - new Pl_Count(stack_id.c_str(), this->m->pipeline_stack.back()); | 1000 | + auto* c = new Pl_Count(stack_id.c_str(), this->m->pipeline_stack.back()); |
| 1002 | ++this->m->next_stack_id; | 1001 | ++this->m->next_stack_id; |
| 1003 | this->m->pipeline_stack.push_back(c); | 1002 | this->m->pipeline_stack.push_back(c); |
| 1004 | this->m->pipeline = c; | 1003 | this->m->pipeline = c; |
libqpdf/QPDF_json.cc
| @@ -246,8 +246,7 @@ class QPDF::JSONReactor: public JSON::Reactor | @@ -246,8 +246,7 @@ class QPDF::JSONReactor: public JSON::Reactor | ||
| 246 | void arrayStart() override; | 246 | void arrayStart() override; |
| 247 | void containerEnd(JSON const& value) override; | 247 | void containerEnd(JSON const& value) override; |
| 248 | void topLevelScalar() override; | 248 | void topLevelScalar() override; |
| 249 | - bool | ||
| 250 | - dictionaryItem(std::string const& key, JSON const& value) override; | 249 | + bool dictionaryItem(std::string const& key, JSON const& value) override; |
| 251 | bool arrayItem(JSON const& value) override; | 250 | bool arrayItem(JSON const& value) override; |
| 252 | 251 | ||
| 253 | bool anyErrors() const; | 252 | bool anyErrors() const; |
libqpdf/QTC.cc
| 1 | #include <qpdf/QTC.hh> | 1 | #include <qpdf/QTC.hh> |
| 2 | 2 | ||
| 3 | #include <qpdf/QUtil.hh> | 3 | #include <qpdf/QUtil.hh> |
| 4 | +#include <cstdio> | ||
| 4 | #include <map> | 5 | #include <map> |
| 5 | #include <set> | 6 | #include <set> |
| 6 | -#include <cstdio> | ||
| 7 | 7 | ||
| 8 | static bool | 8 | static bool |
| 9 | tc_active(char const* const scope) | 9 | tc_active(char const* const scope) |
libqpdf/QUtil.cc
| @@ -11,6 +11,9 @@ | @@ -11,6 +11,9 @@ | ||
| 11 | 11 | ||
| 12 | #include <cctype> | 12 | #include <cctype> |
| 13 | #include <cerrno> | 13 | #include <cerrno> |
| 14 | +#include <cstdio> | ||
| 15 | +#include <cstdlib> | ||
| 16 | +#include <cstring> | ||
| 14 | #include <fcntl.h> | 17 | #include <fcntl.h> |
| 15 | #include <fstream> | 18 | #include <fstream> |
| 16 | #include <iomanip> | 19 | #include <iomanip> |
| @@ -21,9 +24,6 @@ | @@ -21,9 +24,6 @@ | ||
| 21 | #include <set> | 24 | #include <set> |
| 22 | #include <sstream> | 25 | #include <sstream> |
| 23 | #include <stdexcept> | 26 | #include <stdexcept> |
| 24 | -#include <cstdio> | ||
| 25 | -#include <cstdlib> | ||
| 26 | -#include <cstring> | ||
| 27 | #ifndef QPDF_NO_WCHAR_T | 27 | #ifndef QPDF_NO_WCHAR_T |
| 28 | # include <cwchar> | 28 | # include <cwchar> |
| 29 | #endif | 29 | #endif |
libqpdf/RC4.cc
| @@ -2,7 +2,6 @@ | @@ -2,7 +2,6 @@ | ||
| 2 | 2 | ||
| 3 | #include <qpdf/QPDFCryptoProvider.hh> | 3 | #include <qpdf/QPDFCryptoProvider.hh> |
| 4 | 4 | ||
| 5 | - | ||
| 6 | RC4::RC4(unsigned char const* key_data, int key_len) : | 5 | RC4::RC4(unsigned char const* key_data, int key_len) : |
| 7 | crypto(QPDFCryptoProvider::getImpl()) | 6 | crypto(QPDFCryptoProvider::getImpl()) |
| 8 | { | 7 | { |
libtests/aes.cc
| @@ -3,10 +3,10 @@ | @@ -3,10 +3,10 @@ | ||
| 3 | #include <qpdf/QIntC.hh> | 3 | #include <qpdf/QIntC.hh> |
| 4 | #include <qpdf/QUtil.hh> | 4 | #include <qpdf/QUtil.hh> |
| 5 | 5 | ||
| 6 | -#include <iostream> | ||
| 7 | #include <cstdio> | 6 | #include <cstdio> |
| 8 | #include <cstdlib> | 7 | #include <cstdlib> |
| 9 | #include <cstring> | 8 | #include <cstring> |
| 9 | +#include <iostream> | ||
| 10 | 10 | ||
| 11 | static void | 11 | static void |
| 12 | usage() | 12 | usage() |
libtests/ascii85.cc
libtests/bits.cc
| @@ -3,8 +3,8 @@ | @@ -3,8 +3,8 @@ | ||
| 3 | #include <qpdf/Pl_Buffer.hh> | 3 | #include <qpdf/Pl_Buffer.hh> |
| 4 | #include <qpdf/QIntC.hh> | 4 | #include <qpdf/QIntC.hh> |
| 5 | #include <qpdf/QUtil.hh> | 5 | #include <qpdf/QUtil.hh> |
| 6 | -#include <iostream> | ||
| 7 | #include <cstdlib> | 6 | #include <cstdlib> |
| 7 | +#include <iostream> | ||
| 8 | 8 | ||
| 9 | // See comments in bits_functions.hh | 9 | // See comments in bits_functions.hh |
| 10 | #define BITS_TESTING 1 | 10 | #define BITS_TESTING 1 |
libtests/buffer.cc
| @@ -4,10 +4,10 @@ | @@ -4,10 +4,10 @@ | ||
| 4 | #include <qpdf/Pl_Count.hh> | 4 | #include <qpdf/Pl_Count.hh> |
| 5 | #include <qpdf/Pl_Discard.hh> | 5 | #include <qpdf/Pl_Discard.hh> |
| 6 | #include <qpdf/QUtil.hh> | 6 | #include <qpdf/QUtil.hh> |
| 7 | +#include <cstdlib> | ||
| 7 | #include <cstring> | 8 | #include <cstring> |
| 8 | #include <iostream> | 9 | #include <iostream> |
| 9 | #include <stdexcept> | 10 | #include <stdexcept> |
| 10 | -#include <cstdlib> | ||
| 11 | 11 | ||
| 12 | static unsigned char* | 12 | static unsigned char* |
| 13 | uc(char const* s) | 13 | uc(char const* s) |
libtests/closed_file_input_source.cc
| 1 | #include <qpdf/ClosedFileInputSource.hh> | 1 | #include <qpdf/ClosedFileInputSource.hh> |
| 2 | #include <qpdf/FileInputSource.hh> | 2 | #include <qpdf/FileInputSource.hh> |
| 3 | 3 | ||
| 4 | -#include <iostream> | ||
| 5 | #include <cstdio> | 4 | #include <cstdio> |
| 5 | +#include <iostream> | ||
| 6 | 6 | ||
| 7 | void | 7 | void |
| 8 | check(std::string const& what, bool result) | 8 | check(std::string const& what, bool result) |
libtests/dct_compress.cc
| @@ -2,10 +2,10 @@ | @@ -2,10 +2,10 @@ | ||
| 2 | #include <qpdf/Pl_StdioFile.hh> | 2 | #include <qpdf/Pl_StdioFile.hh> |
| 3 | #include <qpdf/QUtil.hh> | 3 | #include <qpdf/QUtil.hh> |
| 4 | 4 | ||
| 5 | -#include <iostream> | ||
| 6 | #include <cstdio> | 5 | #include <cstdio> |
| 7 | #include <cstdlib> | 6 | #include <cstdlib> |
| 8 | #include <cstring> | 7 | #include <cstring> |
| 8 | +#include <iostream> | ||
| 9 | 9 | ||
| 10 | static void | 10 | static void |
| 11 | usage() | 11 | usage() |
libtests/dct_uncompress.cc
| @@ -2,9 +2,9 @@ | @@ -2,9 +2,9 @@ | ||
| 2 | #include <qpdf/Pl_StdioFile.hh> | 2 | #include <qpdf/Pl_StdioFile.hh> |
| 3 | #include <qpdf/QUtil.hh> | 3 | #include <qpdf/QUtil.hh> |
| 4 | 4 | ||
| 5 | -#include <iostream> | ||
| 6 | #include <cstdio> | 5 | #include <cstdio> |
| 7 | #include <cstdlib> | 6 | #include <cstdlib> |
| 7 | +#include <iostream> | ||
| 8 | 8 | ||
| 9 | int | 9 | int |
| 10 | main(int argc, char* argv[]) | 10 | main(int argc, char* argv[]) |
libtests/flate.cc
| @@ -4,8 +4,8 @@ | @@ -4,8 +4,8 @@ | ||
| 4 | #include <qpdf/Pl_StdioFile.hh> | 4 | #include <qpdf/Pl_StdioFile.hh> |
| 5 | #include <qpdf/QUtil.hh> | 5 | #include <qpdf/QUtil.hh> |
| 6 | 6 | ||
| 7 | -#include <iostream> | ||
| 8 | #include <cstdlib> | 7 | #include <cstdlib> |
| 8 | +#include <iostream> | ||
| 9 | 9 | ||
| 10 | void | 10 | void |
| 11 | run(char const* filename) | 11 | run(char const* filename) |
libtests/hex.cc
libtests/json_parse.cc
| @@ -15,8 +15,7 @@ namespace | @@ -15,8 +15,7 @@ namespace | ||
| 15 | void arrayStart() override; | 15 | void arrayStart() override; |
| 16 | void containerEnd(JSON const& value) override; | 16 | void containerEnd(JSON const& value) override; |
| 17 | void topLevelScalar() override; | 17 | void topLevelScalar() override; |
| 18 | - bool | ||
| 19 | - dictionaryItem(std::string const& key, JSON const& value) override; | 18 | + bool dictionaryItem(std::string const& key, JSON const& value) override; |
| 20 | bool arrayItem(JSON const& value) override; | 19 | bool arrayItem(JSON const& value) override; |
| 21 | 20 | ||
| 22 | private: | 21 | private: |
libtests/lzw.cc
| @@ -2,9 +2,9 @@ | @@ -2,9 +2,9 @@ | ||
| 2 | 2 | ||
| 3 | #include <qpdf/Pl_StdioFile.hh> | 3 | #include <qpdf/Pl_StdioFile.hh> |
| 4 | #include <qpdf/QUtil.hh> | 4 | #include <qpdf/QUtil.hh> |
| 5 | -#include <iostream> | ||
| 6 | #include <cstdlib> | 5 | #include <cstdlib> |
| 7 | #include <cstring> | 6 | #include <cstring> |
| 7 | +#include <iostream> | ||
| 8 | 8 | ||
| 9 | int | 9 | int |
| 10 | main(int argc, char* argv[]) | 10 | main(int argc, char* argv[]) |
libtests/md5.cc
| @@ -2,8 +2,8 @@ | @@ -2,8 +2,8 @@ | ||
| 2 | #include <qpdf/Pl_Discard.hh> | 2 | #include <qpdf/Pl_Discard.hh> |
| 3 | #include <qpdf/Pl_MD5.hh> | 3 | #include <qpdf/Pl_MD5.hh> |
| 4 | #include <qpdf/QUtil.hh> | 4 | #include <qpdf/QUtil.hh> |
| 5 | -#include <iostream> | ||
| 6 | #include <cstdio> | 5 | #include <cstdio> |
| 6 | +#include <iostream> | ||
| 7 | 7 | ||
| 8 | static void | 8 | static void |
| 9 | test_string(char const* str) | 9 | test_string(char const* str) |
libtests/predictors.cc
| @@ -6,9 +6,9 @@ | @@ -6,9 +6,9 @@ | ||
| 6 | #include <qpdf/QIntC.hh> | 6 | #include <qpdf/QIntC.hh> |
| 7 | #include <qpdf/QUtil.hh> | 7 | #include <qpdf/QUtil.hh> |
| 8 | 8 | ||
| 9 | -#include <iostream> | ||
| 10 | #include <cstdlib> | 9 | #include <cstdlib> |
| 11 | #include <cstring> | 10 | #include <cstring> |
| 11 | +#include <iostream> | ||
| 12 | 12 | ||
| 13 | void | 13 | void |
| 14 | run(char const* filename, | 14 | run(char const* filename, |
libtests/qintc.cc
| @@ -69,11 +69,11 @@ try_range_check_subtract_real( | @@ -69,11 +69,11 @@ try_range_check_subtract_real( | ||
| 69 | int | 69 | int |
| 70 | main() | 70 | main() |
| 71 | { | 71 | { |
| 72 | - uint32_t u1 = 3141592653U; // Too big for signed type | ||
| 73 | - int32_t i1 = -1153374643; // Same bit pattern as u1 | ||
| 74 | - uint64_t ul1 = 1099511627776LL; // Too big for 32-bit | ||
| 75 | - uint64_t ul2 = 12345; // Fits into 32-bit | ||
| 76 | - int32_t i2 = 81; // Fits in char and uchar | 72 | + uint32_t u1 = 3141592653U; // Too big for signed type |
| 73 | + int32_t i1 = -1153374643; // Same bit pattern as u1 | ||
| 74 | + uint64_t ul1 = 1099511627776LL; // Too big for 32-bit | ||
| 75 | + uint64_t ul2 = 12345; // Fits into 32-bit | ||
| 76 | + int32_t i2 = 81; // Fits in char and uchar | ||
| 77 | auto c1 = static_cast<signed char>('\xf7'); // Signed value when char | 77 | auto c1 = static_cast<signed char>('\xf7'); // Signed value when char |
| 78 | char c2 = 'W'; // char; may be signed or unsigned | 78 | char c2 = 'W'; // char; may be signed or unsigned |
| 79 | 79 |
libtests/qutil.cc
| @@ -3,11 +3,11 @@ | @@ -3,11 +3,11 @@ | ||
| 3 | #include <qpdf/Pl_Buffer.hh> | 3 | #include <qpdf/Pl_Buffer.hh> |
| 4 | #include <qpdf/QPDFSystemError.hh> | 4 | #include <qpdf/QPDFSystemError.hh> |
| 5 | #include <qpdf/QUtil.hh> | 5 | #include <qpdf/QUtil.hh> |
| 6 | -#include <fstream> | ||
| 7 | -#include <iostream> | ||
| 8 | #include <climits> | 6 | #include <climits> |
| 9 | #include <cstdio> | 7 | #include <cstdio> |
| 10 | #include <cstring> | 8 | #include <cstring> |
| 9 | +#include <fstream> | ||
| 10 | +#include <iostream> | ||
| 11 | 11 | ||
| 12 | #ifdef _WIN32 | 12 | #ifdef _WIN32 |
| 13 | # include <io.h> | 13 | # include <io.h> |
libtests/rc4.cc
| @@ -5,10 +5,10 @@ | @@ -5,10 +5,10 @@ | ||
| 5 | #include <qpdf/QIntC.hh> | 5 | #include <qpdf/QIntC.hh> |
| 6 | #include <qpdf/QUtil.hh> | 6 | #include <qpdf/QUtil.hh> |
| 7 | 7 | ||
| 8 | -#include <iostream> | ||
| 9 | #include <cstdio> | 8 | #include <cstdio> |
| 10 | #include <cstdlib> | 9 | #include <cstdlib> |
| 11 | #include <cstring> | 10 | #include <cstring> |
| 11 | +#include <iostream> | ||
| 12 | 12 | ||
| 13 | static void | 13 | static void |
| 14 | other_tests() | 14 | other_tests() |
libtests/runlength.cc
| @@ -2,10 +2,10 @@ | @@ -2,10 +2,10 @@ | ||
| 2 | #include <qpdf/Pl_StdioFile.hh> | 2 | #include <qpdf/Pl_StdioFile.hh> |
| 3 | #include <qpdf/QUtil.hh> | 3 | #include <qpdf/QUtil.hh> |
| 4 | 4 | ||
| 5 | -#include <iostream> | ||
| 6 | #include <cstdio> | 5 | #include <cstdio> |
| 7 | #include <cstdlib> | 6 | #include <cstdlib> |
| 8 | #include <cstring> | 7 | #include <cstring> |
| 8 | +#include <iostream> | ||
| 9 | 9 | ||
| 10 | int | 10 | int |
| 11 | main(int argc, char* argv[]) | 11 | main(int argc, char* argv[]) |
libtests/sha2.cc
qpdf/pdf_from_scratch.cc
| @@ -4,10 +4,10 @@ | @@ -4,10 +4,10 @@ | ||
| 4 | #include <qpdf/QPDFPageDocumentHelper.hh> | 4 | #include <qpdf/QPDFPageDocumentHelper.hh> |
| 5 | #include <qpdf/QPDFWriter.hh> | 5 | #include <qpdf/QPDFWriter.hh> |
| 6 | #include <qpdf/QUtil.hh> | 6 | #include <qpdf/QUtil.hh> |
| 7 | -#include <iostream> | ||
| 8 | #include <cstdio> | 7 | #include <cstdio> |
| 9 | #include <cstdlib> | 8 | #include <cstdlib> |
| 10 | #include <cstring> | 9 | #include <cstring> |
| 10 | +#include <iostream> | ||
| 11 | 11 | ||
| 12 | static char const* whoami = nullptr; | 12 | static char const* whoami = nullptr; |
| 13 | 13 |
qpdf/test_driver.cc
| @@ -26,13 +26,13 @@ | @@ -26,13 +26,13 @@ | ||
| 26 | #include <qpdf/QPDFWriter.hh> | 26 | #include <qpdf/QPDFWriter.hh> |
| 27 | #include <qpdf/QTC.hh> | 27 | #include <qpdf/QTC.hh> |
| 28 | #include <qpdf/QUtil.hh> | 28 | #include <qpdf/QUtil.hh> |
| 29 | -#include <iostream> | ||
| 30 | #include <climits> | 29 | #include <climits> |
| 31 | -#include <map> | ||
| 32 | -#include <sstream> | ||
| 33 | #include <cstdio> | 30 | #include <cstdio> |
| 34 | #include <cstdlib> | 31 | #include <cstdlib> |
| 35 | #include <cstring> | 32 | #include <cstring> |
| 33 | +#include <iostream> | ||
| 34 | +#include <map> | ||
| 35 | +#include <sstream> | ||
| 36 | 36 | ||
| 37 | #define QPDF_OBJECT_NOWARN | 37 | #define QPDF_OBJECT_NOWARN |
| 38 | #include <qpdf/QPDFObject.hh> | 38 | #include <qpdf/QPDFObject.hh> |
qpdf/test_large_file.cc
| @@ -12,9 +12,9 @@ | @@ -12,9 +12,9 @@ | ||
| 12 | #include <qpdf/QPDFPageDocumentHelper.hh> | 12 | #include <qpdf/QPDFPageDocumentHelper.hh> |
| 13 | #include <qpdf/QPDFWriter.hh> | 13 | #include <qpdf/QPDFWriter.hh> |
| 14 | #include <qpdf/QUtil.hh> | 14 | #include <qpdf/QUtil.hh> |
| 15 | -#include <iostream> | ||
| 16 | #include <cstdlib> | 15 | #include <cstdlib> |
| 17 | #include <cstring> | 16 | #include <cstring> |
| 17 | +#include <iostream> | ||
| 18 | 18 | ||
| 19 | // Run "test_large_file write small a.pdf" to get a PDF file that you | 19 | // Run "test_large_file write small a.pdf" to get a PDF file that you |
| 20 | // can look at in a reader. | 20 | // can look at in a reader. |
qpdf/test_pdf_doc_encoding.cc
| 1 | #include <qpdf/QPDFObjectHandle.hh> | 1 | #include <qpdf/QPDFObjectHandle.hh> |
| 2 | #include <qpdf/QUtil.hh> | 2 | #include <qpdf/QUtil.hh> |
| 3 | -#include <iostream> | ||
| 4 | #include <cstdlib> | 3 | #include <cstdlib> |
| 5 | #include <cstring> | 4 | #include <cstring> |
| 5 | +#include <iostream> | ||
| 6 | 6 | ||
| 7 | static char const* whoami = nullptr; | 7 | static char const* whoami = nullptr; |
| 8 | 8 |
qpdf/test_pdf_unicode.cc
| 1 | #include <qpdf/QPDFObjectHandle.hh> | 1 | #include <qpdf/QPDFObjectHandle.hh> |
| 2 | #include <qpdf/QUtil.hh> | 2 | #include <qpdf/QUtil.hh> |
| 3 | -#include <iostream> | ||
| 4 | #include <cstdlib> | 3 | #include <cstdlib> |
| 5 | #include <cstring> | 4 | #include <cstring> |
| 5 | +#include <iostream> | ||
| 6 | 6 | ||
| 7 | static char const* whoami = nullptr; | 7 | static char const* whoami = nullptr; |
| 8 | 8 |
qpdf/test_tokenizer.cc
| @@ -6,10 +6,10 @@ | @@ -6,10 +6,10 @@ | ||
| 6 | #include <qpdf/QPDFPageDocumentHelper.hh> | 6 | #include <qpdf/QPDFPageDocumentHelper.hh> |
| 7 | #include <qpdf/QPDFTokenizer.hh> | 7 | #include <qpdf/QPDFTokenizer.hh> |
| 8 | #include <qpdf/QUtil.hh> | 8 | #include <qpdf/QUtil.hh> |
| 9 | -#include <iostream> | ||
| 10 | #include <cstdio> | 9 | #include <cstdio> |
| 11 | #include <cstdlib> | 10 | #include <cstdlib> |
| 12 | #include <cstring> | 11 | #include <cstring> |
| 12 | +#include <iostream> | ||
| 13 | 13 | ||
| 14 | static char const* whoami = nullptr; | 14 | static char const* whoami = nullptr; |
| 15 | 15 | ||
| @@ -203,8 +203,7 @@ process(char const* filename, bool include_ignorable, size_t max_len) | @@ -203,8 +203,7 @@ process(char const* filename, bool include_ignorable, size_t max_len) | ||
| 203 | Pl_Buffer plb("buffer"); | 203 | Pl_Buffer plb("buffer"); |
| 204 | page.pipeContents(&plb); | 204 | page.pipeContents(&plb); |
| 205 | auto content_data = plb.getBufferSharedPointer(); | 205 | auto content_data = plb.getBufferSharedPointer(); |
| 206 | - auto* bis = | ||
| 207 | - new BufferInputSource("content data", content_data.get()); | 206 | + auto* bis = new BufferInputSource("content data", content_data.get()); |
| 208 | is = std::shared_ptr<InputSource>(bis); | 207 | is = std::shared_ptr<InputSource>(bis); |
| 209 | dump_tokens( | 208 | dump_tokens( |
| 210 | is, | 209 | is, |
| @@ -220,8 +219,7 @@ process(char const* filename, bool include_ignorable, size_t max_len) | @@ -220,8 +219,7 @@ process(char const* filename, bool include_ignorable, size_t max_len) | ||
| 220 | if (obj.isStream() && obj.getDict().getKey("/Type").isName() && | 219 | if (obj.isStream() && obj.getDict().getKey("/Type").isName() && |
| 221 | obj.getDict().getKey("/Type").getName() == "/ObjStm") { | 220 | obj.getDict().getKey("/Type").getName() == "/ObjStm") { |
| 222 | std::shared_ptr<Buffer> b = obj.getStreamData(qpdf_dl_specialized); | 221 | std::shared_ptr<Buffer> b = obj.getStreamData(qpdf_dl_specialized); |
| 223 | - auto* bis = | ||
| 224 | - new BufferInputSource("object stream data", b.get()); | 222 | + auto* bis = new BufferInputSource("object stream data", b.get()); |
| 225 | is = std::shared_ptr<InputSource>(bis); | 223 | is = std::shared_ptr<InputSource>(bis); |
| 226 | dump_tokens( | 224 | dump_tokens( |
| 227 | is, | 225 | is, |
qpdf/test_unicode_filenames.cc
| @@ -5,9 +5,9 @@ | @@ -5,9 +5,9 @@ | ||
| 5 | # include <windows.h> | 5 | # include <windows.h> |
| 6 | #endif | 6 | #endif |
| 7 | 7 | ||
| 8 | -#include <iostream> | ||
| 9 | #include <cstdio> | 8 | #include <cstdio> |
| 10 | #include <cstdlib> | 9 | #include <cstdlib> |
| 10 | +#include <iostream> | ||
| 11 | 11 | ||
| 12 | static void | 12 | static void |
| 13 | do_copy(FILE* in, FILE* out) | 13 | do_copy(FILE* in, FILE* out) |
zlib-flate/zlib-flate.cc
| @@ -3,11 +3,11 @@ | @@ -3,11 +3,11 @@ | ||
| 3 | #include <qpdf/QPDF.hh> | 3 | #include <qpdf/QPDF.hh> |
| 4 | #include <qpdf/QUtil.hh> | 4 | #include <qpdf/QUtil.hh> |
| 5 | 5 | ||
| 6 | -#include <fcntl.h> | ||
| 7 | -#include <iostream> | ||
| 8 | #include <cstdio> | 6 | #include <cstdio> |
| 9 | #include <cstdlib> | 7 | #include <cstdlib> |
| 10 | #include <cstring> | 8 | #include <cstring> |
| 9 | +#include <fcntl.h> | ||
| 10 | +#include <iostream> | ||
| 11 | 11 | ||
| 12 | static char const* whoami = nullptr; | 12 | static char const* whoami = nullptr; |
| 13 | 13 |