Skip to content
Permalink
Browse files

Use prefix increment operator to fix cppcheck warnings related to pos…

…tfixOperator
  • Loading branch information
rouault authored and nyalldawson committed Jun 27, 2020
1 parent 5686837 commit cd923451107cc645b1ea4b6b55bef67292035472
@@ -53,7 +53,7 @@ mv ${LOG_FILE}.tmp ${LOG_FILE}
for category in "style" "performance" "portability"; do
if grep "${category}," ${LOG_FILE} >/dev/null; then
echo "INFO: Issues in '${category}' category found, but not considered as making script to fail:"
grep "${category}," ${LOG_FILE} | grep -v -e "clarifyCalculation," -e "duplicateExpressionTernary," -e "redundantCondition," -e "unusedPrivateFunction,"
grep "${category}," ${LOG_FILE} | grep -v -e "clarifyCalculation," -e "duplicateExpressionTernary," -e "redundantCondition," -e "unusedPrivateFunction," -e "postfixOperator,"
echo ""
fi
done
@@ -65,7 +65,7 @@ else
UNUSED_PRIVATE_FUNCTION="unusedPrivateFunction"
fi

for category in "error" "warning" "clarifyCalculation" "duplicateExpressionTernary" "redundantCondition" "${UNUSED_PRIVATE_FUNCTION}"; do
for category in "error" "warning" "clarifyCalculation" "duplicateExpressionTernary" "redundantCondition" "postfixOperator" "${UNUSED_PRIVATE_FUNCTION}"; do
if test "${category}" != ""; then
if grep "${category}," ${LOG_FILE} >/dev/null; then
echo "ERROR: Issues in '${category}' category found:"
@@ -36,7 +36,7 @@ void QgsDatumTransformTableModel::removeTransform( const QModelIndexList &indexe
{
QgsCoordinateReferenceSystem sourceCrs;
QgsCoordinateReferenceSystem destinationCrs;
for ( QModelIndexList::const_iterator it = indexes.constBegin(); it != indexes.constEnd(); it ++ )
for ( QModelIndexList::const_iterator it = indexes.constBegin(); it != indexes.constEnd(); ++it )
{
if ( it->column() == SourceCrsColumn )
{
@@ -447,7 +447,7 @@ bool QgsTriangle::isRight( double angleTolerance ) const
{
if ( qgsDoubleNear( *ita, M_PI_2, angleTolerance ) )
return true;
ita++;
++ita;
}
return false;
}
@@ -167,7 +167,7 @@ bool QgsMapRendererStagedRenderJob::nextPart()

if ( mJobIt != mLayerJobs.end() )
{
mJobIt++;
++mJobIt;
if ( mJobIt != mLayerJobs.end() )
return true;
}
@@ -194,7 +194,7 @@ bool QgsMapRendererStagedRenderJob::nextPart()
{
if ( mLabelLayerIt != mLabelingLayers.end() )
{
mLabelLayerIt++;
++mLabelLayerIt;
if ( mLabelLayerIt != mLabelingLayers.end() )
return true;
}
@@ -1522,7 +1522,7 @@ bool QgsProject::readProjectFile( const QString &filename, QgsProject::ReadFlags
// Resolve references to other layers
// Needs to be done here once all dependent layers are loaded
QMap<QString, QgsMapLayer *> layers = mLayerStore->mapLayers();
for ( QMap<QString, QgsMapLayer *>::iterator it = layers.begin(); it != layers.end(); it++ )
for ( QMap<QString, QgsMapLayer *>::iterator it = layers.begin(); it != layers.end(); ++it )
{
it.value()->resolveReferences( this );
}
@@ -1590,7 +1590,7 @@ bool QgsProject::readProjectFile( const QString &filename, QgsProject::ReadFlags

// reassign change dependencies now that all layers are loaded
QMap<QString, QgsMapLayer *> existingMaps = mapLayers();
for ( QMap<QString, QgsMapLayer *>::iterator it = existingMaps.begin(); it != existingMaps.end(); it++ )
for ( QMap<QString, QgsMapLayer *>::iterator it = existingMaps.begin(); it != existingMaps.end(); ++it )
{
it.value()->setDependencies( it.value()->dependencies() );
}
@@ -1930,7 +1930,7 @@ void QgsProject::onMapLayersAdded( const QList<QgsMapLayer *> &layers )
connect( layer, &QgsMapLayer::configChanged, this, [ = ] { setDirty(); } );

// check if we have to update connections for layers with dependencies
for ( QMap<QString, QgsMapLayer *>::iterator it = existingMaps.begin(); it != existingMaps.end(); it++ )
for ( QMap<QString, QgsMapLayer *>::iterator it = existingMaps.begin(); it != existingMaps.end(); ++it )
{
QSet<QgsMapLayerDependency> deps = it.value()->dependencies();
if ( deps.contains( layer->id() ) )
@@ -1199,7 +1199,7 @@ static const QgsPointSequence vectorPointXY2pointSequence( const QVector<QgsPoin
while ( it != points.constEnd() )
{
pts.append( QgsPoint( *it ) );
it++;
++it;
}
return pts;
}
@@ -609,7 +609,7 @@ namespace QgsWfs

query.featureRequest = featureRequest;
request.queries.append( query );
fidsMapIt++;
++fidsMapIt;
}
return request;
}

0 comments on commit cd92345

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