Skip to content
Permalink
Browse files

Fix some coverity uninitialized variable warnings

  • Loading branch information
nyalldawson committed Jan 26, 2017
1 parent 8f62f83 commit 7b14373a8e32f790744bb6fe30ff6b2904384fec
@@ -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;
@@ -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;
@@ -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;
@@ -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;

};

@@ -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;
@@ -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;

@@ -33,7 +33,6 @@ QgsMSLayerCache* QgsMSLayerCache::instance()
}

QgsMSLayerCache::QgsMSLayerCache()
: mProjectMaxLayers( 100 )
{
QObject::connect( &mFileSystemWatcher, SIGNAL( fileChanged( const QString& ) ), this, SLOT( removeProjectFileLayers( const QString& ) ) );
}
@@ -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:

@@ -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
@@ -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.};

0 comments on commit 7b14373

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