From ba5a3567a262efdfc171decf481b716ea29743d6 Mon Sep 17 00:00:00 2001 From: m-holger Date: Sat, 20 May 2023 13:56:33 +0100 Subject: Remove redundant 'virtual' specifiers --- examples/pdf-custom-filter.cc | 12 ++++++------ examples/pdf-invert-images.cc | 2 +- include/qpdf/QPDFWriter.hh | 2 +- libqpdf/QPDF.cc | 14 +++++++------- libqpdf/QPDFLogger.cc | 4 ++-- libqpdf/QPDFNameTreeObjectHelper.cc | 6 +++--- libqpdf/QPDFNumberTreeObjectHelper.cc | 6 +++--- libqpdf/QPDFObjectHandle.cc | 4 ++-- libqpdf/QPDF_json.cc | 12 ++++++------ libqpdf/qpdf/Pl_Base64.hh | 4 ++-- libqpdf/qpdf/ResourceFinder.hh | 4 ++-- libqpdf/qpdf/SF_ASCII85Decode.hh | 2 +- libqpdf/qpdf/SF_ASCIIHexDecode.hh | 2 +- libqpdf/qpdf/SF_DCTDecode.hh | 6 +++--- libqpdf/qpdf/SF_RunLengthDecode.hh | 4 ++-- libtests/json_parse.cc | 12 ++++++------ 16 files changed, 48 insertions(+), 48 deletions(-) diff --git a/examples/pdf-custom-filter.cc b/examples/pdf-custom-filter.cc index f6977a21..30f02d5c 100644 --- a/examples/pdf-custom-filter.cc +++ b/examples/pdf-custom-filter.cc @@ -49,8 +49,8 @@ class Pl_XOR: public Pipeline public: Pl_XOR(char const* identifier, Pipeline* next, unsigned char key); virtual ~Pl_XOR() = default; - virtual void write(unsigned char const* data, size_t len) override; - virtual void finish() override; + void write(unsigned char const* data, size_t len) override; + void finish() override; private: unsigned char key; @@ -92,9 +92,9 @@ class SF_XORDecode: public QPDFStreamFilter // "uncompress" the stream by default. public: virtual ~SF_XORDecode() = default; - virtual bool setDecodeParms(QPDFObjectHandle decode_parms) override; - virtual Pipeline* getDecodePipeline(Pipeline* next) override; - virtual bool isSpecializedCompression() override; + bool setDecodeParms(QPDFObjectHandle decode_parms) override; + Pipeline* getDecodePipeline(Pipeline* next) override; + bool isSpecializedCompression() override; private: unsigned char key; @@ -200,7 +200,7 @@ class StreamReplacer: public QPDFObjectHandle::StreamDataProvider public: StreamReplacer(QPDF* pdf); virtual ~StreamReplacer() = default; - virtual void + void provideStreamData(QPDFObjGen const& og, Pipeline* pipeline) override; void registerStream( diff --git a/examples/pdf-invert-images.cc b/examples/pdf-invert-images.cc index 89989885..d714148c 100644 --- a/examples/pdf-invert-images.cc +++ b/examples/pdf-invert-images.cc @@ -34,7 +34,7 @@ class ImageInverter: public QPDFObjectHandle::StreamDataProvider { public: virtual ~ImageInverter() = default; - virtual void + void provideStreamData(QPDFObjGen const& og, Pipeline* pipeline) override; void registerImage( diff --git a/include/qpdf/QPDFWriter.hh b/include/qpdf/QPDFWriter.hh index 8305974c..162d4f4e 100644 --- a/include/qpdf/QPDFWriter.hh +++ b/include/qpdf/QPDFWriter.hh @@ -102,7 +102,7 @@ class QPDFWriter QPDF_DLL virtual ~FunctionProgressReporter(); QPDF_DLL - virtual void reportProgress(int) override; + void reportProgress(int) override; private: std::function handler; diff --git a/libqpdf/QPDF.cc b/libqpdf/QPDF.cc index 056d79fc..dcfd5f46 100644 --- a/libqpdf/QPDF.cc +++ b/libqpdf/QPDF.cc @@ -61,41 +61,41 @@ namespace { public: virtual ~InvalidInputSource() = default; - virtual qpdf_offset_t + qpdf_offset_t findAndSkipNextEOL() override { throwException(); return 0; } - virtual std::string const& + std::string const& getName() const override { static std::string name("closed input source"); return name; } - virtual qpdf_offset_t + qpdf_offset_t tell() override { throwException(); return 0; } - virtual void + void seek(qpdf_offset_t offset, int whence) override { throwException(); } - virtual void + void rewind() override { throwException(); } - virtual size_t + size_t read(char* buffer, size_t length) override { throwException(); return 0; } - virtual void + void unreadCh(char ch) override { throwException(); diff --git a/libqpdf/QPDFLogger.cc b/libqpdf/QPDFLogger.cc index 7fe21c97..15d80aab 100644 --- a/libqpdf/QPDFLogger.cc +++ b/libqpdf/QPDFLogger.cc @@ -17,14 +17,14 @@ namespace { } - virtual void + void write(unsigned char const* data, size_t len) override { this->used = true; getNext()->write(data, len); } - virtual void + void finish() override { getNext()->finish(); diff --git a/libqpdf/QPDFNameTreeObjectHelper.cc b/libqpdf/QPDFNameTreeObjectHelper.cc index f388dccf..574bb097 100644 --- a/libqpdf/QPDFNameTreeObjectHelper.cc +++ b/libqpdf/QPDFNameTreeObjectHelper.cc @@ -7,18 +7,18 @@ namespace class NameTreeDetails: public NNTreeDetails { public: - virtual std::string const& + std::string const& itemsKey() const override { static std::string k("/Names"); return k; } - virtual bool + bool keyValid(QPDFObjectHandle oh) const override { return oh.isString(); } - virtual int + int compareKeys(QPDFObjectHandle a, QPDFObjectHandle b) const override { if (!(keyValid(a) && keyValid(b))) { diff --git a/libqpdf/QPDFNumberTreeObjectHelper.cc b/libqpdf/QPDFNumberTreeObjectHelper.cc index 6443416d..08f790d4 100644 --- a/libqpdf/QPDFNumberTreeObjectHelper.cc +++ b/libqpdf/QPDFNumberTreeObjectHelper.cc @@ -8,18 +8,18 @@ namespace class NumberTreeDetails: public NNTreeDetails { public: - virtual std::string const& + std::string const& itemsKey() const override { static std::string k("/Nums"); return k; } - virtual bool + bool keyValid(QPDFObjectHandle oh) const override { return oh.isInteger(); } - virtual int + int compareKeys(QPDFObjectHandle a, QPDFObjectHandle b) const override { if (!(keyValid(a) && keyValid(b))) { diff --git a/libqpdf/QPDFObjectHandle.cc b/libqpdf/QPDFObjectHandle.cc index e276bf4f..8b30f95b 100644 --- a/libqpdf/QPDFObjectHandle.cc +++ b/libqpdf/QPDFObjectHandle.cc @@ -1446,13 +1446,13 @@ namespace { } - virtual void + void provideStreamData(QPDFObjGen const&, Pipeline* pipeline) override { p1(pipeline); } - virtual bool + bool provideStreamData( QPDFObjGen const&, Pipeline* pipeline, diff --git a/libqpdf/QPDF_json.cc b/libqpdf/QPDF_json.cc index 563e8e29..9e3cb3bb 100644 --- a/libqpdf/QPDF_json.cc +++ b/libqpdf/QPDF_json.cc @@ -242,13 +242,13 @@ class QPDF::JSONReactor: public JSON::Reactor } } virtual ~JSONReactor() = default; - virtual void dictionaryStart() override; - virtual void arrayStart() override; - virtual void containerEnd(JSON const& value) override; - virtual void topLevelScalar() override; - virtual bool + void dictionaryStart() override; + void arrayStart() override; + void containerEnd(JSON const& value) override; + void topLevelScalar() override; + bool dictionaryItem(std::string const& key, JSON const& value) override; - virtual bool arrayItem(JSON const& value) override; + bool arrayItem(JSON const& value) override; bool anyErrors() const; diff --git a/libqpdf/qpdf/Pl_Base64.hh b/libqpdf/qpdf/Pl_Base64.hh index 788bfd6d..0e490cfe 100644 --- a/libqpdf/qpdf/Pl_Base64.hh +++ b/libqpdf/qpdf/Pl_Base64.hh @@ -9,8 +9,8 @@ class Pl_Base64: public Pipeline enum action_e { a_encode, a_decode }; Pl_Base64(char const* identifier, Pipeline* next, action_e); virtual ~Pl_Base64() = default; - virtual void write(unsigned char const* buf, size_t len) override; - virtual void finish() override; + void write(unsigned char const* buf, size_t len) override; + void finish() override; private: void decode(unsigned char const* buf, size_t len); diff --git a/libqpdf/qpdf/ResourceFinder.hh b/libqpdf/qpdf/ResourceFinder.hh index d037e600..c4f5673b 100644 --- a/libqpdf/qpdf/ResourceFinder.hh +++ b/libqpdf/qpdf/ResourceFinder.hh @@ -8,8 +8,8 @@ class ResourceFinder: public QPDFObjectHandle::ParserCallbacks public: ResourceFinder(); virtual ~ResourceFinder() = default; - virtual void handleObject(QPDFObjectHandle, size_t, size_t) override; - virtual void handleEOF() override; + void handleObject(QPDFObjectHandle, size_t, size_t) override; + void handleEOF() override; std::set const& getNames() const; std::map>> const& getNamesByResourceType() const; diff --git a/libqpdf/qpdf/SF_ASCII85Decode.hh b/libqpdf/qpdf/SF_ASCII85Decode.hh index 0b77d2e4..f383364a 100644 --- a/libqpdf/qpdf/SF_ASCII85Decode.hh +++ b/libqpdf/qpdf/SF_ASCII85Decode.hh @@ -11,7 +11,7 @@ class SF_ASCII85Decode: public QPDFStreamFilter SF_ASCII85Decode() = default; virtual ~SF_ASCII85Decode() = default; - virtual Pipeline* + Pipeline* getDecodePipeline(Pipeline* next) override { this->pipeline = diff --git a/libqpdf/qpdf/SF_ASCIIHexDecode.hh b/libqpdf/qpdf/SF_ASCIIHexDecode.hh index 6454ce44..911f7370 100644 --- a/libqpdf/qpdf/SF_ASCIIHexDecode.hh +++ b/libqpdf/qpdf/SF_ASCIIHexDecode.hh @@ -11,7 +11,7 @@ class SF_ASCIIHexDecode: public QPDFStreamFilter SF_ASCIIHexDecode() = default; virtual ~SF_ASCIIHexDecode() = default; - virtual Pipeline* + Pipeline* getDecodePipeline(Pipeline* next) override { this->pipeline = diff --git a/libqpdf/qpdf/SF_DCTDecode.hh b/libqpdf/qpdf/SF_DCTDecode.hh index f9b1af3a..997ba89a 100644 --- a/libqpdf/qpdf/SF_DCTDecode.hh +++ b/libqpdf/qpdf/SF_DCTDecode.hh @@ -11,7 +11,7 @@ class SF_DCTDecode: public QPDFStreamFilter SF_DCTDecode() = default; virtual ~SF_DCTDecode() = default; - virtual Pipeline* + Pipeline* getDecodePipeline(Pipeline* next) override { this->pipeline = std::make_shared("DCT decode", next); @@ -24,13 +24,13 @@ class SF_DCTDecode: public QPDFStreamFilter return std::make_shared(); } - virtual bool + bool isSpecializedCompression() override { return true; } - virtual bool + bool isLossyCompression() override { return true; diff --git a/libqpdf/qpdf/SF_RunLengthDecode.hh b/libqpdf/qpdf/SF_RunLengthDecode.hh index a1c8c80a..9dec379d 100644 --- a/libqpdf/qpdf/SF_RunLengthDecode.hh +++ b/libqpdf/qpdf/SF_RunLengthDecode.hh @@ -11,7 +11,7 @@ class SF_RunLengthDecode: public QPDFStreamFilter SF_RunLengthDecode() = default; virtual ~SF_RunLengthDecode() = default; - virtual Pipeline* + Pipeline* getDecodePipeline(Pipeline* next) override { this->pipeline = std::make_shared( @@ -25,7 +25,7 @@ class SF_RunLengthDecode: public QPDFStreamFilter return std::make_shared(); } - virtual bool + bool isSpecializedCompression() override { return true; diff --git a/libtests/json_parse.cc b/libtests/json_parse.cc index ed69784e..31381ebf 100644 --- a/libtests/json_parse.cc +++ b/libtests/json_parse.cc @@ -11,13 +11,13 @@ namespace { public: virtual ~Reactor() = default; - virtual void dictionaryStart() override; - virtual void arrayStart() override; - virtual void containerEnd(JSON const& value) override; - virtual void topLevelScalar() override; - virtual bool + void dictionaryStart() override; + void arrayStart() override; + void containerEnd(JSON const& value) override; + void topLevelScalar() override; + bool dictionaryItem(std::string const& key, JSON const& value) override; - virtual bool arrayItem(JSON const& value) override; + bool arrayItem(JSON const& value) override; private: void printItem(JSON const&); -- cgit v1.2.3-54-g00ecf