Skip to content

Commit

Permalink
Apply modified .clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault authored and github-actions[bot] committed Dec 30, 2022
1 parent c61a2a3 commit 54c4dc6
Show file tree
Hide file tree
Showing 39 changed files with 128 additions and 139 deletions.
4 changes: 2 additions & 2 deletions alg/internal_qhull_headers.h
Original file line number Diff line number Diff line change
Expand Up @@ -1073,8 +1073,8 @@ static int qh_compare_anglemerge();
#pragma warning(push)
#pragma warning(disable : 4324)
#pragma warning(disable : 4032)
#pragma warning(disable : 4306) /* e.g 'type cast' : conversion from 'long' to \
'facetT *' of greater size */
// 4306: e.g 'type cast' : conversion from 'long' to 'facetT *' of greater size
#pragma warning(disable : 4306)
#pragma warning(disable : 4701)
#pragma warning(disable : 4703)
#endif
Expand Down
12 changes: 7 additions & 5 deletions frmts/aigrid/aigccitt.c
Original file line number Diff line number Diff line change
Expand Up @@ -3592,13 +3592,15 @@ typedef struct
int EOLcnt; /* # EOL codes recognized */ \
const unsigned char *bitmap = sp->bitmap; /* input data bit reverser */ \
const TIFFFaxTabEnt *TabEnt

#define DECLARE_STATE_2D(tif, sp, mod) \
DECLARE_STATE(tif, sp, mod); \
int b1; /* next change on prev line */ \
GUInt32 *pb /* next run in reference line */ /* \
* Load any state that may be \
* changed during decoding. \
*/
int b1; /* next change on prev line */ \
GUInt32 *pb /* next run in reference line */

