Skip to content

Commit 4ad077e

Browse files
authored
Merge pull request #4163 from nyalldawson/clang_tidyu
Fix a bunch of suggestions from clang-tidy
2 parents 4c92689 + db5dd85 commit 4ad077e

File tree

166 files changed

+442
-612
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

166 files changed

+442
-612
lines changed

CMakeLists.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -671,6 +671,20 @@ INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR})
671671
# that may be in the same install prefix
672672
LINK_DIRECTORIES(${CMAKE_BINARY_DIR}/src/core ${CMAKE_BINARY_DIR}/src/gui)
673673

674+
####################################################
675+
# clang-tidy
676+
FIND_PROGRAM(
677+
CLANG_TIDY_EXE
678+
NAMES "clang-tidy"
679+
DOC "Path to clang-tidy executable"
680+
)
681+
IF(NOT CLANG_TIDY_EXE)
682+
MESSAGE(STATUS "clang-tidy not found.")
683+
ELSE(NOT CLANG_TIDY_EXE)
684+
MESSAGE(STATUS "clang-tidy found: ${CLANG_TIDY_EXE}")
685+
SET(DO_CLANG_TIDY "${CLANG_TIDY_EXE}" "-checks=*,-clang-analyzer-alpha.*,-cppcoreguidelines*,-readability-implicit-bool-cast,-llvm-include-order,-cert-err58-cpp,-modernize-pass-by-value,-google-readability-braces-around-statements,-modernize-use-auto,-modernize-loop-convert,-readability-else-after-return,-readability-braces-around-statements,-google-runtime-references,-readability-named-parameter,-google-default-arguments,-google-readability-todo,-readability-inconsistent-declaration-parameter-name,-cert-flp30-c,-google-readability-casting,-clang-analyzer-security.FloatLoopCounter,-google-runtime-int,-modernize-use-using,-google-explicit-constructor,-google-build-using-namespace,-cert-err34-c,-clang-analyzer-core.CallAndMessage,-google-readability-function-size,-modernize-make-shared,-modernize-use-nullptr,-clang-analyzer-cplusplus.NewDeleteLeaks,-clang-analyzer-core.NonNullParamChecker,performance-unnecessary-copy-initialization,-readability-simplify-boolean-expr,-modernize-raw-string-literal,-performance-unnecessary-copy-initialization")
686+
ENDIF(NOT CLANG_TIDY_EXE)
687+
674688
#############################################################
675689
# create qgsversion.h
676690
IF (EXISTS ${CMAKE_SOURCE_DIR}/.git/index)

python/core/symbology-ng/qgsfillsymbollayer.sip

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,10 @@ class QgsImageFillSymbolLayer: QgsFillSymbolLayer
487487
protected:
488488

489489
virtual void applyDataDefinedSettings( QgsSymbolRenderContext& context );
490+
491+
private:
492+
493+
QgsImageFillSymbolLayer( const QgsImageFillSymbolLayer& other );
490494
};
491495

492496
/** \ingroup core
@@ -844,6 +848,10 @@ class QgsLinePatternFillSymbolLayer: QgsImageFillSymbolLayer
844848

845849
QSet<QString> usedAttributes( const QgsRenderContext& context ) const;
846850

851+
private:
852+
853+
QgsLinePatternFillSymbolLayer( const QgsLinePatternFillSymbolLayer& other );
854+
847855
};
848856

849857
class QgsPointPatternFillSymbolLayer : QgsImageFillSymbolLayer
@@ -945,6 +953,10 @@ class QgsPointPatternFillSymbolLayer : QgsImageFillSymbolLayer
945953

946954
protected:
947955
void applyDataDefinedSettings( QgsSymbolRenderContext& context );
956+
957+
private:
958+
959+
QgsPointPatternFillSymbolLayer( const QgsPointPatternFillSymbolLayer& other );
948960
};
949961

950962
class QgsCentroidFillSymbolLayer : QgsFillSymbolLayer
@@ -1001,4 +1013,8 @@ class QgsCentroidFillSymbolLayer : QgsFillSymbolLayer
10011013
/** Returns whether a point is drawn for all parts or only on the biggest part of multi-part features.
10021014
* @note added in 2.16 */
10031015
bool pointOnAllParts() const;
1016+
1017+
private:
1018+
1019+
QgsCentroidFillSymbolLayer( const QgsCentroidFillSymbolLayer& other );
10041020
};

