Skip to content
Permalink
Browse files

Fix cppcheck warnings about uninitialized member variables

  • Loading branch information
rouault authored and nyalldawson committed May 17, 2020
1 parent b4eca08 commit 9cc37a124e6f7fba8fcea595b485d956947470f1
@@ -35,6 +35,7 @@ Qgs3DMapSettings::Qgs3DMapSettings( const Qgs3DMapSettings &other )
, mOrigin( other.mOrigin )
, mCrs( other.mCrs )
, mBackgroundColor( other.mBackgroundColor )
, mSelectionColor( other.mSelectionColor )
, mTerrainVerticalScale( other.mTerrainVerticalScale )
, mTerrainGenerator( other.mTerrainGenerator ? other.mTerrainGenerator->clone() : nullptr )
, mMapTileResolution( other.mMapTileResolution )
@@ -50,6 +51,7 @@ Qgs3DMapSettings::Qgs3DMapSettings( const Qgs3DMapSettings &other )
, mPointLights( other.mPointLights )
, mFieldOfView( other.mFieldOfView )
, mLayers( other.mLayers )
, mRenderers() // initialized in body
, mSkyboxEnabled( other.mSkyboxEnabled )
, mSkyboxFileBase( other.mSkyboxFileBase )
, mSkyboxFileExtension( other.mSkyboxFileExtension )
@@ -956,6 +956,7 @@ QgsMeshParticleTracesField::QgsMeshParticleTracesField( const QgsTriangularMesh
QgsMeshParticleTracesField::QgsMeshParticleTracesField( const QgsMeshParticleTracesField &other ):
QgsMeshStreamField( other ),
mTimeField( other.mTimeField ),
mMagnitudeField( other.mMagnitudeField ),
mDirectionField( other.mDirectionField ),
mParticles( other.mParticles ),
mStumpImage( other.mStumpImage ),
@@ -87,8 +87,8 @@ class GUI_EXPORT QgsTextEditWrapper : public QgsEditorWidgetWrapper
void textChanged( const QString &text );

private:
bool mutable mInvalidJSON;
QgsAttributeForm *mForm;
bool mutable mInvalidJSON = false;
QgsAttributeForm *mForm = nullptr;
void updateValues( const QVariant &val, const QVariantList & = QVariantList() ) override;

QTextBrowser *mTextBrowser = nullptr;
@@ -325,7 +325,7 @@ bool QgsGeorefTransform::gdal_transform( const QgsPointXY &src, QgsPointXY &dst,
double x = src.x();
double y = src.y();
double z = 0.0;
int success;
int success = 0;

// Call GDAL transform function
( *t )( GDALTransformerArgs(), dstToSrc, 1, &x, &y, &z, &success );
@@ -33,11 +33,8 @@
namespace Konsole {

struct Block {
Block() {
size = 0;
}
unsigned char data[ENTRIES];
size_t size;
unsigned char data[ENTRIES] = {};
size_t size = 0;
};


@@ -75,7 +75,7 @@ class HistoryFile
//'get' is called.
//this is used to detect when a large number of lines are being read and processed from the history
//and automatically mmap the file for better performance (saves the overhead of many lseek-read calls).
int readWriteBalance;
int readWriteBalance = 0;

//when readWriteBalance goes below this threshold, the file will be mmap'ed automatically
static const int MAP_THRESHOLD = -1000;
@@ -30,6 +30,7 @@ using namespace Konsole;

ScreenWindow::ScreenWindow(QObject* parent)
: QObject(parent)
, _screen(0)
, _windowBuffer(0)
, _windowBufferSize(0)
, _bufferNeedsUpdate(true)
@@ -148,18 +148,19 @@ class GRASS_LIB_EXPORT QgsGrassGisLib
//! Current region extent
QgsRectangle mExtent;
//! Current region rows
int mRows;
int mRows = 0;
//! Current region columns
int mColumns;
int mColumns = 0;
//! X resolution
double mXRes;
double mXRes = 0;
//! Y resolution
double mYRes;
double mYRes = 0;
//! Current coordinate reference system
QgsCoordinateReferenceSystem mCrs;
QgsDistanceArea mDistanceArea;
//! Lat1, lat2 used for geodesic distance calculation
double mLat1, mLat2;
double mLat1 = 0;
double mLat2 = 0;
};

#endif // QGSGRASSGISLIB_H
@@ -68,11 +68,10 @@ QgsWcsCapabilities::QgsWcsCapabilities( const QgsWcsCapabilities &other )
, mServiceExceptionReportDom( other.mServiceExceptionReportDom )
, mCapabilities( other.mCapabilities )
, mCoveragesSupported( other.mCoveragesSupported )
// intentionally omitted:
// - mCapabilitiesReply
// - mErrorTitle
// - mError
// - mErrorFormat
, mCapabilitiesReply( nullptr ) // not copied from other
, mErrorTitle() // not copied from other
, mError() // not copied from other
, mErrorFormat() // not copied from other
, mCoverageCount( other.mCoverageCount )
, mCoverageParents( other.mCoverageParents )
, mCoverageParentIdentifiers( other.mCoverageParentIdentifiers )

0 comments on commit 9cc37a1

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