Skip to content
Permalink
Browse files

Fix Coverity uninitialized member warnings

  • Loading branch information
nyalldawson committed Feb 2, 2017
1 parent 5939ae2 commit f84508a35d0398fc8cef6312d6dbd8e6c3737d9c
@@ -34,21 +34,8 @@ QgsZonalStatistics::QgsZonalStatistics( QgsVectorLayer* polygonLayer, QgsRasterL
, mRasterBand( rasterBand )
, mPolygonLayer( polygonLayer )
, mAttributePrefix( attributePrefix )
, mInputNodataValue( -1 )
, mStatistics( stats )
{

}

QgsZonalStatistics::QgsZonalStatistics()
: mRasterLayer( nullptr )
, mRasterBand( 0 )
, mPolygonLayer( nullptr )
, mInputNodataValue( -1 )
, mStatistics( QgsZonalStatistics::All )
{

}
{}

int QgsZonalStatistics::calculateStatistics( QProgressDialog* p )
{
@@ -67,7 +67,7 @@ class ANALYSIS_EXPORT QgsZonalStatistics
int calculateStatistics( QProgressDialog* p );

private:
QgsZonalStatistics();
QgsZonalStatistics() = default;

class FeatureStats
{
@@ -128,15 +128,15 @@ class ANALYSIS_EXPORT QgsZonalStatistics

QString getUniqueFieldName( const QString& fieldName, const QList<QgsField>& newFields );

QgsRasterLayer* mRasterLayer;
QgsRasterDataProvider* mRasterProvider;
//! Raster band to calculate statistics from (defaults to 1)
int mRasterBand;
QgsVectorLayer* mPolygonLayer;
QgsRasterLayer* mRasterLayer = nullptr;
QgsRasterDataProvider* mRasterProvider = nullptr;
//! Raster band to calculate statistics
int mRasterBand = 0;
QgsVectorLayer* mPolygonLayer = nullptr;
QString mAttributePrefix;
//! The nodata value of the input layer
float mInputNodataValue;
Statistics mStatistics;
float mInputNodataValue = -1;
Statistics mStatistics = QgsZonalStatistics::All;
};

Q_DECLARE_OPERATORS_FOR_FLAGS( QgsZonalStatistics::Statistics )
@@ -30,9 +30,6 @@ class TestQgsZonalStatistics : public QObject
{
Q_OBJECT

public:
TestQgsZonalStatistics();

private slots:
void initTestCase();
void cleanupTestCase();
@@ -42,16 +39,10 @@ class TestQgsZonalStatistics : public QObject
void testStatistics();

private:
QgsVectorLayer* mVectorLayer;
QgsRasterLayer* mRasterLayer;
QgsVectorLayer* mVectorLayer = nullptr;
QgsRasterLayer* mRasterLayer = nullptr;
};

TestQgsZonalStatistics::TestQgsZonalStatistics()
: mVectorLayer( nullptr )
{

}

void TestQgsZonalStatistics::initTestCase()
{
QgsApplication::init();

0 comments on commit f84508a

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