python/core/symbology-ng/qgslinesymbollayer.sip

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,4 +283,8 @@ class QgsMarkerLineSymbolLayer : QgsLineSymbolLayer
283283
void renderPolylineVertex( const QPolygonF& points, QgsSymbolRenderContext& context, Placement placement = Vertex );
284284
void renderPolylineCentral( const QPolygonF& points, QgsSymbolRenderContext& context );
285285
double markerAngle( const QPolygonF& points, bool isRing, int vertex );
286+
287+
private:
288+
289+
QgsMarkerLineSymbolLayer( const QgsMarkerLineSymbolLayer& other );
286290
};

python/core/symbology-ng/qgsvectorfieldsymbollayer.sip

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,4 +85,8 @@ class QgsVectorFieldSymbolLayer : QgsMarkerSymbolLayer
8585
const QgsMapUnitScale& distanceMapUnitScale() const;
8686

8787
QRectF bounds( QPointF point, QgsSymbolRenderContext& context );
88+
89+
private:
90+
91+
QgsVectorFieldSymbolLayer( const QgsVectorFieldSymbolLayer& other );
8892
};

src/analysis/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,13 @@ ENDIF (NOT ANDROID)
217217

218218
TARGET_LINK_LIBRARIES(qgis_analysis qgis_core)
219219

220+
# clang-tidy
221+
IF(CLANG_TIDY_EXE)
222+
SET_TARGET_PROPERTIES(
223+
qgis_analysis PROPERTIES
224+
CXX_CLANG_TIDY "${DO_CLANG_TIDY}"
225+
)
226+
ENDIF(CLANG_TIDY_EXE)
220227

221228
# install
222229

src/analysis/interpolation/Point3D.cc

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,6 @@
1717
#include "Point3D.h"
1818
#include "qgslogger.h"
1919

20-
Point3D& Point3D::operator=( const Point3D & p )
21-
{
22-
mX = p.mX;
23-
mY = p.mY;
24-
mZ = p.mZ;
25-
return ( *this );
26-
}
27-
2820
bool Point3D::operator==( const Point3D& p ) const
2921
{
3022
return ( mX == p.getX() && mY == p.getY() && mZ == p.getZ() );

src/analysis/interpolation/Point3D.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ class ANALYSIS_EXPORT Point3D
3636
//! Constructor with the x-, y- and z-coordinate as arguments
3737
Point3D( double x, double y, double z );
3838
Point3D( const Point3D& p );
39-
Point3D& operator=( const Point3D& p );
4039
bool operator==( const Point3D& p ) const;
4140
bool operator!=( const Point3D& p ) const;
4241
//! Calculates the three-dimensional distance to another point

src/analysis/interpolation/Vector3D.cc

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,6 @@ void Vector3D::standardise()
2929
setZ( getZ() / length );
3030
}
3131

32-
Vector3D::Vector3D( const Vector3D& v )
33-
: mX( v.mX )
34-
, mY( v.mY )
35-
, mZ( v.mZ )
36-
{
37-
}
38-
39-
Vector3D& Vector3D::operator=( const Vector3D & v )
40-
{
41-
mX = v.mX;
42-
mY = v.mY;
43-
mZ = v.mZ;
44-
return ( *this );
45-
}
46-
4732
bool Vector3D::operator==( const Vector3D& v ) const
4833
{
4934
return ( mX == v.getX() && mY == v.getY() && mZ == v.getZ() );

src/analysis/interpolation/Vector3D.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,7 @@ class ANALYSIS_EXPORT Vector3D
4141
Vector3D( double x, double y, double z );
4242
//! Default constructor
4343
Vector3D();
44-
//! Copy constructor
45-
Vector3D( const Vector3D& v );
4644

47-
Vector3D& operator=( const Vector3D& v );
4845
bool operator==( const Vector3D& v ) const;
4946
bool operator!=( const Vector3D& v ) const;
5047
//! Returns the x-component of the vector

src/analysis/interpolation/qgsinterpolator.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,6 @@ QgsInterpolator::QgsInterpolator()
3535

3636
}
3737

38-
QgsInterpolator::~QgsInterpolator()
39-
{
40-
41-
}
42-
4338
int QgsInterpolator::cacheBaseData()
4439
{
4540
if ( mLayerData.size() < 1 )

0 commit comments

Comments
 (0)