.gitlab-ci.yml | 2 +- cpp/poppler-global.h | 6 +++--- goo/JpegWriter.h | 6 +++--- goo/PNGWriter.h | 6 +++--- goo/TiffWriter.h | 6 +++--- goo/gdir.h | 14 ++++++++------ poppler/CertificateInfo.h | 6 +++--- poppler/JPEG2000Stream.h | 6 ++++-- poppler/SignatureInfo.h | 6 +++--- 9 files changed, 31 insertions(+), 27 deletions(-)
New commits: commit fb285d2c611c5111268d09460d6d58c5fff5bd34 Author: Albert Astals Cid <[email protected]> Date: Mon Dec 2 19:44:23 2019 +0100 Enable modernize-use-equals-delete Not claiming copyright since the change is mechanical diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index dcd63b19..4dbc4d78 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -40,7 +40,7 @@ build_clang_libcpp: script: - git clone --branch ${CI_COMMIT_REF_NAME} --depth 1 ${TEST_DATA_URL} test-data || git clone --depth 1 ${UPSTREAM_TEST_DATA_URL} test-data - mkdir -p build && cd build - - CC=clang CXX=clang++ cmake -G Ninja -DCMAKE_CXX_FLAGS=-stdlib=libc++ -DTESTDATADIR=$PWD/../test-data -DCMAKE_CXX_CLANG_TIDY="clang-tidy;-header-filter=.;-checks=-*,performance-*,,bugprone-*,readability-inconsistent-declaration-parameter-name,readability-string-compare,modernize-deprecated-headers,modernize-make-unique,modernize-make-shared,modernize-use-override,-bugprone-narrowing-conversions,-bugprone-macro-parentheses,-bugprone-suspicious-string-compare,-bugprone-incorrect-roundings,-bugprone-undefined-memory-manipulation;-warnings-as-errors=*" .. + - CC=clang CXX=clang++ cmake -G Ninja -DCMAKE_CXX_FLAGS=-stdlib=libc++ -DTESTDATADIR=$PWD/../test-data -DCMAKE_CXX_CLANG_TIDY="clang-tidy;-header-filter=.;-checks=-*,performance-*,,bugprone-*,readability-inconsistent-declaration-parameter-name,readability-string-compare,modernize-deprecated-headers,modernize-make-unique,modernize-make-shared,modernize-use-override,modernize-use-equals-delete,-bugprone-narrowing-conversions,-bugprone-macro-parentheses,-bugprone-suspicious-string-compare,-bugprone-incorrect-roundings,-bugprone-undefined-memory-manipulation;-warnings-as-errors=*" .. - ninja - ctest --output-on-failure diff --git a/cpp/poppler-global.h b/cpp/poppler-global.h index b214aec2..03448e1c 100644 --- a/cpp/poppler-global.h +++ b/cpp/poppler-global.h @@ -49,12 +49,12 @@ namespace detail class POPPLER_CPP_EXPORT noncopyable { +public: + noncopyable(const noncopyable &) = delete; + const noncopyable& operator=(const noncopyable &) = delete; protected: noncopyable(); ~noncopyable(); -private: - noncopyable(const noncopyable &); - const noncopyable& operator=(const noncopyable &); }; } diff --git a/goo/JpegWriter.h b/goo/JpegWriter.h index b2ce2541..cd0a9fc9 100644 --- a/goo/JpegWriter.h +++ b/goo/JpegWriter.h @@ -40,6 +40,9 @@ public: JpegWriter(Format format = RGB); ~JpegWriter() override; + JpegWriter(const JpegWriter &other) = delete; + JpegWriter& operator=(const JpegWriter &other) = delete; + void setQuality(int quality); void setProgressive(bool progressive); void setOptimize(bool optimize); @@ -52,9 +55,6 @@ public: bool supportCMYK() override; private: - JpegWriter(const JpegWriter &other); - JpegWriter& operator=(const JpegWriter &other); - JpegWriterPrivate *priv; }; diff --git a/goo/PNGWriter.h b/goo/PNGWriter.h index 0e0153e3..c9792cac 100644 --- a/goo/PNGWriter.h +++ b/goo/PNGWriter.h @@ -39,6 +39,9 @@ public: PNGWriter(Format format = RGB); ~PNGWriter() override; + PNGWriter(const PNGWriter &other) = delete; + PNGWriter& operator=(const PNGWriter &other) = delete; + void setICCProfile(const char *name, unsigned char *data, int size); void setSRGBProfile(); @@ -51,9 +54,6 @@ public: bool close() override; private: - PNGWriter(const PNGWriter &other); - PNGWriter& operator=(const PNGWriter &other); - PNGWriterPrivate *priv; }; diff --git a/goo/TiffWriter.h b/goo/TiffWriter.h index b0f5ae5b..743f7cee 100644 --- a/goo/TiffWriter.h +++ b/goo/TiffWriter.h @@ -38,6 +38,9 @@ public: TiffWriter(Format format = RGB); ~TiffWriter() override; + TiffWriter(const TiffWriter &other) = delete; + TiffWriter& operator=(const TiffWriter &other) = delete; + void setCompressionString(const char *compressionStringArg); bool init(FILE *openedFile, int width, int height, int hDPI, int vDPI) override; @@ -50,9 +53,6 @@ public: bool close() override; private: - TiffWriter(const TiffWriter &other); - TiffWriter& operator=(const TiffWriter &other); - TiffWriterPrivate *priv; }; diff --git a/goo/gdir.h b/goo/gdir.h index dd766def..dfd5ebca 100644 --- a/goo/gdir.h +++ b/goo/gdir.h @@ -48,14 +48,15 @@ public: GDirEntry(const char *dirPath, const char *nameA, bool doStat); ~GDirEntry(); + + GDirEntry(const GDirEntry &other) = delete; + GDirEntry& operator=(const GDirEntry &other) = delete; + const GooString *getName() const { return name; } const GooString *getFullPath() const { return fullPath; } bool isDir() const { return dir; } private: - GDirEntry(const GDirEntry &other); - GDirEntry& operator=(const GDirEntry &other); - GooString *name; // dir/file name GooString *fullPath; bool dir; // is it a directory? @@ -66,13 +67,14 @@ public: GDir(const char *name, bool doStatA = true); ~GDir(); + + GDir(const GDir &other) = delete; + GDir& operator=(const GDir &other) = delete; + GDirEntry *getNextEntry(); void rewind(); private: - GDir(const GDir &other); - GDir& operator=(const GDir &other); - GooString *path; // directory path bool doStat; // call stat() for each entry? #if defined(_WIN32) diff --git a/poppler/CertificateInfo.h b/poppler/CertificateInfo.h index 4ecda2fe..1d12c9d9 100644 --- a/poppler/CertificateInfo.h +++ b/poppler/CertificateInfo.h @@ -43,6 +43,9 @@ public: X509CertificateInfo(); ~X509CertificateInfo(); + X509CertificateInfo(const X509CertificateInfo &) = delete; + X509CertificateInfo& operator=(const X509CertificateInfo &) = delete; + struct PublicKeyInfo { PublicKeyInfo(); @@ -103,9 +106,6 @@ public: void setIsSelfSigned(bool); private: - X509CertificateInfo(const X509CertificateInfo &) = delete; - X509CertificateInfo& operator=(const X509CertificateInfo &) = delete; - EntityInfo issuer_info; EntityInfo subject_info; PublicKeyInfo public_key_info; diff --git a/poppler/JPEG2000Stream.h b/poppler/JPEG2000Stream.h index 8b8300e6..104c6661 100644 --- a/poppler/JPEG2000Stream.h +++ b/poppler/JPEG2000Stream.h @@ -28,6 +28,10 @@ public: JPXStream(Stream *strA); ~JPXStream() override; + + JPXStream(const JPXStream &other) = delete; + JPXStream& operator=(const JPXStream &other) = delete; + StreamKind getKind() const override { return strJPX; } void reset() override; void close() override; @@ -42,8 +46,6 @@ public: return str->doGetChars(nChars, buffer); } private: - JPXStream(const JPXStream &other); - JPXStream& operator=(const JPXStream &other); JPXStreamPrivate *priv; void init(); diff --git a/poppler/SignatureInfo.h b/poppler/SignatureInfo.h index ee9dff22..6de83f62 100644 --- a/poppler/SignatureInfo.h +++ b/poppler/SignatureInfo.h @@ -49,6 +49,9 @@ public: SignatureInfo(SignatureValidationStatus, CertificateValidationStatus); ~SignatureInfo(); + SignatureInfo(const SignatureInfo &) = delete; + SignatureInfo& operator=(const SignatureInfo &) = delete; + /* GETTERS */ SignatureValidationStatus getSignatureValStatus(); CertificateValidationStatus getCertificateValStatus(); @@ -74,9 +77,6 @@ public: void setCertificateInfo(std::unique_ptr<X509CertificateInfo>); private: - SignatureInfo(const SignatureInfo &); - SignatureInfo& operator=(const SignatureInfo &); - SignatureValidationStatus sig_status; CertificateValidationStatus cert_status; std::unique_ptr<X509CertificateInfo> cert_info; _______________________________________________ poppler mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/poppler
