From a6f1f829dbad51ef0a6a5d9262e5c49e32dba45a Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Fri, 3 Apr 2020 12:04:54 -0400 Subject: [PATCH] Use deleted copy/assignment (C++11) --- include/qpdf/ClosedFileInputSource.hh | 4 ++-- include/qpdf/FileInputSource.hh | 4 ++-- include/qpdf/PointerHolder.hh | 4 ++-- include/qpdf/QPDF.hh | 4 ++-- include/qpdf/QPDFTokenizer.hh | 5 ++--- include/qpdf/RandomDataProvider.hh | 4 ++-- 6 files changed, 12 insertions(+), 13 deletions(-) diff --git a/include/qpdf/ClosedFileInputSource.hh b/include/qpdf/ClosedFileInputSource.hh index 6b512b4e..65948987 100644 --- a/include/qpdf/ClosedFileInputSource.hh +++ b/include/qpdf/ClosedFileInputSource.hh @@ -63,8 +63,8 @@ class ClosedFileInputSource: public InputSource void stayOpen(bool); private: - ClosedFileInputSource(ClosedFileInputSource const&); - ClosedFileInputSource& operator=(ClosedFileInputSource const&); + ClosedFileInputSource(ClosedFileInputSource const&) = delete; + ClosedFileInputSource& operator=(ClosedFileInputSource const&) = delete; void before(); void after(); diff --git a/include/qpdf/FileInputSource.hh b/include/qpdf/FileInputSource.hh index 72586338..d83ddff8 100644 --- a/include/qpdf/FileInputSource.hh +++ b/include/qpdf/FileInputSource.hh @@ -51,8 +51,8 @@ class FileInputSource: public InputSource virtual void unreadCh(char ch); private: - FileInputSource(FileInputSource const&); - FileInputSource& operator=(FileInputSource const&); + FileInputSource(FileInputSource const&) = delete; + FileInputSource& operator=(FileInputSource const&) = delete; class Members { diff --git a/include/qpdf/PointerHolder.hh b/include/qpdf/PointerHolder.hh index 03f0b682..48b99a30 100644 --- a/include/qpdf/PointerHolder.hh +++ b/include/qpdf/PointerHolder.hh @@ -78,8 +78,8 @@ class PointerHolder bool array; int refcount; private: - Data(Data const&); - Data& operator=(Data const&); + Data(Data const&) = delete; + Data& operator=(Data const&) = delete; }; public: diff --git a/include/qpdf/QPDF.hh b/include/qpdf/QPDF.hh index 86ea837b..1455736c 100644 --- a/include/qpdf/QPDF.hh +++ b/include/qpdf/QPDF.hh @@ -393,8 +393,8 @@ class QPDF std::string const& Perms); private: - EncryptionData(EncryptionData const&); - EncryptionData& operator=(EncryptionData const&); + EncryptionData(EncryptionData const&) = delete; + EncryptionData& operator=(EncryptionData const&) = delete; int V; int R; diff --git a/include/qpdf/QPDFTokenizer.hh b/include/qpdf/QPDFTokenizer.hh index 9b132be3..abfb34c0 100644 --- a/include/qpdf/QPDFTokenizer.hh +++ b/include/qpdf/QPDFTokenizer.hh @@ -183,9 +183,8 @@ class QPDFTokenizer void expectInlineImage(PointerHolder input); private: - // Do not implement copy or assignment - QPDFTokenizer(QPDFTokenizer const&); - QPDFTokenizer& operator=(QPDFTokenizer const&); + QPDFTokenizer(QPDFTokenizer const&) = delete; + QPDFTokenizer& operator=(QPDFTokenizer const&) = delete; void resolveLiteral(); bool isSpace(char); diff --git a/include/qpdf/RandomDataProvider.hh b/include/qpdf/RandomDataProvider.hh index 645a21ae..f050628e 100644 --- a/include/qpdf/RandomDataProvider.hh +++ b/include/qpdf/RandomDataProvider.hh @@ -39,8 +39,8 @@ class QPDF_DLL_CLASS RandomDataProvider } private: - RandomDataProvider(RandomDataProvider const&); - RandomDataProvider& operator=(RandomDataProvider const&); + RandomDataProvider(RandomDataProvider const&) = delete; + RandomDataProvider& operator=(RandomDataProvider const&) = delete; }; #endif // RANDOMDATAPROVIDER_HH