Skip to content

Commit

Permalink
Fix Coverity uninitialized variable warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Oct 1, 2016
1 parent ffaffad commit 17db101
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 9 deletions.
5 changes: 4 additions & 1 deletion src/core/qgsattributeeditorelement.h
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,10 @@ class CORE_EXPORT QgsAttributeEditorRelation : public QgsAttributeEditorElement
QgsAttributeEditorRelation( const QString& name, const QgsRelation& relation, QgsAttributeEditorElement* parent )
: QgsAttributeEditorElement( AeTypeRelation, name, parent )
, mRelationId( relation.id() )
, mRelation( relation ) {}
, mRelation( relation )
, mShowLinkButton( true )
, mShowUnlinkButton( true )
{}

//! Destructor
virtual ~QgsAttributeEditorRelation() {}
Expand Down
1 change: 1 addition & 0 deletions src/gui/qgsunitselectionwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ QgsMapUnitScale QgsMapUnitScaleWidget::mapUnitScale() const

QgsUnitSelectionWidget::QgsUnitSelectionWidget( QWidget *parent )
: QWidget( parent )
, mCanvas( nullptr )
{
mMapUnitIdx = -1;

Expand Down
1 change: 1 addition & 0 deletions src/plugins/grass/qgsgrassregion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ QgsGrassRegion::QgsGrassRegion( QgisInterface *iface,
, mRegionEdit( 0 )
{
QgsDebugMsg( "QgsGrassRegion()" );
QgsGrass::initRegion( &mWindow );

setupUi( this );
setAttribute( Qt::WA_DeleteOnClose );
Expand Down
6 changes: 3 additions & 3 deletions src/providers/grass/qgsgrass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1686,14 +1686,14 @@ bool QgsGrass::writeRegion( const QString& gisbase,
const QString& location, const QString& mapset,
const struct Cell_head *window )
{
QgsDebugMsg( QString( "n = %1 s = %2" ).arg( window->north ).arg( window->south ) );
QgsDebugMsg( QString( "e = %1 w = %2" ).arg( window->east ).arg( window->west ) );

if ( !window )
{
return false;
}

QgsDebugMsg( QString( "n = %1 s = %2" ).arg( window->north ).arg( window->south ) );
QgsDebugMsg( QString( "e = %1 w = %2" ).arg( window->east ).arg( window->west ) );

QgsGrass::setMapset( gisbase, location, mapset );

if ( G_put_window( window ) == -1 )
Expand Down
9 changes: 9 additions & 0 deletions src/providers/oracle/ocispatial/wkbptr.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,15 @@ enum SDO_GTYPE_TT
class QOCISpatialGeometry : public QSharedData
{
public:
QOCISpatialGeometry()
: isNull( true )
, gtype( -1 )
, srid( -1 )
, x( 0.0 )
, y( 0.0 )
, z( 0.0 )
{}

bool isNull;
int gtype;
int srid;
Expand Down
2 changes: 2 additions & 0 deletions src/providers/wms/qgswmsprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1218,6 +1218,7 @@ void QgsWmsProvider::setupXyzCapabilities( const QString &uri )
tm.tileWidth = tm.tileHeight = 256;
tm.matrixWidth = tm.matrixHeight = 1 << zoom;
tm.tres = xspan / ( tm.tileWidth * tm.matrixWidth );
tm.scaleDenom = 0.0;

mCaps.mTileMatrixSets[tms.identifier].tileMatrices[tm.tres] = tm;
}
Expand Down Expand Up @@ -3518,6 +3519,7 @@ QGISEXTERN bool isProvider()

QgsWmsImageDownloadHandler::QgsWmsImageDownloadHandler( const QString& providerUri, const QUrl& url, const QgsWmsAuthorization& auth, QImage* image, QgsRasterBlockFeedback* feedback )
: mProviderUri( providerUri )
, mCacheReply( nullptr )
, mCachedImage( image )
, mEventLoop( new QEventLoop )
, mFeedback( feedback )
Expand Down
8 changes: 3 additions & 5 deletions src/server/qgsserverlogger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ QgsServerLogger* QgsServerLogger::instance()
return mInstance;
}

QgsServerLogger::QgsServerLogger(): mLogFile( nullptr )
QgsServerLogger::QgsServerLogger()
: mLogFile( nullptr )
, mLogLevel( 3 )
{
//logfile
QString filePath = getenv( "QGIS_SERVER_LOG_FILE" );
Expand All @@ -53,10 +55,6 @@ QgsServerLogger::QgsServerLogger(): mLogFile( nullptr )
{
mLogLevel = atoi( logLevelChar );
}
else
{
mLogLevel = 3;
}

connect( QgsMessageLog::instance(), SIGNAL( messageReceived( QString, QString, QgsMessageLog::MessageLevel ) ), this,
SLOT( logMessage( QString, QString, QgsMessageLog::MessageLevel ) ) );
Expand Down

0 comments on commit 17db101

Please sign in to comment.