From 2d8feebbde1106afb56297cddecb371a64660047 Mon Sep 17 00:00:00 2001 From: Nyall Dawson Date: Mon, 16 Feb 2015 16:09:58 +1100 Subject: [PATCH] Some very minor Coverity related fixes --- src/providers/ogr/qgsogrprovider.cpp | 2 -- tests/qt_modeltest/modeltest.cpp | 24 ++++++++++++------------ 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/src/providers/ogr/qgsogrprovider.cpp b/src/providers/ogr/qgsogrprovider.cpp index 3f1c2dd79d6..8534dd53be7 100644 --- a/src/providers/ogr/qgsogrprovider.cpp +++ b/src/providers/ogr/qgsogrprovider.cpp @@ -650,7 +650,6 @@ QStringList QgsOgrProvider::subLayers() const OGRFeatureH fet; while (( fet = OGR_L_GetNextFeature( layer ) ) ) { - if ( !fet ) continue; OGRGeometryH geom = OGR_F_GetGeometryRef( fet ); if ( geom ) { @@ -2502,7 +2501,6 @@ void QgsOgrProvider::recalculateFeatureCount() OGRFeatureH fet; while (( fet = OGR_L_GetNextFeature( ogrLayer ) ) ) { - if ( !fet ) continue; OGRGeometryH geom = OGR_F_GetGeometryRef( fet ); if ( geom ) { diff --git a/tests/qt_modeltest/modeltest.cpp b/tests/qt_modeltest/modeltest.cpp index 42ad85b69c0..a918aa031d2 100644 --- a/tests/qt_modeltest/modeltest.cpp +++ b/tests/qt_modeltest/modeltest.cpp @@ -133,23 +133,23 @@ void ModelTest::nonDestructiveBasicTest() Qt::ItemFlags flags = model->flags( QModelIndex() ); Q_ASSERT( flags == Qt::ItemIsDropEnabled || flags == 0 ); ( void )model->hasChildren( QModelIndex() ); - model->hasIndex( 0, 0 ); - model->headerData( 0, Qt::Horizontal ); - model->index( 0, 0 ); - model->itemData( QModelIndex() ); + ( void )model->hasIndex( 0, 0 ); + ( void )model->headerData( 0, Qt::Horizontal ); + ( void )model->index( 0, 0 ); + ( void )model->itemData( QModelIndex() ); QVariant cache; - model->match( QModelIndex(), -1, cache ); - model->mimeTypes(); + ( void )model->match( QModelIndex(), -1, cache ); + ( void )model->mimeTypes(); Q_ASSERT( model->parent( QModelIndex() ) == QModelIndex() ); Q_ASSERT( model->rowCount() >= 0 ); QVariant variant; - model->setData( QModelIndex(), variant, -1 ); - model->setHeaderData( -1, Qt::Horizontal, QVariant() ); - model->setHeaderData( 999999, Qt::Horizontal, QVariant() ); + ( void )model->setData( QModelIndex(), variant, -1 ); + ( void )model->setHeaderData( -1, Qt::Horizontal, QVariant() ); + ( void )model->setHeaderData( 999999, Qt::Horizontal, QVariant() ); QMap roles; - model->sibling( 0, 0, QModelIndex() ); - model->span( QModelIndex() ); - model->supportedDropActions(); + ( void )model->sibling( 0, 0, QModelIndex() ); + ( void )model->span( QModelIndex() ); + ( void )model->supportedDropActions(); } /*!