aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJay Berkenbilt <jberkenbilt@users.noreply.github.com>2023-05-20 17:29:09 +0200
committerGitHub <noreply@github.com>2023-05-20 17:29:09 +0200
commitfd17c8e3fe38a56abf50ce0edec1cde48d4f74cb (patch)
treec1efea1b140cac94dbaf496ae6ec5e0a621daa07 /include
parenta6d7b79e65941238871c0c3d7d06b9bf246213ba (diff)
parente6577a1323cd813a92ddbc8841e1342c05de071a (diff)
downloadqpdf-fd17c8e3fe38a56abf50ce0edec1cde48d4f74cb.tar.zst
Merge pull request #963 from m-holger/tidy
Code tidy
Diffstat (limited to 'include')
-rw-r--r--include/qpdf/Buffer.hh2
-rw-r--r--include/qpdf/InputSource.hh2
-rw-r--r--include/qpdf/JSON.hh28
-rw-r--r--include/qpdf/Pl_Buffer.hh8
-rw-r--r--include/qpdf/Pl_DCT.hh4
-rw-r--r--include/qpdf/Pl_QPDFTokenizer.hh2
-rw-r--r--include/qpdf/Pl_StdioFile.hh2
-rw-r--r--include/qpdf/QPDF.hh10
-rw-r--r--include/qpdf/QPDFCryptoImpl.hh2
-rw-r--r--include/qpdf/QPDFJob.hh2
-rw-r--r--include/qpdf/QPDFObjectHandle.hh4
-rw-r--r--include/qpdf/QPDFOutlineObjectHelper.hh2
-rw-r--r--include/qpdf/QPDFPageObjectHelper.hh4
-rw-r--r--include/qpdf/QPDFTokenizer.hh2
-rw-r--r--include/qpdf/QPDFWriter.hh6
-rw-r--r--include/qpdf/QUtil.hh6
-rw-r--r--include/qpdf/RandomDataProvider.hh2
17 files changed, 44 insertions, 44 deletions
diff --git a/include/qpdf/Buffer.hh b/include/qpdf/Buffer.hh
index c5d55da1..06615e2c 100644
--- a/include/qpdf/Buffer.hh
+++ b/include/qpdf/Buffer.hh
@@ -26,7 +26,7 @@
#include <qpdf/PointerHolder.hh> // unused -- remove in qpdf 12 (see #785)
#include <memory>
-#include <stddef.h>
+#include <cstddef>
class Buffer
{
diff --git a/include/qpdf/InputSource.hh b/include/qpdf/InputSource.hh
index 68a787c6..c66066fb 100644
--- a/include/qpdf/InputSource.hh
+++ b/include/qpdf/InputSource.hh
@@ -27,7 +27,7 @@
#include <qpdf/Types.h>
#include <memory>
-#include <stdio.h>
+#include <cstdio>
#include <string>
// Remember to use QPDF_DLL_CLASS on anything derived from InputSource
diff --git a/include/qpdf/JSON.hh b/include/qpdf/JSON.hh
index 34333e93..3ff714ae 100644
--- a/include/qpdf/JSON.hh
+++ b/include/qpdf/JSON.hh
@@ -369,8 +369,8 @@ class JSON
JSON_value(vt_dictionary)
{
}
- virtual ~JSON_dictionary() = default;
- virtual void write(Pipeline*, size_t depth) const;
+ ~JSON_dictionary() override = default;
+ void write(Pipeline*, size_t depth) const override;
std::map<std::string, JSON> members;
std::set<std::string> parsed_keys;
};
@@ -380,15 +380,15 @@ class JSON
JSON_value(vt_array)
{
}
- virtual ~JSON_array() = default;
- virtual void write(Pipeline*, size_t depth) const;
+ ~JSON_array() override = default;
+ void write(Pipeline*, size_t depth) const override;
std::vector<JSON> elements;
};
struct JSON_string: public JSON_value
{
JSON_string(std::string const& utf8);
- virtual ~JSON_string() = default;
- virtual void write(Pipeline*, size_t depth) const;
+ ~JSON_string() override = default;
+ void write(Pipeline*, size_t depth) const override;
std::string utf8;
std::string encoded;
};
@@ -397,15 +397,15 @@ class JSON
JSON_number(long long val);
JSON_number(double val);
JSON_number(std::string const& val);
- virtual ~JSON_number() = default;
- virtual void write(Pipeline*, size_t depth) const;
+ ~JSON_number() override = default;
+ void write(Pipeline*, size_t depth) const override;
std::string encoded;
};
struct JSON_bool: public JSON_value
{
JSON_bool(bool val);
- virtual ~JSON_bool() = default;
- virtual void write(Pipeline*, size_t depth) const;
+ ~JSON_bool() override = default;
+ void write(Pipeline*, size_t depth) const override;
bool value;
};
struct JSON_null: public JSON_value
@@ -414,14 +414,14 @@ class JSON
JSON_value(vt_null)
{
}
- virtual ~JSON_null() = default;
- virtual void write(Pipeline*, size_t depth) const;
+ ~JSON_null() override = default;
+ void write(Pipeline*, size_t depth) const override;
};
struct JSON_blob: public JSON_value
{
JSON_blob(std::function<void(Pipeline*)> fn);
- virtual ~JSON_blob() = default;
- virtual void write(Pipeline*, size_t depth) const;
+ ~JSON_blob() override = default;
+ void write(Pipeline*, size_t depth) const override;
std::function<void(Pipeline*)> fn;
};
diff --git a/include/qpdf/Pl_Buffer.hh b/include/qpdf/Pl_Buffer.hh
index e2f71094..ffc01d95 100644
--- a/include/qpdf/Pl_Buffer.hh
+++ b/include/qpdf/Pl_Buffer.hh
@@ -43,13 +43,13 @@ class QPDF_DLL_CLASS Pl_Buffer: public Pipeline
{
public:
QPDF_DLL
- Pl_Buffer(char const* identifier, Pipeline* next = 0);
+ Pl_Buffer(char const* identifier, Pipeline* next = nullptr);
QPDF_DLL
- virtual ~Pl_Buffer();
+ ~Pl_Buffer() override;
QPDF_DLL
- virtual void write(unsigned char const*, size_t);
+ void write(unsigned char const*, size_t) override;
QPDF_DLL
- virtual void finish();
+ void finish() override;
// Each call to getBuffer() resets this object -- see notes above.
// The caller is responsible for deleting the returned Buffer
diff --git a/include/qpdf/Pl_DCT.hh b/include/qpdf/Pl_DCT.hh
index 543967ec..9352091f 100644
--- a/include/qpdf/Pl_DCT.hh
+++ b/include/qpdf/Pl_DCT.hh
@@ -57,7 +57,7 @@ class QPDF_DLL_CLASS Pl_DCT: public Pipeline
JDIMENSION image_height,
int components,
J_COLOR_SPACE color_space,
- CompressConfig* config_callback = 0);
+ CompressConfig* config_callback = nullptr);
QPDF_DLL
virtual ~Pl_DCT();
@@ -91,7 +91,7 @@ class QPDF_DLL_CLASS Pl_DCT: public Pipeline
JDIMENSION image_height = 0,
int components = 1,
J_COLOR_SPACE color_space = JCS_GRAYSCALE,
- CompressConfig* config_callback = 0);
+ CompressConfig* config_callback = nullptr);
Members(Members const&) = delete;
action_e action;
diff --git a/include/qpdf/Pl_QPDFTokenizer.hh b/include/qpdf/Pl_QPDFTokenizer.hh
index ce3615ec..0b8cafc2 100644
--- a/include/qpdf/Pl_QPDFTokenizer.hh
+++ b/include/qpdf/Pl_QPDFTokenizer.hh
@@ -51,7 +51,7 @@ class QPDF_DLL_CLASS Pl_QPDFTokenizer: public Pipeline
Pl_QPDFTokenizer(
char const* identifier,
QPDFObjectHandle::TokenFilter* filter,
- Pipeline* next = 0);
+ Pipeline* next = nullptr);
QPDF_DLL
virtual ~Pl_QPDFTokenizer();
QPDF_DLL
diff --git a/include/qpdf/Pl_StdioFile.hh b/include/qpdf/Pl_StdioFile.hh
index 1508af2b..d175d3c3 100644
--- a/include/qpdf/Pl_StdioFile.hh
+++ b/include/qpdf/Pl_StdioFile.hh
@@ -26,7 +26,7 @@
#include <qpdf/Pipeline.hh>
-#include <stdio.h>
+#include <cstdio>
//
// This pipeline is reusable.
diff --git a/include/qpdf/QPDF.hh b/include/qpdf/QPDF.hh
index 4541db64..03490af7 100644
--- a/include/qpdf/QPDF.hh
+++ b/include/qpdf/QPDF.hh
@@ -30,7 +30,7 @@
#include <list>
#include <map>
#include <memory>
-#include <stdio.h>
+#include <cstdio>
#include <string>
#include <string_view>
#include <vector>
@@ -83,7 +83,7 @@ class QPDF
// interpreted as a raw encryption key. See comments on
// setPasswordIsHexKey for more information.
QPDF_DLL
- void processFile(char const* filename, char const* password = 0);
+ void processFile(char const* filename, char const* password = nullptr);
// Parse a PDF from a stdio FILE*. The FILE must be open in
// binary mode and must be seekable. It may be open read only.
@@ -96,7 +96,7 @@ class QPDF
char const* description,
FILE* file,
bool close_file,
- char const* password = 0);
+ char const* password = nullptr);
// Parse a PDF file loaded into a memory buffer. This works
// exactly like processFile except that the PDF file is in memory
@@ -107,14 +107,14 @@ class QPDF
char const* description,
char const* buf,
size_t length,
- char const* password = 0);
+ char const* password = nullptr);
// Parse a PDF file loaded from a custom InputSource. If you have
// your own method of retrieving a PDF file, you can subclass
// InputSource and use this method.
QPDF_DLL
void
- processInputSource(std::shared_ptr<InputSource>, char const* password = 0);
+ processInputSource(std::shared_ptr<InputSource>, char const* password = nullptr);
// Create a PDF from an input source that contains JSON as written
// by writeJSON (or qpdf --json-output, version 2 or higher). The
diff --git a/include/qpdf/QPDFCryptoImpl.hh b/include/qpdf/QPDFCryptoImpl.hh
index 5345b45b..3fd64d3a 100644
--- a/include/qpdf/QPDFCryptoImpl.hh
+++ b/include/qpdf/QPDFCryptoImpl.hh
@@ -80,7 +80,7 @@ class QPDF_DLL_CLASS QPDFCryptoImpl
virtual void RC4_process(
unsigned char const* in_data,
size_t len,
- unsigned char* out_data = 0) = 0;
+ unsigned char* out_data = nullptr) = 0;
QPDF_DLL
virtual void RC4_finalize() = 0;
diff --git a/include/qpdf/QPDFJob.hh b/include/qpdf/QPDFJob.hh
index 2a82d61c..7396cd6a 100644
--- a/include/qpdf/QPDFJob.hh
+++ b/include/qpdf/QPDFJob.hh
@@ -497,7 +497,7 @@ class QPDFJob
// Helper functions
static void usage(std::string const& msg);
- static JSON json_schema(int json_version, std::set<std::string>* keys = 0);
+ static JSON json_schema(int json_version, std::set<std::string>* keys = nullptr);
static void parse_object_id(
std::string const& objspec, bool& trailer, int& obj, int& gen);
void parseRotationParameter(std::string const&);
diff --git a/include/qpdf/QPDFObjectHandle.hh b/include/qpdf/QPDFObjectHandle.hh
index ee424e39..198ca42e 100644
--- a/include/qpdf/QPDFObjectHandle.hh
+++ b/include/qpdf/QPDFObjectHandle.hh
@@ -526,7 +526,7 @@ class QPDFObjectHandle
QPDF_DLL
void parsePageContents(ParserCallbacks* callbacks);
QPDF_DLL
- void filterPageContents(TokenFilter* filter, Pipeline* next = 0);
+ void filterPageContents(TokenFilter* filter, Pipeline* next = nullptr);
// See comments for QPDFPageObjectHelper::pipeContents.
QPDF_DLL
void pipePageContents(Pipeline* p);
@@ -538,7 +538,7 @@ class QPDFObjectHandle
// contents. This can be used to apply a TokenFilter to a form
// XObject, whose data is in the same format as a content stream.
QPDF_DLL
- void filterAsContents(TokenFilter* filter, Pipeline* next = 0);
+ void filterAsContents(TokenFilter* filter, Pipeline* next = nullptr);
// Called on a stream to parse the stream as page contents. This
// can be used to parse a form XObject.
QPDF_DLL
diff --git a/include/qpdf/QPDFOutlineObjectHelper.hh b/include/qpdf/QPDFOutlineObjectHelper.hh
index c8b82a80..507a4a51 100644
--- a/include/qpdf/QPDFOutlineObjectHelper.hh
+++ b/include/qpdf/QPDFOutlineObjectHelper.hh
@@ -42,7 +42,7 @@ class QPDFOutlineObjectHelper: public QPDFObjectHelper
{
// This must be cleared explicitly to avoid circular references
// that prevent cleanup of pointer holders.
- this->m->parent = 0;
+ this->m->parent = nullptr;
}
// All constructors are private. You can only create one of these
diff --git a/include/qpdf/QPDFPageObjectHelper.hh b/include/qpdf/QPDFPageObjectHelper.hh
index ebb9e87e..9f647c70 100644
--- a/include/qpdf/QPDFPageObjectHelper.hh
+++ b/include/qpdf/QPDFPageObjectHelper.hh
@@ -320,12 +320,12 @@ class QPDFPageObjectHelper: public QPDFObjectHelper
// examples/pdf-count-strings.cc for an example.
QPDF_DLL
void
- filterContents(QPDFObjectHandle::TokenFilter* filter, Pipeline* next = 0);
+ filterContents(QPDFObjectHandle::TokenFilter* filter, Pipeline* next = nullptr);
// Old name -- calls filterContents()
QPDF_DLL
void filterPageContents(
- QPDFObjectHandle::TokenFilter* filter, Pipeline* next = 0);
+ QPDFObjectHandle::TokenFilter* filter, Pipeline* next = nullptr);
// Pipe a page's contents through the given pipeline. This method
// works whether the contents are a single stream or an array of
diff --git a/include/qpdf/QPDFTokenizer.hh b/include/qpdf/QPDFTokenizer.hh
index 79d0d3cd..4de7a637 100644
--- a/include/qpdf/QPDFTokenizer.hh
+++ b/include/qpdf/QPDFTokenizer.hh
@@ -28,7 +28,7 @@
#include <qpdf/PointerHolder.hh> // unused -- remove in qpdf 12 (see #785)
#include <memory>
-#include <stdio.h>
+#include <cstdio>
#include <string>
class QPDFTokenizer
diff --git a/include/qpdf/QPDFWriter.hh b/include/qpdf/QPDFWriter.hh
index c2896209..162d4f4e 100644
--- a/include/qpdf/QPDFWriter.hh
+++ b/include/qpdf/QPDFWriter.hh
@@ -34,7 +34,7 @@
#include <map>
#include <memory>
#include <set>
-#include <stdio.h>
+#include <cstdio>
#include <string>
#include <string_view>
#include <vector>
@@ -102,7 +102,7 @@ class QPDFWriter
QPDF_DLL
virtual ~FunctionProgressReporter();
QPDF_DLL
- virtual void reportProgress(int) override;
+ void reportProgress(int) override;
private:
std::function<void(int)> handler;
@@ -539,7 +539,7 @@ class QPDFWriter
friend class QPDFWriter;
public:
- PipelinePopper(QPDFWriter* qw, std::shared_ptr<Buffer>* bp = 0) :
+ PipelinePopper(QPDFWriter* qw, std::shared_ptr<Buffer>* bp = nullptr) :
qw(qw),
bp(bp)
{
diff --git a/include/qpdf/QUtil.hh b/include/qpdf/QUtil.hh
index 4d46f630..2f7f15b2 100644
--- a/include/qpdf/QUtil.hh
+++ b/include/qpdf/QUtil.hh
@@ -30,9 +30,9 @@
#include <list>
#include <memory>
#include <stdexcept>
-#include <stdio.h>
+#include <cstdio>
#include <string>
-#include <time.h>
+#include <ctime>
#include <vector>
class RandomDataProvider;
@@ -245,7 +245,7 @@ namespace QUtil
// Returns true iff the variable is defined. If `value' is
// non-null, initializes it with the value of the variable.
QPDF_DLL
- bool get_env(std::string const& var, std::string* value = 0);
+ bool get_env(std::string const& var, std::string* value = nullptr);
QPDF_DLL
time_t get_current_time();
diff --git a/include/qpdf/RandomDataProvider.hh b/include/qpdf/RandomDataProvider.hh
index 5023b4d0..d40bd1f1 100644
--- a/include/qpdf/RandomDataProvider.hh
+++ b/include/qpdf/RandomDataProvider.hh
@@ -23,7 +23,7 @@
#define RANDOMDATAPROVIDER_HH
#include <qpdf/DLL.h>
-#include <string.h> // for size_t
+#include <cstring> // for size_t
class QPDF_DLL_CLASS RandomDataProvider
{