Commit 2229e37e88a8d497b4a04725a46d181326a3fa45

Authored by Jay Berkenbilt
1 parent 2abb3055

Add a blank line after the first header included in each source

Showing 63 changed files with 73 additions and 0 deletions
README-maintainer
... ... @@ -86,6 +86,15 @@ GOOGLE OSS-FUZZ
86 86  
87 87 CODING RULES
88 88  
  89 +* In a source file, include the header file that declares the source
  90 + class first followed by a blank line. If a config file is needed
  91 + first, put a blank line between that and the header followed by
  92 + another blank line. This assures that each header file is included
  93 + first at least once, thereby ensuring that it explicitly includes
  94 + all the headers it needs, which in turn alleviates lots of header
  95 + ordering problems. The blank line ensures that formatters don't
  96 + messt his up by resorting the headers.
  97 +
89 98 * Avoid atoi. Use QUtil::string_to_int instead. It does
90 99 overflow/underflow checking.
91 100  
... ...
libqpdf/AES_PDF_native.cc
1 1 #include <qpdf/AES_PDF_native.hh>
  2 +
2 3 #include <qpdf/QUtil.hh>
3 4 #include <cstring>
4 5 #include <assert.h>
... ...
libqpdf/BitStream.cc
1 1 #include <qpdf/BitStream.hh>
  2 +
2 3 #include <qpdf/QIntC.hh>
3 4  
4 5 // See comments in bits.cc
... ...
libqpdf/BufferInputSource.cc
1 1 #include <qpdf/BufferInputSource.hh>
  2 +
2 3 #include <qpdf/QIntC.hh>
3 4 #include <string.h>
4 5 #include <stdexcept>
... ...
libqpdf/ClosedFileInputSource.cc
1 1 #include <qpdf/ClosedFileInputSource.hh>
  2 +
2 3 #include <qpdf/FileInputSource.hh>
3 4  
4 5 ClosedFileInputSource::Members::Members(char const* filename) :
... ...
libqpdf/ContentNormalizer.cc
1 1 #include <qpdf/ContentNormalizer.hh>
  2 +
2 3 #include <qpdf/QUtil.hh>
3 4  
4 5 ContentNormalizer::ContentNormalizer() :
... ...
libqpdf/CryptoRandomDataProvider.cc
1 1 #include <qpdf/CryptoRandomDataProvider.hh>
  2 +
2 3 #include <qpdf/QPDFCryptoProvider.hh>
3 4  
4 5 CryptoRandomDataProvider::CryptoRandomDataProvider()
... ...
libqpdf/FileInputSource.cc
1 1 #include <qpdf/FileInputSource.hh>
  2 +
2 3 #include <string.h>
3 4 #include <qpdf/QUtil.hh>
4 5 #include <qpdf/QPDFExc.hh>
... ...
libqpdf/InputSource.cc
1 1 #include <qpdf/InputSource.hh>
  2 +
2 3 #include <string.h>
3 4 #include <stdexcept>
4 5 #include <qpdf/QTC.hh>
... ...
libqpdf/JSON.cc
1 1 #include <qpdf/JSON.hh>
  2 +
2 3 #include <qpdf/QUtil.hh>
3 4 #include <qpdf/QTC.hh>
4 5 #include <stdexcept>
... ...
libqpdf/JSONHandler.cc
1 1 #include <qpdf/JSONHandler.hh>
  2 +
2 3 #include <qpdf/QUtil.hh>
3 4 #include <qpdf/QTC.hh>
4 5 #include <qpdf/QPDFUsage.hh>
... ...
libqpdf/MD5.cc
1 1 #include <qpdf/MD5.hh>
  2 +
2 3 #include <qpdf/QUtil.hh>
3 4 #include <qpdf/QIntC.hh>
4 5 #include <qpdf/QPDFCryptoProvider.hh>
... ...
libqpdf/MD5_native.cc
... ... @@ -28,6 +28,7 @@
28 28 /////////////////////////////////////////////////////////////////////////
29 29  
30 30 #include <qpdf/MD5_native.hh>
  31 +
31 32 #include <qpdf/QUtil.hh>
32 33 #include <qpdf/QIntC.hh>
33 34  
... ...
libqpdf/NNTree.cc
1 1 #include <qpdf/NNTree.hh>
  2 +
2 3 #include <qpdf/QTC.hh>
3 4 #include <qpdf/QUtil.hh>
4 5  
... ...
libqpdf/OffsetInputSource.cc
1 1 #include <qpdf/OffsetInputSource.hh>
  2 +
2 3 #include <limits>
3 4 #include <sstream>
4 5 #include <stdexcept>
... ...
libqpdf/Pipeline.cc
1 1 #include <qpdf/Pipeline.hh>
  2 +
