Skip to content

Commit

Permalink
Fix some coverity uninitialized variable warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jan 26, 2017
1 parent 8f62f83 commit 7b14373
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 22 deletions.
4 changes: 2 additions & 2 deletions src/app/dwg/qgsdwgimporter.cpp
Expand Up @@ -1471,7 +1471,7 @@ void QgsDwgImporter::addLWPolyline( const DRW_LWPolyline &data )

QgsPointSequence s;
QgsCompoundCurve cc;
double width;
double width = -1.0; // width is set to correct value during first loop
bool hadBulge( false );

std::vector<DRW_Vertex2D *>::size_type n = data.flags & 1 ? vertexnum : vertexnum - 1;
Expand Down Expand Up @@ -1670,7 +1670,7 @@ void QgsDwgImporter::addPolyline( const DRW_Polyline &data )

QgsPointSequence s;
QgsCompoundCurve cc;
double width;
double width = -1.0; // width is set to correct value during first loop
bool hadBulge( false );

std::vector<DRW_Vertex *>::size_type n = data.flags & 1 ? vertexnum : vertexnum - 1;
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgisapp.h
Expand Up @@ -1647,7 +1647,7 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
QgsMapTool *mCircularStringCurvePoint;
QgsMapTool *mCircularStringRadius;
QgsMapTool *mMoveFeature;
QgsMapTool *mMoveFeatureCopy;
QgsMapTool *mMoveFeatureCopy = nullptr;
QgsMapTool *mOffsetCurve;
QgsMapTool *mReshapeFeatures;
QgsMapTool *mSplitFeatures;
Expand Down
8 changes: 4 additions & 4 deletions src/app/qgsselectbyformdialog.h
Expand Up @@ -67,10 +67,10 @@ class APP_EXPORT QgsSelectByFormDialog : public QDialog

private:

QgsAttributeForm* mForm;
QgsVectorLayer* mLayer;
QgsMessageBar* mMessageBar;
QgsMapCanvas* mMapCanvas;
QgsAttributeForm* mForm = nullptr;
QgsVectorLayer* mLayer = nullptr;
QgsMessageBar* mMessageBar = nullptr;
QgsMapCanvas* mMapCanvas = nullptr;

};

Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsaction.h
Expand Up @@ -187,7 +187,7 @@ class CORE_EXPORT QgsAction
QString mShortTitle;
QString mIcon;
QString mCommand;
bool mCaptureOutput;
bool mCaptureOutput = false;
QSet<QString> mActionScopes;
mutable QSharedPointer<QAction> mAction;
QUuid mId;
Expand Down
12 changes: 6 additions & 6 deletions src/core/qgssnappingconfig.h
Expand Up @@ -237,12 +237,12 @@ class CORE_EXPORT QgsSnappingConfig

//! associated project for this snapping configuration
QgsProject* mProject;
bool mEnabled;
SnappingMode mMode;
SnappingType mType;
double mTolerance;
QgsTolerance::UnitType mUnits;
bool mIntersectionSnapping;
bool mEnabled = false;
SnappingMode mMode = ActiveLayer;
SnappingType mType = Vertex;
double mTolerance = 0.0;
QgsTolerance::UnitType mUnits = QgsTolerance::ProjectUnits;
bool mIntersectionSnapping = false;

QHash<QgsVectorLayer*, IndividualLayerSettings> mIndividualLayerSettings;

Expand Down
1 change: 0 additions & 1 deletion src/server/qgsmslayercache.cpp
Expand Up @@ -33,7 +33,6 @@ QgsMSLayerCache* QgsMSLayerCache::instance()
}

QgsMSLayerCache::QgsMSLayerCache()
: mProjectMaxLayers( 100 )
{
QObject::connect( &mFileSystemWatcher, SIGNAL( fileChanged( const QString& ) ), this, SLOT( removeProjectFileLayers( const QString& ) ) );
}
Expand Down
4 changes: 2 additions & 2 deletions src/server/qgsmslayercache.h
Expand Up @@ -111,10 +111,10 @@ class QgsMSLayerCache: public QObject
QFileSystemWatcher mFileSystemWatcher;

//! Maximum number of layers in the cache
int mDefaultMaxLayers;
int mDefaultMaxLayers = 100;

//! Maximum number of layers in the cache, overrides DEFAULT_MAX_N_LAYERS if larger
int mProjectMaxLayers;
int mProjectMaxLayers = 100;

private slots:

Expand Down
7 changes: 3 additions & 4 deletions src/server/qgsservicenativeloader.cpp
Expand Up @@ -36,12 +36,11 @@ class QgsServiceNativeModuleEntry
public:
QgsServiceNativeModuleEntry( const QString& location )
: mLocation( location )
, mModule( nullptr )
{}

QString mLocation;
QgsServiceModule* mModule;
unloadHook_t* mUnloadHook;
QString mLocation;
QgsServiceModule* mModule = nullptr;
unloadHook_t* mUnloadHook = nullptr;
};

//! Constructor
Expand Down
3 changes: 2 additions & 1 deletion tests/bench/qgsbench.cpp
Expand Up @@ -221,7 +221,8 @@ void QgsBench::render()
mLogMap.insert( QStringLiteral( "revision" ), QGSVERSION );

// Calc stats: user, sys, total
double min[4], max[4];
double min[4] = {DBL_MAX};
double max[4] = { -DBL_MAX};
double stdev[4] = {0.};
double maxdev[4] = {0.};
double avg[4] = {0.};
Expand Down

0 comments on commit 7b14373

Please sign in to comment.