Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix a bunch of (probably harmless) uninitialized variables
(improves Coverity signal-to-noise ratio)
  • Loading branch information
nyalldawson committed Feb 6, 2015
1 parent e219a14 commit 88c928a
Show file tree
Hide file tree
Showing 63 changed files with 213 additions and 76 deletions.
2 changes: 2 additions & 0 deletions src/analysis/vector/qgspointsample.cpp
Expand Up @@ -13,6 +13,8 @@ QgsPointSample::QgsPointSample( QgsVectorLayer* inputLayer, const QString& outpu
}

QgsPointSample::QgsPointSample()
: mInputLayer( NULL )
, mNCreatedPoints( 0 )
{
}

Expand Down
53 changes: 28 additions & 25 deletions src/app/composer/qgsattributeselectiondialog.cpp
Expand Up @@ -269,19 +269,21 @@ void QgsComposerColumnWidthDelegate::updateEditorGeometry( QWidget *editor, cons
// QgsAttributeSelectionDialog

QgsAttributeSelectionDialog::QgsAttributeSelectionDialog( QgsComposerAttributeTableV2* table, QgsVectorLayer* vLayer,
QWidget* parent, Qt::WindowFlags f ): QDialog( parent, f ),
mComposerTable( table ),
mComposerTableV1( 0 ),
mVectorLayer( vLayer ),
mColumnModel( 0 ),
mColumnModelV1( 0 ),
mSortedProxyModel( 0 ),
mSortedProxyModelV1( 0 ),
mAvailableSortProxyModel( 0 ),
mAvailableSortProxyModelV1( 0 ),
mColumnAlignmentDelegate( 0 ),
mColumnSortOrderDelegate( 0 ),
mColumnWidthDelegate( 0 )
QWidget* parent, Qt::WindowFlags f )
: QDialog( parent, f )
, mComposerTable( table )
, mComposerTableV1( NULL )
, mVectorLayer( vLayer )
, mColumnModel( NULL )
, mColumnModelV1( NULL )
, mSortedProxyModel( NULL )
, mSortedProxyModelV1( NULL )
, mAvailableSortProxyModel( NULL )
, mAvailableSortProxyModelV1( NULL )
, mColumnAlignmentDelegate( NULL )
, mColumnSourceDelegate( NULL )
, mColumnSortOrderDelegate( NULL )
, mColumnWidthDelegate( NULL )
{
setupUi( this );

Expand Down Expand Up @@ -323,18 +325,19 @@ QgsAttributeSelectionDialog::QgsAttributeSelectionDialog( QgsComposerAttributeTa
}

QgsAttributeSelectionDialog::QgsAttributeSelectionDialog( QgsComposerAttributeTable *table, QgsVectorLayer *vLayer, QWidget *parent, Qt::WindowFlags f )
: QDialog( parent, f ),
mComposerTable( 0 ),
mComposerTableV1( table ),
mVectorLayer( vLayer ),
mColumnModel( 0 ),
mColumnModelV1( 0 ),
mSortedProxyModel( 0 ),
mSortedProxyModelV1( 0 ),
mAvailableSortProxyModel( 0 ),
mAvailableSortProxyModelV1( 0 ),
mColumnAlignmentDelegate( 0 ),
mColumnSortOrderDelegate( 0 )
: QDialog( parent, f )
, mComposerTable( NULL )
, mComposerTableV1( table )
, mVectorLayer( vLayer )
, mColumnModel( NULL )
, mColumnModelV1( NULL )
, mSortedProxyModel( NULL )
, mSortedProxyModelV1( NULL )
, mAvailableSortProxyModel( NULL )
, mAvailableSortProxyModelV1( NULL )
, mColumnAlignmentDelegate( NULL )
, mColumnSortOrderDelegate( NULL )
, mColumnWidthDelegate( NULL )
{
setupUi( this );

Expand Down
7 changes: 6 additions & 1 deletion src/app/composer/qgscomposerhtmlwidget.cpp
Expand Up @@ -79,7 +79,12 @@ QgsComposerHtmlWidget::QgsComposerHtmlWidget( QgsComposerHtml* html, QgsComposer

}

QgsComposerHtmlWidget::QgsComposerHtmlWidget(): QgsComposerItemBaseWidget( 0, 0 )
QgsComposerHtmlWidget::QgsComposerHtmlWidget()
: QgsComposerItemBaseWidget( 0, 0 )
, mHtml( NULL )
, mFrame( NULL )
, mHtmlEditor( NULL )
, mStylesheetEditor( NULL )
{
}

Expand Down
9 changes: 8 additions & 1 deletion src/app/composer/qgscomposeritemwidget.cpp
Expand Up @@ -176,7 +176,14 @@ QgsComposerItemWidget::QgsComposerItemWidget( QWidget* parent, QgsComposerItem*
connect( mExcludePrintsDDBtn, SIGNAL( dataDefinedActivated( bool ) ), this, SLOT( updateDataDefinedProperty() ) );
}

QgsComposerItemWidget::QgsComposerItemWidget(): QgsComposerItemBaseWidget( 0, 0 )
QgsComposerItemWidget::QgsComposerItemWidget()
: QgsComposerItemBaseWidget( 0, 0 )
, mItem( NULL )
, mFreezeXPosSpin( false )
, mFreezeYPosSpin( false )
, mFreezeWidthSpin( false )
, mFreezeHeightSpin( false )
, mFreezePageSpin( false )
{

}
Expand Down
7 changes: 4 additions & 3 deletions src/app/qgisappinterface.cpp
Expand Up @@ -46,9 +46,10 @@


QgisAppInterface::QgisAppInterface( QgisApp * _qgis )
: qgis( _qgis ),
legendIface( _qgis->layerTreeView() ),
pluginManagerIface( _qgis->pluginManager() )
: qgis( _qgis )
, mTimer( NULL )
, legendIface( _qgis->layerTreeView() )
, pluginManagerIface( _qgis->pluginManager() )
{
// connect signals
connect( qgis->layerTreeView(), SIGNAL( currentLayerChanged( QgsMapLayer * ) ),
Expand Down
1 change: 1 addition & 0 deletions src/app/qgscustomization.cpp
Expand Up @@ -628,6 +628,7 @@ QgsCustomization *QgsCustomization::instance()
QgsCustomization::QgsCustomization()
: pDialog( 0 )
, mEnabled( false )
, mSettings( NULL )
, mStatusPath( "/Customization/status" )
{
QgsDebugMsg( "Entered" );
Expand Down
6 changes: 6 additions & 0 deletions src/app/qgsfieldsproperties.cpp
Expand Up @@ -41,6 +41,9 @@
QgsFieldsProperties::QgsFieldsProperties( QgsVectorLayer *layer, QWidget* parent )
: QWidget( parent )
, mLayer( layer )
, mDesignerTree( NULL )
, mFieldsList( NULL )
, mRelationsList( NULL )
{
if ( !layer )
return;
Expand Down Expand Up @@ -804,17 +807,20 @@ void QgsFieldsProperties::apply()
*/

QgsFieldsProperties::FieldConfig::FieldConfig()
: mButton( NULL )
{
}

QgsFieldsProperties::FieldConfig::FieldConfig( QgsVectorLayer* layer, int idx )
: mButton( NULL )
{
mEditable = layer->fieldEditable( idx );
mEditableEnabled = layer->pendingFields().fieldOrigin( idx ) != QgsFields::OriginJoin
&& layer->pendingFields().fieldOrigin( idx ) != QgsFields::OriginExpression;
mLabelOnTop = layer->labelOnTop( idx );
mEditorWidgetV2Type = layer->editorWidgetV2( idx );
mEditorWidgetV2Config = layer->editorWidgetV2Config( idx );

}

/*
Expand Down
3 changes: 3 additions & 0 deletions src/app/qgsmaptooldeletepart.cpp
Expand Up @@ -26,7 +26,10 @@

QgsMapToolDeletePart::QgsMapToolDeletePart( QgsMapCanvas* canvas )
: QgsMapToolEdit( canvas )
, vlayer( NULL )
, mRubberBand( 0 )
, mPressedFid( 0 )
, mPressedPartNum( 0 )
{
mToolName = tr( "Delete part" );
}
Expand Down
4 changes: 4 additions & 0 deletions src/app/qgsmaptooldeletering.cpp
Expand Up @@ -24,7 +24,11 @@

QgsMapToolDeleteRing::QgsMapToolDeleteRing( QgsMapCanvas* canvas )
: QgsMapToolEdit( canvas )
, vlayer( NULL )
, mRubberBand( 0 )
, mPressedFid( 0 )
, mPressedPartNum( 0 )
, mPressedRingNum( 0 )
{
mToolName = tr( "Delete ring" );
}
Expand Down
2 changes: 0 additions & 2 deletions src/app/qgsmaptoolidentifyaction.h
Expand Up @@ -82,8 +82,6 @@ class APP_EXPORT QgsMapToolIdentifyAction : public QgsMapToolIdentify

virtual QGis::UnitType displayUnits() override;

// pointers to the custom actions for identify menu
QAction* mAttributeTableAction;
};

#endif
10 changes: 9 additions & 1 deletion src/app/qgsrasterlayerproperties.cpp
Expand Up @@ -72,8 +72,16 @@ QgsRasterLayerProperties::QgsRasterLayerProperties( QgsMapLayer* lyr, QgsMapCanv
: QgsOptionsDialogBase( "RasterLayerProperties", parent, fl )
// Constant that signals property not used.
, TRSTRING_NOT_SET( tr( "Not Set" ) )
, mRasterLayer( qobject_cast<QgsRasterLayer *>( lyr ) ), mRendererWidget( 0 )
, mDefaultStandardDeviation( 0 )
, mDefaultRedBand( 0 )
, mDefaultGreenBand( 0 )
, mDefaultBlueBand( 0 )
, mRasterLayer( qobject_cast<QgsRasterLayer *>( lyr ) )
, mRendererWidget( 0 )
, mGradientHeight( 0.0 )
, mGradientWidth( 0.0 )
, mMapCanvas( theCanvas )
, mHistogramWidget( NULL )
{
mGrayMinimumMaximumEstimated = true;
mRGBMinimumMaximumEstimated = true;
Expand Down
5 changes: 5 additions & 0 deletions src/core/composer/qgscomposermapoverview.cpp
Expand Up @@ -36,6 +36,11 @@ QgsComposerMapOverview::QgsComposerMapOverview( const QString& name, QgsComposer

QgsComposerMapOverview::QgsComposerMapOverview()
: QgsComposerMapItem( QString(), 0 )
, mFrameMapId( -1 )
, mFrameSymbol( 0 )
, mBlendMode( QPainter::CompositionMode_SourceOver )
, mInverted( false )
, mCentered( false )
{
}

Expand Down
5 changes: 5 additions & 0 deletions src/core/pal/pointset.cpp
Expand Up @@ -93,6 +93,11 @@ namespace pal
}

PointSet::PointSet( PointSet &ps )
: parent( 0 )
, xmin( DBL_MAX )
, xmax( -DBL_MAX )
, ymin( DBL_MAX )
, ymax( -DBL_MAX )
{
int i;

Expand Down
1 change: 1 addition & 0 deletions src/core/pal/rtree.hpp
Expand Up @@ -144,6 +144,7 @@ namespace pal

struct StackElement
{
StackElement() : m_node( NULL ), m_branchIndex( 0 ) {}
Node* m_node;
int m_branchIndex;
};
Expand Down
4 changes: 4 additions & 0 deletions src/core/qgsgml.cpp
Expand Up @@ -40,10 +40,14 @@ QgsGml::QgsGml(
: QObject()
, mTypeName( typeName )
, mGeometryAttribute( geometryAttribute )
, mWkbType( NULL )
, mFinished( false )
, mCurrentFeature( 0 )
, mFeatureCount( 0 )
, mCurrentWKB( NULL )
, mCurrentWKBSize( 0 )
, mDimension( 2 )
, mCoorMode( QgsGml::coordinate )
, mEpsg( 0 )
{
mThematicAttributes.clear();
Expand Down
4 changes: 4 additions & 0 deletions src/core/qgsgmlschema.cpp
Expand Up @@ -59,6 +59,10 @@ int QgsGmlFeatureClass::fieldIndex( const QString & name )
// --------------------------- QgsGmlSchema -------------------------------
QgsGmlSchema::QgsGmlSchema()
: QObject()
, mCurrentFeature( NULL )
, mFeatureCount( 0 )
, mLevel( 0 )
, mSkipLevel( std::numeric_limits<int>::max() )
{
mGeometryTypes << "Point" << "MultiPoint"
<< "LineString" << "MultiLineString"
Expand Down
7 changes: 6 additions & 1 deletion src/core/qgshttptransaction.cpp
Expand Up @@ -43,9 +43,14 @@ QgsHttpTransaction::QgsHttpTransaction( QString uri,
QNetworkProxy::ProxyType proxyType,
QString userName,
QString password )
: httpresponsecontenttype( "" )
: http( NULL )
, httpid( 0 )
, httpactive( false )
, httpresponsecontenttype( "" )
, httpurl( uri )
, httphost( proxyHost )
, httpredirections( 0 )
, mWatchdogTimer( NULL )
, mError( "" )
{
Q_UNUSED( proxyPort );
Expand Down
19 changes: 15 additions & 4 deletions src/core/qgspallabeling.cpp
Expand Up @@ -81,6 +81,7 @@ QgsPalLayerSettings::QgsPalLayerSettings()
: palLayer( NULL )
, mCurFeat( 0 )
, mCurFields( 0 )
, xform( NULL )
, ct( NULL )
, extentGeom( NULL )
, mFeaturesToLabel( 0 )
Expand All @@ -89,6 +90,8 @@ QgsPalLayerSettings::QgsPalLayerSettings()
, expression( NULL )
{
enabled = false;
isExpression = false;
fieldIndex = 0;

// text style
textFont = QApplication::font();
Expand Down Expand Up @@ -311,6 +314,18 @@ QgsPalLayerSettings::QgsPalLayerSettings()
}

QgsPalLayerSettings::QgsPalLayerSettings( const QgsPalLayerSettings& s )
: palLayer( NULL )
, mCurFeat( NULL )
, mCurFields( NULL )
, fieldIndex( 0 )
, xform( NULL )
, ct( NULL )
, extentGeom( NULL )
, mFeaturesToLabel( 0 )
, mFeatsSendingToPal( 0 )
, mFeatsRegPal( 0 )
, showingShadowRects( false )
, expression( NULL )
{
// copy only permanent stuff

Expand Down Expand Up @@ -443,10 +458,6 @@ QgsPalLayerSettings::QgsPalLayerSettings( const QgsPalLayerSettings& s )
// scale factors
vectorScaleFactor = s.vectorScaleFactor;
rasterCompressFactor = s.rasterCompressFactor;

ct = NULL;
extentGeom = NULL;
expression = NULL;
}


Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsvectorlayereditbuffer.h
Expand Up @@ -131,7 +131,7 @@ class CORE_EXPORT QgsVectorLayerEditBuffer : public QObject

protected:

QgsVectorLayerEditBuffer() {}
QgsVectorLayerEditBuffer() : L( NULL ) {}

void updateFields( QgsFields& fields );

Expand Down
11 changes: 11 additions & 0 deletions src/core/raster/qgsrasterfilewriter.cpp
Expand Up @@ -37,6 +37,17 @@ QgsRasterFileWriter::QgsRasterFileWriter( const QString& outputUrl ):
}

QgsRasterFileWriter::QgsRasterFileWriter()
: mMode( Raw )
, mOutputProviderKey( "gdal" )
, mOutputFormat( "GTiff" )
, mTiledMode( false )
, mMaxTileWidth( 500 )
, mMaxTileHeight( 500 )
, mBuildPyramidsFlag( QgsRaster::PyramidsFlagNo )
, mPyramidsFormat( QgsRaster::PyramidsGTiff )
, mProgressDialog( 0 )
, mPipe( 0 )
, mInput( 0 )
{

}
Expand Down
1 change: 1 addition & 0 deletions src/core/symbology-ng/qgspointdisplacementrenderer.cpp
Expand Up @@ -38,6 +38,7 @@ QgsPointDisplacementRenderer::QgsPointDisplacementRenderer( const QString& label
, mCircleColor( QColor( 125, 125, 125 ) )
, mCircleRadiusAddition( 0 )
, mMaxLabelScaleDenominator( -1 )
, mSpatialIndex( NULL )
{
mRenderer = QgsFeatureRendererV2::defaultRenderer( QGis::Point );
mCenterSymbol = new QgsMarkerSymbolV2(); //the symbol for the center of a displacement group
Expand Down
4 changes: 2 additions & 2 deletions src/core/symbology-ng/qgssvgcache.cpp
Expand Up @@ -37,12 +37,12 @@
#include <QNetworkRequest>

QgsSvgCacheEntry::QgsSvgCacheEntry(): file( QString() ), size( 0.0 ), outlineWidth( 0 ), widthScaleFactor( 1.0 ), rasterScaleFactor( 1.0 ), fill( Qt::black ),
outline( Qt::black ), image( 0 ), picture( 0 )
outline( Qt::black ), image( 0 ), picture( 0 ), nextEntry( 0 ), previousEntry( 0 )
{
}

QgsSvgCacheEntry::QgsSvgCacheEntry( const QString& f, double s, double ow, double wsf, double rsf, const QColor& fi, const QColor& ou ): file( f ), size( s ), outlineWidth( ow ),
widthScaleFactor( wsf ), rasterScaleFactor( rsf ), fill( fi ), outline( ou ), image( 0 ), picture( 0 )
widthScaleFactor( wsf ), rasterScaleFactor( rsf ), fill( fi ), outline( ou ), image( 0 ), picture( 0 ), nextEntry( 0 ), previousEntry( 0 )
{
}

Expand Down
2 changes: 1 addition & 1 deletion src/gui/attributetable/qgsattributetabledelegate.cpp
Expand Up @@ -133,7 +133,7 @@ void QgsAttributeTableDelegate::paint( QPainter * painter,
myOpt.palette.setColor( QPalette::Text, QColor( "gray" ) );
}

if ( mFeatureSelectionModel->isSelected( fid ) )
if ( mFeatureSelectionModel && mFeatureSelectionModel->isSelected( fid ) )
myOpt.state |= QStyle::State_Selected;

QItemDelegate::paint( painter, myOpt, index );
Expand Down
2 changes: 1 addition & 1 deletion src/gui/attributetable/qgsattributetabledelegate.h
Expand Up @@ -41,7 +41,7 @@ class GUI_EXPORT QgsAttributeTableDelegate : public QItemDelegate
* @param parent parent object
*/
QgsAttributeTableDelegate( QObject* parent = 0 ) :
QItemDelegate( parent ) {}
QItemDelegate( parent ), mFeatureSelectionModel( NULL ) {}

/** Used to create an editor for when the user tries to
* change the contents of a cell */
Expand Down

0 comments on commit 88c928a

Please sign in to comment.