2 3 #include <stdexcept>
3 4  
4 5 Pipeline::Pipeline(char const* identifier, Pipeline* next) :
... ...
libqpdf/Pl_AES_PDF.cc
1 1 #include <qpdf/Pl_AES_PDF.hh>
  2 +
2 3 #include <qpdf/QUtil.hh>
3 4 #include <cstring>
4 5 #include <assert.h>
... ...
libqpdf/Pl_ASCII85Decoder.cc
1 1 #include <qpdf/Pl_ASCII85Decoder.hh>
  2 +
2 3 #include <qpdf/QTC.hh>
3 4 #include <stdexcept>
4 5 #include <string.h>
... ...
libqpdf/Pl_ASCIIHexDecoder.cc
1 1 #include <qpdf/Pl_ASCIIHexDecoder.hh>
  2 +
2 3 #include <qpdf/QTC.hh>
3 4 #include <stdexcept>
4 5 #include <string.h>
... ...
libqpdf/Pl_Buffer.cc
1 1 #include <qpdf/Pl_Buffer.hh>
  2 +
2 3 #include <stdexcept>
3 4 #include <algorithm>
4 5 #include <assert.h>
... ...
libqpdf/Pl_Count.cc
1 1 #include <qpdf/Pl_Count.hh>
  2 +
2 3 #include <qpdf/QIntC.hh>
3 4  
4 5 Pl_Count::Members::Members() :
... ...
libqpdf/Pl_Flate.cc
1 1 #include <qpdf/Pl_Flate.hh>
  2 +
2 3 #include <zlib.h>
3 4 #include <string.h>
4 5 #include <limits.h>
... ...
libqpdf/Pl_MD5.cc
1 1 #include <qpdf/Pl_MD5.hh>
  2 +
2 3 #include <stdexcept>
3 4  
4 5 Pl_MD5::Pl_MD5(char const* identifier, Pipeline* next) :
... ...
libqpdf/Pl_PNGFilter.cc
1 1 #include <qpdf/Pl_PNGFilter.hh>
  2 +
2 3 #include <qpdf/QTC.hh>
3 4 #include <stdexcept>
4 5 #include <string.h>
... ...
libqpdf/Pl_QPDFTokenizer.cc
1 1 #include <qpdf/Pl_QPDFTokenizer.hh>
  2 +
2 3 #include <qpdf/QTC.hh>
3 4 #include <qpdf/QUtil.hh>
4 5 #include <qpdf/BufferInputSource.hh>
... ...
libqpdf/Pl_RC4.cc
1 1 #include <qpdf/Pl_RC4.hh>
  2 +
