Skip to content
Permalink
Browse files

Add qFloor, qCeil, qSqrt to banned keywords

  • Loading branch information
nyalldawson committed Aug 21, 2018
1 parent 5bc848c commit 0d1a9819d444909f54cb8a76c6c7059e6553da80
@@ -52,7 +52,7 @@ void QgsGeometryAngleCheck::collectErrors( QList<QgsGeometryCheckError *> &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 ) );
@@ -41,7 +41,7 @@ void QgsGeometrySegmentLengthCheck::collectErrors( QList<QgsGeometryCheckError *
{
QgsPoint pi = geom->vertexAt( 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 )
@@ -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)

0 comments on commit 0d1a981

Please sign in to comment.
You can’t perform that action at this time.