Skip to content
Permalink
Browse files

Avoid Coverity unchecked return value warnings

  • Loading branch information
nyalldawson committed Nov 11, 2017
1 parent 48c7e31 commit a9145f16cc999a2e516bb0ce6697cc7e5fc8bad3
@@ -510,7 +510,7 @@ void QgsAttributeTableDialog::runFieldCalculation( QgsVectorLayer *layer, const
context.lastScope()->addVariable( QgsExpressionContextScope::StaticVariable( QStringLiteral( "row_number" ), rownum, true ) );

QVariant value = exp.evaluate( &context );
fld.convertCompatible( value );
( void )fld.convertCompatible( value );
// Bail if we have a update error
if ( exp.hasEvalError() )
{
@@ -299,7 +299,7 @@ void QgsFieldCalculator::accept()
}
else
{
field.convertCompatible( value );
( void )field.convertCompatible( value );
mVectorLayer->changeAttributeValue( feature.id(), mAttributeId, value, newField ? emptyAttribute : feature.attributes().value( mAttributeId ) );
}

@@ -875,7 +875,7 @@ void QgsVectorLayerFeatureIterator::addExpressionAttribute( QgsFeature &f, int a
{
mExpressionContext->setFeature( f );
QVariant val = exp->evaluate( mExpressionContext.get() );
mSource->mFields.at( attrIndex ).convertCompatible( val );
( void )mSource->mFields.at( attrIndex ).convertCompatible( val );
f.setAttribute( attrIndex, val );
}
else
@@ -141,9 +141,9 @@ void QgsRangeWidgetWrapper::initWidget( QWidget *editor )
}
else
{
field().convertCompatible( min );
field().convertCompatible( max );
field().convertCompatible( step );
( void )field().convertCompatible( min );
( void )field().convertCompatible( max );
( void )field().convertCompatible( step );
if ( mQgsDial ) setupIntEditor( min, max, step, mQgsDial, this );
else if ( mQgsSlider ) setupIntEditor( min, max, step, mQgsSlider, this );
else if ( mDial ) setupIntEditor( min, max, step, mDial, this );
@@ -789,7 +789,7 @@ void TestQgsLayoutModel::proxyCrash()
layout->addLayoutItem( item3 );

// reorder items - expect no crash!
layout->itemsModel()->reorderItemUp( item1 );
( void )layout->itemsModel()->reorderItemUp( item1 );
}

QGSTEST_MAIN( TestQgsLayoutModel )

0 comments on commit a9145f1

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