2 3 #include <qpdf/QUtil.hh>
3 4  
4 5 Pl_RC4::Pl_RC4(char const* identifier, Pipeline* next,
... ...
libqpdf/Pl_SHA2.cc
1 1 #include <qpdf/Pl_SHA2.hh>
  2 +
2 3 #include <stdexcept>
3 4 #include <cstdio>
4 5 #include <qpdf/PointerHolder.hh>
... ...
libqpdf/Pl_StdioFile.cc
1 1 #include <qpdf/qpdf-config.h> // include first for large file support
  2 +
2 3 #include <qpdf/Pl_StdioFile.hh>
  4 +
3 5 #include <qpdf/QUtil.hh>
4 6 #include <stdexcept>
5 7 #include <errno.h>
... ...
libqpdf/Pl_TIFFPredictor.cc
1 1 #include <qpdf/Pl_TIFFPredictor.hh>
  2 +
2 3 #include <qpdf/QTC.hh>
3 4 #include <qpdf/BitStream.hh>
4 5 #include <qpdf/BitWriter.hh>
... ...
libqpdf/QPDF.cc
1 1 #include <qpdf/qpdf-config.h> // include first for large file support
  2 +
2 3 #include <qpdf/QPDF.hh>
3 4  
4 5 #include <atomic>
... ...
libqpdf/QPDFAnnotationObjectHelper.cc
1 1 #include <qpdf/QPDFAnnotationObjectHelper.hh>
  2 +
2 3 #include <qpdf/QTC.hh>
3 4 #include <qpdf/QPDFMatrix.hh>
4 5 #include <qpdf/QUtil.hh>
... ...
libqpdf/QPDFArgParser.cc
1 1 #include <qpdf/QPDFArgParser.hh>
  2 +
2 3 #include <qpdf/QUtil.hh>
3 4 #include <qpdf/QIntC.hh>
4 5 #include <qpdf/QTC.hh>
... ...
libqpdf/QPDFCryptoProvider.cc
1 1 #include <qpdf/QPDFCryptoProvider.hh>
  2 +
2 3 #include <qpdf/qpdf-config.h>
3 4 #include <qpdf/QUtil.hh>
4 5 #include <stdexcept>
... ...
libqpdf/QPDFCrypto_gnutls.cc
1 1 #include <qpdf/QPDFCrypto_gnutls.hh>
  2 +
2 3 #include <qpdf/QIntC.hh>
3 4 #include <qpdf/QUtil.hh>
4 5 #include <cstring>
... ...
libqpdf/QPDFCrypto_native.cc
1 1 #include <qpdf/QPDFCrypto_native.hh>
  2 +
2 3 #include <qpdf/QUtil.hh>
3 4  
4 5 #ifdef USE_INSECURE_RANDOM
... ...
libqpdf/QPDFEFStreamObjectHelper.cc
1 1 #include <qpdf/QPDFEFStreamObjectHelper.hh>
  2 +
2 3 #include <qpdf/QIntC.hh>
3 4 #include <qpdf/QUtil.hh>
4 5 #include <qpdf/Pl_Count.hh>
... ...
libqpdf/QPDFExc.cc
1 1 #include <qpdf/QPDFExc.hh>
  2 +
2 3 #include <qpdf/QUtil.hh>
3 4  
4 5 QPDFExc::QPDFExc(qpdf_error_code_e error_code,
... ...
libqpdf/QPDFFileSpecObjectHelper.cc
1 1 #include <qpdf/QPDFFileSpecObjectHelper.hh>
  2 +
2 3 #include <qpdf/QTC.hh>
3 4 #include <qpdf/QPDF.hh>
4 5 #include <qpdf/QUtil.hh>
... ...
libqpdf/QPDFFormFieldObjectHelper.cc
1 1 #include <qpdf/QPDFFormFieldObjectHelper.hh>
  2 +
2 3 #include <qpdf/QTC.hh>
3 4 #include <qpdf/QPDFAcroFormDocumentHelper.hh>
4 5 #include <qpdf/QPDFAnnotationObjectHelper.hh>
... ...
libqpdf/QPDFJob_argv.cc
... ... @@ -115,6 +115,7 @@ ArgParser::argVersion()
115 115 void
116 116 ArgParser::argCopyright()
117 117 {
  118 + // clang-format off
118 119 // Make sure the output looks right on an 80-column display.
119 120 // 1 2 3 4 5 6 7 8
120 121 // 12345678901234567890123456789012345678901234567890123456789012345678901234567890
... ... @@ -153,6 +154,7 @@ ArgParser::argCopyright()
153 154 << std::endl
154 155 << "see the manual for additional information."
155 156 << std::endl;
  157 + // clang-format on
156 158 }
157 159  
158 160 void
... ...
libqpdf/QPDFJob_config.cc
1 1 #include <qpdf/QPDFJob.hh>
  2 +
2 3 #include <qpdf/QUtil.hh>
3 4 #include <qpdf/QTC.hh>
4 5  
... ...
libqpdf/QPDFJob_json.cc
1 1 #include <qpdf/QPDFJob.hh>
  2 +
2 3 #include <qpdf/JSONHandler.hh>
3 4 #include <qpdf/QPDFUsage.hh>
4 5 #include <qpdf/QUtil.hh>
... ...
libqpdf/QPDFMatrix.cc
1 1 #include <qpdf/QPDFMatrix.hh>
  2 +
2 3 #include <qpdf/QUtil.hh>
3 4 #include <algorithm>
4 5  
... ...
libqpdf/QPDFNameTreeObjectHelper.cc
1 1 #include <qpdf/QPDFNameTreeObjectHelper.hh>
  2 +
2 3 #include <qpdf/NNTree.hh>
3 4  
4 5 class NameTreeDetails: public NNTreeDetails
... ...
libqpdf/QPDFNumberTreeObjectHelper.cc
1 1 #include <qpdf/QPDFNumberTreeObjectHelper.hh>
  2 +
2 3 #include <qpdf/NNTree.hh>
3 4 #include <qpdf/QIntC.hh>
4 5  
... ...
libqpdf/QPDFObjGen.cc
1 1 #include <qpdf/QPDFObjGen.hh>
  2 +
2 3 #include <qpdf/QUtil.hh>
3 4  
4 5 QPDFObjGen::QPDFObjGen() :
... ...
libqpdf/QPDFOutlineDocumentHelper.cc
1 1 #include <qpdf/QPDFOutlineDocumentHelper.hh>
  2 +
2 3 #include <qpdf/QTC.hh>
3 4  
4 5 QPDFOutlineDocumentHelper::Members::~Members()
... ...
libqpdf/QPDFOutlineObjectHelper.cc
1 1 #include <qpdf/QPDFOutlineObjectHelper.hh>
  2 +
2 3 #include <qpdf/QPDFOutlineDocumentHelper.hh>
3 4 #include <qpdf/QTC.hh>
4 5  
... ...
libqpdf/QPDFPageDocumentHelper.cc
1 1 #include <qpdf/QPDFPageDocumentHelper.hh>
  2 +
2 3 #include <qpdf/QPDFAcroFormDocumentHelper.hh>
3 4 #include <qpdf/QUtil.hh>
4 5 #include <qpdf/QTC.hh>
... ...
libqpdf/QPDFPageLabelDocumentHelper.cc
1 1 #include <qpdf/QPDFPageLabelDocumentHelper.hh>
  2 +
2 3 #include <qpdf/QTC.hh>
3 4  
4 5 QPDFPageLabelDocumentHelper::Members::~Members()
... ...
libqpdf/QPDFPageObjectHelper.cc
1 1 #include <qpdf/QPDFPageObjectHelper.hh>
  2 +
2 3 #include <qpdf/QTC.hh>
3 4 #include <qpdf/QPDF.hh>
4 5 #include <qpdf/Pl_Concatenate.hh>
... ...
libqpdf/QPDFSystemError.cc
1 1 #include <qpdf/QPDFSystemError.hh>
  2 +
2 3 #include <qpdf/QUtil.hh>
3 4 #include <string.h>
4 5  
... ...
libqpdf/QPDFWriter.cc
1 1 #include <qpdf/qpdf-config.h> // include first for large file support
  2 +
2 3 #include <qpdf/QPDFWriter.hh>
3 4  
4 5 #include <assert.h>
... ...
libqpdf/QPDFXRefEntry.cc
1 1 #include <qpdf/QPDFXRefEntry.hh>
  2 +
2 3 #include <qpdf/QPDFExc.hh>
3 4 #include <qpdf/QUtil.hh>
4 5 #include <qpdf/QIntC.hh>
... ...
libqpdf/QPDF_Array.cc
1 1 #include <qpdf/QPDF_Array.hh>
  2 +
2 3 #include <qpdf/QUtil.hh>
3 4 #include <qpdf/QIntC.hh>
4 5 #include <stdexcept>
... ...
libqpdf/QPDF_Reserved.cc
1 1 #include <qpdf/QPDF_Reserved.hh>
  2 +
2 3 #include <stdexcept>
3 4  
4 5 QPDF_Reserved::~QPDF_Reserved()
... ...
libqpdf/QUtil.cc
... ... @@ -2,6 +2,7 @@
2 2 #include <qpdf/qpdf-config.h>
3 3  
4 4 #include <qpdf/QUtil.hh>
  5 +
5 6 #include <qpdf/PointerHolder.hh>
6 7 #include <qpdf/CryptoRandomDataProvider.hh>
7 8 #include <qpdf/QPDFSystemError.hh>
... ...
libqpdf/RC4.cc
1 1 #include <qpdf/RC4.hh>
  2 +
2 3 #include <qpdf/QPDFCryptoProvider.hh>
3 4  
4 5 #include <string.h>
... ...
libqpdf/RC4_native.cc
1 1 #include <qpdf/RC4_native.hh>
  2 +
2 3 #include <qpdf/QIntC.hh>
3 4  
4 5 #include <string.h>
... ...
libqpdf/SF_FlateLzwDecode.cc
1 1 #include <qpdf/SF_FlateLzwDecode.hh>
  2 +
2 3 #include <qpdf/Pl_PNGFilter.hh>
3 4 #include <qpdf/Pl_TIFFPredictor.hh>
4 5 #include <qpdf/Pl_Flate.hh>
... ...
libqpdf/SHA2_native.cc
1 1 #include <qpdf/SHA2_native.hh>
  2 +
2 3 #include <stdexcept>
3 4 #include <cstdio>
4 5 #include <qpdf/PointerHolder.hh>
... ...
libqpdf/SparseOHArray.cc
1 1 #include <qpdf/SparseOHArray.hh>
  2 +
2 3 #include <stdexcept>
3 4  
4 5 SparseOHArray::SparseOHArray() :
... ...
libqpdf/qpdf-c.cc
1 1 #include <qpdf/qpdf-c.h>
2 2  
3 3 #include <qpdf/QPDF.hh>
  4 +
4 5 #include <qpdf/QPDFWriter.hh>
5 6 #include <qpdf/QTC.hh>
6 7 #include <qpdf/QPDFExc.hh>
... ...