diff --git a/src/analysis/vector/geometry_checker/qgsgeometryanglecheck.cpp b/src/analysis/vector/geometry_checker/qgsgeometryanglecheck.cpp index 796d4549158..53e7b8a2092 100644 --- a/src/analysis/vector/geometry_checker/qgsgeometryanglecheck.cpp +++ b/src/analysis/vector/geometry_checker/qgsgeometryanglecheck.cpp @@ -52,7 +52,7 @@ void QgsGeometryAngleCheck::collectErrors( QList &error continue; } - double angle = qAcos( v21 * v23 ) / M_PI * 180.0; + double angle = std::acos( v21 * v23 ) / M_PI * 180.0; if ( angle < mMinAngle ) { errors.append( new QgsGeometryCheckError( this, layerFeature, p2, QgsVertexId( iPart, iRing, iVert ), angle ) ); diff --git a/src/analysis/vector/geometry_checker/qgsgeometrysegmentlengthcheck.cpp b/src/analysis/vector/geometry_checker/qgsgeometrysegmentlengthcheck.cpp index 9ddb90362dc..2e300082215 100644 --- a/src/analysis/vector/geometry_checker/qgsgeometrysegmentlengthcheck.cpp +++ b/src/analysis/vector/geometry_checker/qgsgeometrysegmentlengthcheck.cpp @@ -41,7 +41,7 @@ void QgsGeometrySegmentLengthCheck::collectErrors( QListvertexAt( QgsVertexId( iPart, iRing, iVert ) ); QgsPoint pj = geom->vertexAt( QgsVertexId( iPart, iRing, jVert ) ); - double dist = qSqrt( QgsGeometryUtils::sqrDistance2D( pi, pj ) ); + double dist = pi.distance( pj ); // Don't report very small lengths, they are either duplicate nodes or degenerate geometries if ( dist < minLength && dist > mContext->tolerance ) { @@ -85,7 +85,7 @@ void QgsGeometrySegmentLengthCheck::fixError( QgsGeometryCheckError *error, int QgsPoint pi = geom->vertexAt( error->vidx() ); QgsPoint pj = geom->vertexAt( QgsVertexId( vidx.part, vidx.ring, ( vidx.vertex - 1 + nVerts ) % nVerts ) ); - double dist = qSqrt( QgsGeometryUtils::sqrDistance2D( pi, pj ) ); + double dist = pi.distance( pj ); double layerToMapUnits = featurePool->getLayerToMapUnits(); double minLength = mMinLengthMapUnits / layerToMapUnits; if ( dist >= minLength ) diff --git a/tests/code_layout/test_banned_keywords.sh b/tests/code_layout/test_banned_keywords.sh index 7e44766bd83..e0444a74007 100755 --- a/tests/code_layout/test_banned_keywords.sh +++ b/tests/code_layout/test_banned_keywords.sh @@ -107,6 +107,15 @@ HINTS[27]="Use std::shared_ptr instead" KEYWORDS[28]="QOverload" HINTS[28]="Use qgis::overload instead" +KEYWORDS[29]="qFloor" +HINTS[29]="Use std::floor instead" + +KEYWORDS[30]="qCeil" +HINTS[30]="Use std::ceil instead" + +KEYWORDS[31]="qSqrt" +HINTS[31]="Use std::sqrt instead" + RES= DIR=$(git rev-parse --show-toplevel)