Commit ae3642ce42e23bc454ee81e6383100b696670b37

Authored by m-holger
1 parent 5906dd5c

Code tidy - Clang-Tidy rule modernize-use-equals-default

examples/pdf-count-strings.cc
@@ -26,9 +26,7 @@ usage() @@ -26,9 +26,7 @@ usage()
26 class StringCounter: public QPDFObjectHandle::TokenFilter 26 class StringCounter: public QPDFObjectHandle::TokenFilter
27 { 27 {
28 public: 28 public:
29 - StringCounter()  
30 - {  
31 - } 29 + StringCounter() = default;
32 ~StringCounter() override = default; 30 ~StringCounter() override = default;
33 void handleToken(QPDFTokenizer::Token const&) override; 31 void handleToken(QPDFTokenizer::Token const&) override;
34 void handleEOF() override; 32 void handleEOF() override;
include/qpdf/QPDF.hh
@@ -1150,10 +1150,6 @@ class QPDF @@ -1150,10 +1150,6 @@ class QPDF
1150 // PDF 1.4: Table F.4 1150 // PDF 1.4: Table F.4
1151 struct HPageOffsetEntry 1151 struct HPageOffsetEntry
1152 { 1152 {
1153 - HPageOffsetEntry()  
1154 - {  
1155 - }  
1156 -  
1157 int delta_nobjects{0}; // 1 1153 int delta_nobjects{0}; // 1
1158 qpdf_offset_t delta_page_length{0}; // 2 1154 qpdf_offset_t delta_page_length{0}; // 2
1159 // vectors' sizes = nshared_objects 1155 // vectors' sizes = nshared_objects
@@ -1167,10 +1163,6 @@ class QPDF @@ -1167,10 +1163,6 @@ class QPDF
1167 // PDF 1.4: Table F.3 1163 // PDF 1.4: Table F.3
1168 struct HPageOffset 1164 struct HPageOffset
1169 { 1165 {
1170 - HPageOffset()  
1171 - {  
1172 - }  
1173 -  
1174 int min_nobjects{0}; // 1 1166 int min_nobjects{0}; // 1
1175 qpdf_offset_t first_page_offset{0}; // 2 1167 qpdf_offset_t first_page_offset{0}; // 2
1176 int nbits_delta_nobjects{0}; // 3 1168 int nbits_delta_nobjects{0}; // 3
@@ -1191,10 +1183,6 @@ class QPDF @@ -1191,10 +1183,6 @@ class QPDF
1191 // PDF 1.4: Table F.6 1183 // PDF 1.4: Table F.6
1192 struct HSharedObjectEntry 1184 struct HSharedObjectEntry
1193 { 1185 {
1194 - HSharedObjectEntry()  
1195 - {  
1196 - }  
1197 -  
1198 // Item 3 is a 128-bit signature (unsupported by Acrobat) 1186 // Item 3 is a 128-bit signature (unsupported by Acrobat)
1199 int delta_group_length{0}; // 1 1187 int delta_group_length{0}; // 1
1200 int signature_present{0}; // 2 -- always 0 1188 int signature_present{0}; // 2 -- always 0
@@ -1204,10 +1192,6 @@ class QPDF @@ -1204,10 +1192,6 @@ class QPDF
1204 // PDF 1.4: Table F.5 1192 // PDF 1.4: Table F.5
1205 struct HSharedObject 1193 struct HSharedObject
1206 { 1194 {
1207 - HSharedObject()  
1208 - {  
1209 - }  
1210 -  
1211 int first_shared_obj{0}; // 1 1195 int first_shared_obj{0}; // 1
1212 qpdf_offset_t first_shared_offset{0}; // 2 1196 qpdf_offset_t first_shared_offset{0}; // 2
1213 int nshared_first_page{0}; // 3 1197 int nshared_first_page{0}; // 3
@@ -1222,10 +1206,6 @@ class QPDF @@ -1222,10 +1206,6 @@ class QPDF
1222 // PDF 1.4: Table F.9 1206 // PDF 1.4: Table F.9
1223 struct HGeneric 1207 struct HGeneric
1224 { 1208 {
1225 - HGeneric()  
1226 - {  
1227 - }  
1228 -  
1229 int first_object{0}; // 1 1209 int first_object{0}; // 1
1230 qpdf_offset_t first_object_offset{0}; // 2 1210 qpdf_offset_t first_object_offset{0}; // 2
1231 int nobjects{0}; // 3 1211 int nobjects{0}; // 3
@@ -1237,10 +1217,6 @@ class QPDF @@ -1237,10 +1217,6 @@ class QPDF
1237 // Initialized from Linearization Parameter dictionary 1217 // Initialized from Linearization Parameter dictionary
1238 struct LinParameters 1218 struct LinParameters
1239 { 1219 {
1240 - LinParameters()  
1241 - {  
1242 - }  
1243 -  
1244 qpdf_offset_t file_size{0}; // /L 1220 qpdf_offset_t file_size{0}; // /L
1245 int first_page_object{0}; // /O 1221 int first_page_object{0}; // /O
1246 qpdf_offset_t first_page_end{0}; // /E 1222 qpdf_offset_t first_page_end{0}; // /E
@@ -1264,10 +1240,6 @@ class QPDF @@ -1264,10 +1240,6 @@ class QPDF
1264 1240
1265 struct CHPageOffsetEntry 1241 struct CHPageOffsetEntry
1266 { 1242 {
1267 - CHPageOffsetEntry()  
1268 - {  
1269 - }  
1270 -  
1271 int nobjects{0}; 1243 int nobjects{0};
1272 int nshared_objects{0}; 1244 int nshared_objects{0};
1273 // vectors' sizes = nshared_objects 1245 // vectors' sizes = nshared_objects
@@ -1293,10 +1265,6 @@ class QPDF @@ -1293,10 +1265,6 @@ class QPDF
1293 // PDF 1.4: Table F.5 1265 // PDF 1.4: Table F.5
1294 struct CHSharedObject 1266 struct CHSharedObject
1295 { 1267 {
1296 - CHSharedObject()  
1297 - {  
1298 - }  
1299 -  
1300 int first_shared_obj{0}; 1268 int first_shared_obj{0};
1301 int nshared_first_page{0}; 1269 int nshared_first_page{0};
1302 int nshared_total{0}; 1270 int nshared_total{0};
include/qpdf/QPDFJob.hh
@@ -145,10 +145,6 @@ class QPDFJob @@ -145,10 +145,6 @@ class QPDFJob
145 145
146 struct AddAttachment 146 struct AddAttachment
147 { 147 {
148 - AddAttachment()  
149 - {  
150 - }  
151 -  
152 std::string path; 148 std::string path;
153 std::string key; 149 std::string key;
154 std::string filename; 150 std::string filename;
libqpdf/ClosedFileInputSource.cc
@@ -9,7 +9,7 @@ ClosedFileInputSource::ClosedFileInputSource(char const* filename) : @@ -9,7 +9,7 @@ ClosedFileInputSource::ClosedFileInputSource(char const* filename) :
9 { 9 {
10 } 10 }
11 11
12 -ClosedFileInputSource::~ClosedFileInputSource() 12 +ClosedFileInputSource::~ClosedFileInputSource() // NOLINT (modernize-use-equals-default)
13 { 13 {
14 // Must be explicit and not inline -- see QPDF_DLL_CLASS in README-maintainer 14 // Must be explicit and not inline -- see QPDF_DLL_CLASS in README-maintainer
15 } 15 }
libqpdf/Pl_Buffer.cc
@@ -11,7 +11,7 @@ Pl_Buffer::Pl_Buffer(char const* identifier, Pipeline* next) : @@ -11,7 +11,7 @@ Pl_Buffer::Pl_Buffer(char const* identifier, Pipeline* next) :
11 { 11 {
12 } 12 }
13 13
14 -Pl_Buffer::~Pl_Buffer() 14 +Pl_Buffer::~Pl_Buffer() // NOLINT (modernize-use-equals-default)
15 { 15 {
16 // Must be explicit and not inline -- see QPDF_DLL_CLASS in README-maintainer 16 // Must be explicit and not inline -- see QPDF_DLL_CLASS in README-maintainer
17 } 17 }
libqpdf/Pl_Concatenate.cc
@@ -5,7 +5,7 @@ Pl_Concatenate::Pl_Concatenate(char const* identifier, Pipeline* next) : @@ -5,7 +5,7 @@ Pl_Concatenate::Pl_Concatenate(char const* identifier, Pipeline* next) :
5 { 5 {
6 } 6 }
7 7
8 -Pl_Concatenate::~Pl_Concatenate() 8 +Pl_Concatenate::~Pl_Concatenate() // NOLINT (modernize-use-equals-default)
9 { 9 {
10 // Must be explicit and not inline -- see QPDF_DLL_CLASS in README-maintainer 10 // Must be explicit and not inline -- see QPDF_DLL_CLASS in README-maintainer
11 } 11 }
libqpdf/Pl_Count.cc
@@ -14,7 +14,7 @@ Pl_Count::Pl_Count(char const* identifier, Pipeline* next) : @@ -14,7 +14,7 @@ Pl_Count::Pl_Count(char const* identifier, Pipeline* next) :
14 { 14 {
15 } 15 }
16 16
17 -Pl_Count::~Pl_Count() 17 +Pl_Count::~Pl_Count() // NOLINT (modernize-use-equals-default)
18 { 18 {
19 // Must be explicit and not inline -- see QPDF_DLL_CLASS in README-maintainer 19 // Must be explicit and not inline -- see QPDF_DLL_CLASS in README-maintainer
20 } 20 }
libqpdf/Pl_DCT.cc
@@ -75,7 +75,7 @@ Pl_DCT::Pl_DCT( @@ -75,7 +75,7 @@ Pl_DCT::Pl_DCT(
75 { 75 {
76 } 76 }
77 77
78 -Pl_DCT::~Pl_DCT() 78 +Pl_DCT::~Pl_DCT() // NOLINT (modernize-use-equals-default)
79 { 79 {
80 // Must be explicit and not inline -- see QPDF_DLL_CLASS in README-maintainer 80 // Must be explicit and not inline -- see QPDF_DLL_CLASS in README-maintainer
81 } 81 }
libqpdf/Pl_Discard.cc
@@ -7,7 +7,7 @@ Pl_Discard::Pl_Discard() : @@ -7,7 +7,7 @@ Pl_Discard::Pl_Discard() :
7 { 7 {
8 } 8 }
9 9
10 -Pl_Discard::~Pl_Discard() 10 +Pl_Discard::~Pl_Discard() // NOLINT (modernize-use-equals-default)
11 { 11 {
12 // Must be explicit and not inline -- see QPDF_DLL_CLASS in README-maintainer 12 // Must be explicit and not inline -- see QPDF_DLL_CLASS in README-maintainer
13 } 13 }
libqpdf/Pl_Flate.cc
@@ -58,7 +58,7 @@ Pl_Flate::Pl_Flate( @@ -58,7 +58,7 @@ Pl_Flate::Pl_Flate(
58 { 58 {
59 } 59 }
60 60
61 -Pl_Flate::~Pl_Flate() 61 +Pl_Flate::~Pl_Flate() // NOLINT (modernize-use-equals-default)
62 { 62 {
63 // Must be explicit and not inline -- see QPDF_DLL_CLASS in README-maintainer 63 // Must be explicit and not inline -- see QPDF_DLL_CLASS in README-maintainer
64 } 64 }
libqpdf/Pl_Function.cc
@@ -39,7 +39,7 @@ Pl_Function::Pl_Function(char const* identifier, Pipeline* next, writer_c_char_t @@ -39,7 +39,7 @@ Pl_Function::Pl_Function(char const* identifier, Pipeline* next, writer_c_char_t
39 }; 39 };
40 } 40 }
41 41
42 -Pl_Function::~Pl_Function() 42 +Pl_Function::~Pl_Function() // NOLINT (modernize-use-equals-default)
43 { 43 {
44 // Must be explicit and not inline -- see QPDF_DLL_CLASS in README-maintainer 44 // Must be explicit and not inline -- see QPDF_DLL_CLASS in README-maintainer
45 } 45 }
libqpdf/Pl_OStream.cc
@@ -13,7 +13,7 @@ Pl_OStream::Pl_OStream(char const* identifier, std::ostream& os) : @@ -13,7 +13,7 @@ Pl_OStream::Pl_OStream(char const* identifier, std::ostream& os) :
13 { 13 {
14 } 14 }
15 15
16 -Pl_OStream::~Pl_OStream() 16 +Pl_OStream::~Pl_OStream() // NOLINT (modernize-use-equals-default)
17 { 17 {
18 // Must be explicit and not inline -- see QPDF_DLL_CLASS in README-maintainer 18 // Must be explicit and not inline -- see QPDF_DLL_CLASS in README-maintainer
19 } 19 }
libqpdf/Pl_QPDFTokenizer.cc
@@ -21,7 +21,7 @@ Pl_QPDFTokenizer::Pl_QPDFTokenizer( @@ -21,7 +21,7 @@ Pl_QPDFTokenizer::Pl_QPDFTokenizer(
21 m->tokenizer.includeIgnorable(); 21 m->tokenizer.includeIgnorable();
22 } 22 }
23 23
24 -Pl_QPDFTokenizer::~Pl_QPDFTokenizer() 24 +Pl_QPDFTokenizer::~Pl_QPDFTokenizer() // NOLINT (modernize-use-equals-default)
25 { 25 {
26 // Must be explicit and not inline -- see QPDF_DLL_CLASS in README-maintainer 26 // Must be explicit and not inline -- see QPDF_DLL_CLASS in README-maintainer
27 } 27 }
libqpdf/Pl_RunLength.cc
@@ -16,7 +16,7 @@ Pl_RunLength::Pl_RunLength(char const* identifier, Pipeline* next, action_e acti @@ -16,7 +16,7 @@ Pl_RunLength::Pl_RunLength(char const* identifier, Pipeline* next, action_e acti
16 { 16 {
17 } 17 }
18 18
19 -Pl_RunLength::~Pl_RunLength() 19 +Pl_RunLength::~Pl_RunLength() // NOLINT (modernize-use-equals-default)
20 { 20 {
21 // Must be explicit and not inline -- see QPDF_DLL_CLASS in README-maintainer 21 // Must be explicit and not inline -- see QPDF_DLL_CLASS in README-maintainer
22 } 22 }
libqpdf/Pl_StdioFile.cc
@@ -17,7 +17,7 @@ Pl_StdioFile::Pl_StdioFile(char const* identifier, FILE* f) : @@ -17,7 +17,7 @@ Pl_StdioFile::Pl_StdioFile(char const* identifier, FILE* f) :
17 { 17 {
18 } 18 }
19 19
20 -Pl_StdioFile::~Pl_StdioFile() 20 +Pl_StdioFile::~Pl_StdioFile() // NOLINT (modernize-use-equals-default)
21 { 21 {
22 // Must be explicit and not inline -- see QPDF_DLL_CLASS in README-maintainer 22 // Must be explicit and not inline -- see QPDF_DLL_CLASS in README-maintainer
23 } 23 }
libqpdf/Pl_String.cc
@@ -13,7 +13,7 @@ Pl_String::Pl_String(char const* identifier, Pipeline* next, std::string& s) : @@ -13,7 +13,7 @@ Pl_String::Pl_String(char const* identifier, Pipeline* next, std::string& s) :
13 { 13 {
14 } 14 }
15 15
16 -Pl_String::~Pl_String() 16 +Pl_String::~Pl_String() // NOLINT (modernize-use-equals-default)
17 { 17 {
18 // Must be explicit and not inline -- see QPDF_DLL_CLASS in README-maintainer 18 // Must be explicit and not inline -- see QPDF_DLL_CLASS in README-maintainer
19 } 19 }
libqpdf/QPDFDocumentHelper.cc
1 #include <qpdf/QPDFDocumentHelper.hh> 1 #include <qpdf/QPDFDocumentHelper.hh>
2 2
3 -QPDFDocumentHelper::~QPDFDocumentHelper() 3 +QPDFDocumentHelper::~QPDFDocumentHelper() // NOLINT (modernize-use-equals-default)
4 { 4 {
5 // Must be explicit and not inline -- see QPDF_DLL_CLASS in README-maintainer 5 // Must be explicit and not inline -- see QPDF_DLL_CLASS in README-maintainer
6 } 6 }
libqpdf/QPDFFormFieldObjectHelper.cc
@@ -647,10 +647,8 @@ namespace @@ -647,10 +647,8 @@ namespace
647 class TfFinder: public QPDFObjectHandle::TokenFilter 647 class TfFinder: public QPDFObjectHandle::TokenFilter
648 { 648 {
649 public: 649 public:
650 - TfFinder();  
651 - ~TfFinder() override  
652 - {  
653 - } 650 + TfFinder() = default;
  651 + ~TfFinder() override = default;
654 void handleToken(QPDFTokenizer::Token const&) override; 652 void handleToken(QPDFTokenizer::Token const&) override;
655 double getTf(); 653 double getTf();
656 std::string getFontName(); 654 std::string getFontName();
@@ -667,10 +665,6 @@ namespace @@ -667,10 +665,6 @@ namespace
667 }; 665 };
668 } // namespace 666 } // namespace
669 667
670 -TfFinder::TfFinder()  
671 -{  
672 -}  
673 -  
674 void 668 void
675 TfFinder::handleToken(QPDFTokenizer::Token const& token) 669 TfFinder::handleToken(QPDFTokenizer::Token const& token)
676 { 670 {
libqpdf/QPDFNameTreeObjectHelper.cc
@@ -34,7 +34,7 @@ namespace @@ -34,7 +34,7 @@ namespace
34 34
35 static NameTreeDetails name_tree_details; 35 static NameTreeDetails name_tree_details;
36 36
37 -QPDFNameTreeObjectHelper::~QPDFNameTreeObjectHelper() 37 +QPDFNameTreeObjectHelper::~QPDFNameTreeObjectHelper() // NOLINT (modernize-use-equals-default)
38 { 38 {
39 // Must be explicit and not inline -- see QPDF_DLL_CLASS in README-maintainer. For this specific 39 // Must be explicit and not inline -- see QPDF_DLL_CLASS in README-maintainer. For this specific
40 // class, see github issue #745. 40 // class, see github issue #745.
libqpdf/QPDFNumberTreeObjectHelper.cc
@@ -35,7 +35,7 @@ namespace @@ -35,7 +35,7 @@ namespace
35 35
36 static NumberTreeDetails number_tree_details; 36 static NumberTreeDetails number_tree_details;
37 37
38 -QPDFNumberTreeObjectHelper::~QPDFNumberTreeObjectHelper() 38 +QPDFNumberTreeObjectHelper::~QPDFNumberTreeObjectHelper() // NOLINT (modernize-use-equals-default)
39 { 39 {
40 // Must be explicit and not inline -- see QPDF_DLL_CLASS in README-maintainer. For this specific 40 // Must be explicit and not inline -- see QPDF_DLL_CLASS in README-maintainer. For this specific
41 // class, see github issue #745. 41 // class, see github issue #745.
libqpdf/QPDFObjectHandle.cc
@@ -49,7 +49,7 @@ QPDFObjectHandle::StreamDataProvider::StreamDataProvider(bool supports_retry) : @@ -49,7 +49,7 @@ QPDFObjectHandle::StreamDataProvider::StreamDataProvider(bool supports_retry) :
49 { 49 {
50 } 50 }
51 51
52 -QPDFObjectHandle::StreamDataProvider::~StreamDataProvider() 52 +QPDFObjectHandle::StreamDataProvider::~StreamDataProvider() // NOLINT (modernize-use-equals-default)
53 { 53 {
54 // Must be explicit and not inline -- see QPDF_DLL_CLASS in README-maintainer 54 // Must be explicit and not inline -- see QPDF_DLL_CLASS in README-maintainer
55 } 55 }
libqpdf/QPDFObjectHelper.cc
1 #include <qpdf/QPDFObjectHelper.hh> 1 #include <qpdf/QPDFObjectHelper.hh>
2 2
3 -QPDFObjectHelper::~QPDFObjectHelper() 3 +QPDFObjectHelper::~QPDFObjectHelper() // NOLINT (modernize-use-equals-default)
4 { 4 {
5 // Must be explicit and not inline -- see QPDF_DLL_CLASS in README-maintainer 5 // Must be explicit and not inline -- see QPDF_DLL_CLASS in README-maintainer
6 } 6 }
libqpdf/QPDFWriter.cc
@@ -26,7 +26,7 @@ @@ -26,7 +26,7 @@
26 #include <cstdlib> 26 #include <cstdlib>
27 #include <stdexcept> 27 #include <stdexcept>
28 28
29 -QPDFWriter::ProgressReporter::~ProgressReporter() 29 +QPDFWriter::ProgressReporter::~ProgressReporter() // NOLINT (modernize-use-equals-default)
30 { 30 {
31 // Must be explicit and not inline -- see QPDF_DLL_CLASS in README-maintainer 31 // Must be explicit and not inline -- see QPDF_DLL_CLASS in README-maintainer
32 } 32 }
@@ -36,7 +36,8 @@ QPDFWriter::FunctionProgressReporter::FunctionProgressReporter(std::function&lt;voi @@ -36,7 +36,8 @@ QPDFWriter::FunctionProgressReporter::FunctionProgressReporter(std::function&lt;voi
36 { 36 {
37 } 37 }
38 38
39 -QPDFWriter::FunctionProgressReporter::~FunctionProgressReporter() 39 +QPDFWriter::FunctionProgressReporter::~FunctionProgressReporter() // NOLINT
  40 + // (modernize-use-equals-default)
40 { 41 {
41 // Must be explicit and not inline -- see QPDF_DLL_CLASS in README-maintainer 42 // Must be explicit and not inline -- see QPDF_DLL_CLASS in README-maintainer
42 } 43 }
libqpdf/QPDFXRefEntry.cc
@@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
3 #include <qpdf/QIntC.hh> 3 #include <qpdf/QIntC.hh>
4 #include <qpdf/QPDFExc.hh> 4 #include <qpdf/QPDFExc.hh>
5 5
6 -QPDFXRefEntry::QPDFXRefEntry() 6 +QPDFXRefEntry::QPDFXRefEntry() // NOLINT (modernize-use-equals-default)
7 { 7 {
8 } 8 }
9 9
libqpdf/qpdf/QPDFArgParser.hh
@@ -145,9 +145,6 @@ class QPDFArgParser @@ -145,9 +145,6 @@ class QPDFArgParser
145 private: 145 private:
146 struct OptionEntry 146 struct OptionEntry
147 { 147 {
148 - OptionEntry()  
149 - {  
150 - }  
151 bool parameter_needed{false}; 148 bool parameter_needed{false};
152 std::string parameter_name; 149 std::string parameter_name;
153 std::set<std::string> choices; 150 std::set<std::string> choices;
libtests/dct_compress.cc
@@ -17,9 +17,7 @@ usage() @@ -17,9 +17,7 @@ usage()
17 class Callback: public Pl_DCT::CompressConfig 17 class Callback: public Pl_DCT::CompressConfig
18 { 18 {
19 public: 19 public:
20 - Callback()  
21 - {  
22 - } 20 + Callback() = default;
23 ~Callback() override = default; 21 ~Callback() override = default;
24 void apply(jpeg_compress_struct*) override; 22 void apply(jpeg_compress_struct*) override;
25 bool called{false}; 23 bool called{false};