/**
* Load any state that may be hanged during decoding.
*/
#define CACHE_STATE(sp) \
do \
{ \
Expand Down
15 changes: 7 additions & 8 deletions frmts/bmp/bmpdataset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,13 @@ enum BMPType

enum BMPComprMethod
{
BMPC_RGB = 0L, // Uncompressed
BMPC_RLE8 = 1L, // RLE for 8 bpp images
BMPC_RLE4 = 2L, // RLE for 4 bpp images
BMPC_BITFIELDS =
3L, // Bitmap is not compressed and the colour table
// consists of three DWORD color masks that specify
// the red, green, and blue components of each pixel.
// This is valid when used with 16- and 32-bpp bitmaps.
BMPC_RGB = 0L, // Uncompressed
BMPC_RLE8 = 1L, // RLE for 8 bpp images
BMPC_RLE4 = 2L, // RLE for 4 bpp images
BMPC_BITFIELDS = 3L, // Bitmap is not compressed and the colour table
// consists of three DWORD color masks that specify
// the red, green, and blue components of each pixel.
// This is valid when used with 16- and 32-bpp bitmaps.
BMPC_JPEG = 4L, // Indicates that the image is a JPEG image.
BMPC_PNG = 5L // Indicates that the image is a PNG image.
};
Expand Down
4 changes: 2 additions & 2 deletions frmts/exr/openexr_headers.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@

#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4244) // conversion from 'int' to 'unsigned short',
// possible loss of data
// conversion from 'int' to 'unsigned short', possible loss of data
#pragma warning(disable : 4244)
#endif

#include "ImathMatrix.h"
Expand Down
5 changes: 2 additions & 3 deletions frmts/kea/keaband.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,8 @@ class KEARasterBand CPL_NON_FINAL : public GDALPamRasterBand
GDALRasterAttributeTable *m_pAttributeTable =
nullptr; // pointer to the attribute table
// created on first call to GetDefaultRAT()
GDALColorTable *m_pColorTable =
nullptr; // pointer to the color table
// created on first call to GetColorTable()
GDALColorTable *m_pColorTable = nullptr; // pointer to the color table
// created on first call to GetColorTable()

int m_nAttributeChunkSize = 0; // for reporting via the metadata
public:
Expand Down
22 changes: 9 additions & 13 deletions frmts/l1b/l1bdataset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ typedef enum
NOAA17, // NOAA-17(M)
NOAA18, // NOAA-18(N)
NOAA19, // NOAA-19(N')
// MetOp are given a number before launch and a letter after launch
// MetOp are given a number before launch and a letter after launch
METOP2, // METOP-A(2)
METOP1, // METOP-B(1)
METOP3, // METOP-C(3)
Expand Down Expand Up @@ -139,35 +139,31 @@ static const char *const apszBandDesc[] = {
/* L1B file format related constants */
/************************************************************************/

#define L1B_DATASET_NAME_SIZE \
42 // Length of the string containing
// dataset name
// Length of the string containing dataset name
#define L1B_DATASET_NAME_SIZE 42
#define L1B_NOAA9_HEADER_SIZE 122 // Terabit memory (TBM) header length
#define L1B_NOAA9_HDR_NAME_OFF 30 // Dataset name offset
#define L1B_NOAA9_HDR_SRC_OFF 70 // Receiving station name offset
#define L1B_NOAA9_HDR_CHAN_OFF 97 // Selected channels map offset
#define L1B_NOAA9_HDR_CHAN_SIZE 20 // Length of selected channels map
#define L1B_NOAA9_HDR_WORD_OFF 117 // Sensor data word size offset

#define L1B_NOAA15_HEADER_SIZE \
512 // Archive Retrieval System (ARS)
// header
// Archive Retrieval System (ARS) header
#define L1B_NOAA15_HEADER_SIZE 512
#define L1B_NOAA15_HDR_CHAN_OFF 97 // Selected channels map offset
#define L1B_NOAA15_HDR_CHAN_SIZE 20 // Length of selected channels map
#define L1B_NOAA15_HDR_WORD_OFF 117 // Sensor data word size offset

#define L1B_NOAA9_HDR_REC_SIZE \
146 // Length of header record
// filled with the data
// Length of header record filled with the data
#define L1B_NOAA9_HDR_REC_SIZE 146
#define L1B_NOAA9_HDR_REC_ID_OFF 0 // Spacecraft ID offset
#define L1B_NOAA9_HDR_REC_PROD_OFF 1 // Data type offset
#define L1B_NOAA9_HDR_REC_DSTAT_OFF 34 // DACS status offset

/* See
* http://www.ncdc.noaa.gov/oa/pod-guide/ncdc/docs/klm/html/c8/sec83132-2.htm */
#define L1B_NOAA15_HDR_REC_SIZE \
992 // Length of header record
// filled with the data
// Length of header record filled with the data
#define L1B_NOAA15_HDR_REC_SIZE 992
#define L1B_NOAA15_HDR_REC_SITE_OFF 0 // Dataset creation site ID offset
#define L1B_NOAA15_HDR_REC_FORMAT_VERSION_OFF \
4 // NOAA Level 1b Format Version Number
Expand Down
9 changes: 4 additions & 5 deletions frmts/mem/memmultidim.h
Original file line number Diff line number Diff line change
Expand Up @@ -198,11 +198,10 @@ class CPL_DLL MEMAbstractMDArray : virtual public GDALAbstractMDArray

#ifdef _MSC_VER
#pragma warning(push)
#pragma warning( \
disable : 4250) // warning C4250: 'MEMMDArray': inherits
// 'MEMAbstractMDArray::MEMAbstractMDArray::IRead'
// via dominance
#endif //_MSC_VER
// warning C4250: 'MEMMDArray': inherits
// 'MEMAbstractMDArray::MEMAbstractMDArray::IRead' via dominance
#pragma warning(disable : 4250)
#endif //_MSC_VER

class MEMMDArray CPL_NON_FINAL : public MEMAbstractMDArray, public GDALMDArray
{
Expand Down
2 changes: 1 addition & 1 deletion frmts/mrf/mrf_overview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ CPLErr MRFDataset::PatchOverview(int BlockX, int BlockY, int Width, int Height,

if (adjusted)
{ // Fill with no data for partial buffer, instead of padding
// afterwards
// afterwards
size_t bsb = bsrc->blockSizeBytes();
auto b = buffer.data();
bsrc->FillBlock(b);
Expand Down
8 changes: 4 additions & 4 deletions frmts/msg/PublicDecompWT_headers.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4244) /* conversion from 'int' to 'WORD', possible \
loss of data */
#pragma warning(disable : 4267) /* '=': conversion from 'size_t' to 'int', \
possible loss of data */
//conversion from 'int' to 'WORD', possible loss of data
#pragma warning(disable : 4244)
// '=': conversion from 'size_t' to 'int', possible loss of data
#pragma warning(disable : 4267)
#endif

#include "PublicDecompWT/COMP/WT/Inc/CWTDecoder.h"
Expand Down
2 changes: 1 addition & 1 deletion frmts/msg/msgdataset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ GDALDataset *MSGDataset::Open(GDALOpenInfo *poOpenInfo)
{
if (sErr.compare("-") !=
0) // this driver does not recognize this format .. be silent and
// return false so that another driver can try
// return false so that another driver can try
CPLError(CE_Failure, CPLE_AppDefined, "%s", (sErr + "\n").c_str());
return nullptr;
}
Expand Down
5 changes: 2 additions & 3 deletions frmts/msgn/msgndataset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -616,9 +616,8 @@ GDALDataset *MSGNDataset::Open(GDALOpenInfo *poOpenInfo)
poDS->m_Shape = WHOLE_DISK;
}
else if (idr.plannedCoverage_visir.northernLinePlanned ==
idr.referencegrid_visir
.numberOfLines && // start at max N
// full expected width
idr.referencegrid_visir.numberOfLines && // start at max N
// full expected width
idr.plannedCoverage_visir.westernColumnPlanned ==
idr.plannedCoverage_visir.easternColumnPlanned +
nRawVisIRColumns - 1 &&
Expand Down
5 changes: 2 additions & 3 deletions frmts/netcdf/netcdfdataset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8626,9 +8626,8 @@ GDALDataset *netCDFDataset::Open(GDALOpenInfo *poOpenInfo)
if (NCDF_FORMAT_NONE == poDS->eFormat ||
NCDF_FORMAT_UNKNOWN == poDS->eFormat)
{
CPLReleaseMutex(
hNCMutex); // Release mutex otherwise we'll
// deadlock with GDALDataset own mutex.
CPLReleaseMutex(hNCMutex); // Release mutex otherwise we'll
// deadlock with GDALDataset own mutex.
delete poDS;
CPLAcquireMutex(hNCMutex, 1000.0);
return nullptr;
Expand Down
8 changes: 4 additions & 4 deletions frmts/pdf/pdfsdk_headers.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@

#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4244) /* conversion from 'const int' to 'Guchar', \
possible loss of data */
#pragma warning(disable : 4267) /* conversion from 'size_t' to 'int', possible \
loss of data */
// conversion from 'const int' to 'Guchar', possible loss of data
#pragma warning(disable : 4244)
// conversion from 'size_t' to 'int', possible loss of data
#pragma warning(disable : 4267)
#endif

#if !(POPPLER_MAJOR_VERSION >= 1 || POPPLER_MINOR_VERSION >= 73)
Expand Down
2 changes: 1 addition & 1 deletion frmts/wms/gdalwmsrasterband.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -883,7 +883,7 @@ CPLErr GDALWMSRasterBand::ReadBlockFromDataset(GDALDataset *ds, int x, int y,
else // if( bandmap != nullptr && bandmap[ib - 1] == 0
// )
{ // parent expects 4 bands but file has fewer count so
// generate a all "opaque" 4th band
// generate a all "opaque" 4th band
GByte *byte_buffer = reinterpret_cast<GByte *>(p);
for (int l_y = 0; l_y < sy; ++l_y)
{
Expand Down
4 changes: 2 additions & 2 deletions frmts/wms/minidriver_mrf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ void *SectorCache::data(size_t address)
}
else
{ // Choose a random one to replace, but not the last used, to avoid
// thrashing
// thrashing
do
{
// coverity[dont_call]
Expand Down Expand Up @@ -251,7 +251,7 @@ CPLErr WMSMiniDriver_MRF::EndInit()
}
else
{ // Not provided, change extension to .idx if we can, otherwise use the
// same file
// same file
m_idxname = m_base_url;
}

Expand Down
10 changes: 4 additions & 6 deletions gcore/gdal_priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -495,9 +495,8 @@ class CPL_DLL GDALDataset : public GDALMajorObject
Iterator(GDALDataset *poDS, bool bStart);
Iterator(const Iterator &oOther); // declared but not defined.
// Needed for gcc 5.4 at least
Iterator(
Iterator &&oOther) noexcept; // declared but not defined.
// Needed for gcc 5.4 at least
Iterator(Iterator &&oOther) noexcept; // declared but not defined.
// Needed for gcc 5.4 at least
~Iterator();
GDALRasterBand *operator*();
Iterator &operator++();
Expand Down Expand Up @@ -802,9 +801,8 @@ class CPL_DLL GDALDataset : public GDALMajorObject
Iterator(GDALDataset *poDS, bool bStart);
Iterator(const Iterator &oOther); // declared but not defined.
// Needed for gcc 5.4 at least
Iterator(
Iterator &&oOther) noexcept; // declared but not defined.
// Needed for gcc 5.4 at least
Iterator(Iterator &&oOther) noexcept; // declared but not defined.
// Needed for gcc 5.4 at least
~Iterator();
const FeatureLayerPair &operator*() const;
Iterator &operator++();
Expand Down
16 changes: 8 additions & 8 deletions gcore/gdaljp2metadata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1036,16 +1036,16 @@ int GDALJP2Metadata::ParseGMLCoverageDesc()
if (oSRS.SetFromUserInput(pszSRSName) == OGRERR_NONE)
m_oSRS = oSRS;
}
else if (
(STARTS_WITH_CI(pszSRSName, "urn:") &&
strstr(pszSRSName, ":def:") != nullptr &&
oSRS.importFromURN(pszSRSName) == OGRERR_NONE) ||
/* GMLJP2 v2.0 uses CRS URL instead of URN */
/* See e.g.
else if ((STARTS_WITH_CI(pszSRSName, "urn:") &&
strstr(pszSRSName, ":def:") != nullptr &&
oSRS.importFromURN(pszSRSName) == OGRERR_NONE) ||
/* GMLJP2 v2.0 uses CRS URL instead of URN */
/* See e.g.
http://schemas.opengis.net/gmljp2/2.0/examples/minimalInstance.xml
*/
(STARTS_WITH_CI(pszSRSName, "http://www.opengis.net/def/crs/") &&
oSRS.importFromCRSURL(pszSRSName) == OGRERR_NONE))
(STARTS_WITH_CI(pszSRSName,
"http://www.opengis.net/def/crs/") &&
oSRS.importFromCRSURL(pszSRSName) == OGRERR_NONE))
{
m_oSRS = oSRS;

Expand Down
2 changes: 1 addition & 1 deletion gcore/gdalmultidim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4549,7 +4549,7 @@ void GDALSlicedMDArray::PrepareParentArrays(
m_parentStep[iParent] =
count[i] == 1 ? 1 :
// other checks should have ensured this does
// not overflow
// not overflow
arrayStep[i] * m_parentRanges[iParent].m_nIncr;
}
if (bufferStride)
Expand Down
5 changes: 3 additions & 2 deletions gcore/gdalrasterband.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5248,8 +5248,9 @@ struct ComputeStatisticsInternal<GUInt16, COMPUTE_OTHER_STATS>
}
};

#endif // (defined(__x86_64__) || defined(_M_X64)) && (defined(__GNUC__) ||
// defined(_MSC_VER))
#endif
// (defined(__x86_64__) || defined(_M_X64)) && (defined(__GNUC__) ||
// defined(_MSC_VER))

#endif // CPL_HAS_GINT64

Expand Down
6 changes: 3 additions & 3 deletions ogr/ogr_feature.h
Original file line number Diff line number Diff line change
Expand Up @@ -726,9 +726,9 @@ class CPL_DLL OGRFeature

public:
//! @cond Doxygen_Suppress
ConstFieldIterator(ConstFieldIterator &&
oOther) noexcept; // declared but not defined.
// Needed for gcc 5.4 at least
ConstFieldIterator(
ConstFieldIterator &&oOther) noexcept; // declared but not defined.
// Needed for gcc 5.4 at least
~ConstFieldIterator();
const FieldValue &operator*() const;
ConstFieldIterator &operator++();
Expand Down
10 changes: 5 additions & 5 deletions ogr/ogrsf_frmts/arrow/ogr_feather.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@

#ifdef _MSC_VER
#pragma warning(push)
#pragma warning( \
disable : 4244) /* warning 4244: 'initializing': conversion from \
'int32_t' to 'int16_t', possible loss of data */
#pragma warning(disable : 4458) /* warning 4458: declaration of 'type_id' \
hides class member */
// warning 4244: 'initializing': conversion from 'int32_t' to 'int16_t',
// possible loss of data
#pragma warning(disable : 4244)
// warning 4458: declaration of 'type_id' hides class member
#pragma warning(disable : 4458)
#endif

#include "arrow/ipc/writer.h"
Expand Down
5 changes: 2 additions & 3 deletions ogr/ogrsf_frmts/arrow_common/ogr_arrow.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,8 @@ class OGRArrowLayer CPL_NON_FINAL
std::vector<int>
m_anMapFieldIndexToArrayIndex{}; // only valid when m_bIgnoredFields is
// set
std::vector<int>
m_anMapGeomFieldIndexToArrayIndex{}; // only valid when
// m_bIgnoredFields is set
std::vector<int> m_anMapGeomFieldIndexToArrayIndex{}; // only valid when
// m_bIgnoredFields is set
int m_nRequestedFIDColumn = -1; // only valid when m_bIgnoredFields is set

bool m_bEOF = false;
Expand Down
10 changes: 5 additions & 5 deletions ogr/ogrsf_frmts/arrow_common/ogr_include_arrow.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@

#ifdef _MSC_VER
#pragma warning(push)
#pragma warning( \
disable : 4244) /* warning 4244: 'initializing': conversion from \
'int32_t' to 'int16_t', possible loss of data */
#pragma warning(disable : 4458) /* warning 4458: declaration of 'type_id' \
hides class member */
// warning 4244: 'initializing': conversion from 'int32_t' to 'int16_t',
// possible loss of data
#pragma warning(disable : 4244)
// warning 4458: declaration of 'type_id' hides class member
#pragma warning(disable : 4458)
#endif

#include "arrow/array.h"
Expand Down
11 changes: 6 additions & 5 deletions ogr/ogrsf_frmts/generic/ogrwarpedlayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,12 @@ class OGRWarpedLayer : public OGRLayerDecorator
OGRFeature *WarpedFeatureToSrcFeature(OGRFeature *poFeature);

public:
OGRWarpedLayer(OGRLayer* poDecoratedLayer,
int iGeomField,
int bTakeOwnership,
OGRCoordinateTransformation* poCT, /* must NOT be NULL, ownership acquired by OGRWarpedLayer */
OGRCoordinateTransformation* poReversedCT /* may be NULL, ownership acquired by OGRWarpedLayer */);
OGRWarpedLayer(
OGRLayer *poDecoratedLayer, int iGeomField, int bTakeOwnership,
OGRCoordinateTransformation
*poCT, /* must NOT be NULL, ownership acquired by OGRWarpedLayer */
OGRCoordinateTransformation *
poReversedCT /* may be NULL, ownership acquired by OGRWarpedLayer */);
virtual ~OGRWarpedLayer();

void SetExtent(double dfXMin, double dfYMin, double dfXMax, double dfYMax);
Expand Down
Loading

0 comments on commit 54c4dc6

Please sign in to comment.