Skip to content
Permalink
Browse files

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 88c928af5692fa8aa9f25f17665090b757d3f44d
Showing with 213 additions and 76 deletions.
  1. +2 −0 src/analysis/vector/qgspointsample.cpp
  2. +28 −25 src/app/composer/qgsattributeselectiondialog.cpp
  3. +6 −1 src/app/composer/qgscomposerhtmlwidget.cpp
  4. +8 −1 src/app/composer/qgscomposeritemwidget.cpp
  5. +4 −3 src/app/qgisappinterface.cpp
  6. +1 −0 src/app/qgscustomization.cpp
  7. +6 −0 src/app/qgsfieldsproperties.cpp
  8. +3 −0 src/app/qgsmaptooldeletepart.cpp
  9. +4 −0 src/app/qgsmaptooldeletering.cpp
  10. +0 −2 src/app/qgsmaptoolidentifyaction.h
  11. +9 −1 src/app/qgsrasterlayerproperties.cpp
  12. +5 −0 src/core/composer/qgscomposermapoverview.cpp
  13. +5 −0 src/core/pal/pointset.cpp
  14. +1 −0 src/core/pal/rtree.hpp
  15. +4 −0 src/core/qgsgml.cpp
  16. +4 −0 src/core/qgsgmlschema.cpp
  17. +6 −1 src/core/qgshttptransaction.cpp
  18. +15 −4 src/core/qgspallabeling.cpp
  19. +1 −1 src/core/qgsvectorlayereditbuffer.h
  20. +11 −0 src/core/raster/qgsrasterfilewriter.cpp
  21. +1 −0 src/core/symbology-ng/qgspointdisplacementrenderer.cpp
  22. +2 −2 src/core/symbology-ng/qgssvgcache.cpp
  23. +1 −1 src/gui/attributetable/qgsattributetabledelegate.cpp
  24. +1 −1 src/gui/attributetable/qgsattributetabledelegate.h
  25. +4 −0 src/gui/attributetable/qgsattributetableview.cpp
  26. +2 −1 src/gui/attributetable/qgsfeaturelistviewdelegate.cpp
  27. +3 −1 src/gui/editorwidgets/qgscheckboxwidgetwrapper.cpp
  28. +1 −0 src/gui/editorwidgets/qgsclassificationwidgetwrapper.cpp
  29. +3 −2 src/gui/editorwidgets/qgscolorwidgetwrapper.cpp
  30. +2 −1 src/gui/editorwidgets/qgsenumerationwidgetwrapper.cpp
  31. +4 −0 src/gui/editorwidgets/qgsphotowidgetwrapper.cpp
  32. +1 −0 src/gui/editorwidgets/qgsrelationreferencewidgetwrapper.cpp
  33. +4 −1 src/gui/editorwidgets/qgstexteditwrapper.cpp
  34. +3 −1 src/gui/editorwidgets/qgsuniquevaluewidgetwrapper.cpp
  35. +3 −1 src/gui/editorwidgets/qgsuuidwidgetwrapper.cpp
  36. +3 −0 src/gui/qgsexpressionbuilderwidget.cpp
  37. +5 −0 src/gui/qgsidentifymenu.h
  38. +1 −0 src/gui/qgsmapcanvassnappingutils.cpp
  39. +1 −1 src/gui/qgsmaptoolidentify.h
  40. +3 −0 src/gui/qgsprojectionselector.cpp
  41. +3 −1 src/gui/raster/qgssinglebandgrayrendererwidget.cpp
  42. +1 −0 src/gui/symbology-ng/qgsheatmaprendererwidget.cpp
  43. +0 −1 src/gui/symbology-ng/qgsrulebasedrendererv2widget.h
  44. +1 −0 src/gui/symbology-ng/qgssinglesymbolrendererv2widget.cpp
  45. +7 −0 src/plugins/coordinate_capture/coordinatecapture.cpp
  46. +0 −1 src/plugins/coordinate_capture/coordinatecapture.h
  47. +1 −0 src/plugins/evis/idtool/eviseventidtool.cpp
  48. +0 −2 src/plugins/georeferencer/qgsgcplistwidget.h
  49. +4 −0 src/plugins/georeferencer/qgsgeorefdatapoint.cpp
  50. +4 −1 src/plugins/georeferencer/qgsmapcoordsdialog.cpp
  51. +2 −0 src/plugins/oracle_raster/qgsoracle_plugin.cpp
  52. +0 −1 src/plugins/oracle_raster/qgsoracle_plugin.h
  53. +0 −2 src/plugins/roadgraph/settingsdlg.h
  54. +4 −1 src/plugins/spatialquery/qgsspatialquery.cpp
  55. +0 −1 src/plugins/topology/checkDock.cpp
  56. +0 −2 src/plugins/topology/checkDock.h
  57. +1 −1 src/providers/gpx/gpsdata.h
  58. +0 −3 src/providers/postgres/qgspostgresdataitems.h
  59. +7 −5 src/providers/wcs/qgswcscapabilities.cpp
  60. +1 −0 src/providers/wms/qgswmscapabilities.cpp
  61. +2 −0 tests/src/core/qgscompositionchecker.cpp
  62. +3 −2 tests/src/core/testqgsogcutils.cpp
  63. +1 −0 tests/src/core/testqgsrasterfilewriter.cpp
@@ -13,6 +13,8 @@ QgsPointSample::QgsPointSample( QgsVectorLayer* inputLayer, const QString& outpu
}

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

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

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

@@ -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 )
{
}

@@ -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 )
{

}
@@ -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 * ) ),
@@ -628,6 +628,7 @@ QgsCustomization *QgsCustomization::instance()
QgsCustomization::QgsCustomization()
: pDialog( 0 )
, mEnabled( false )
, mSettings( NULL )
, mStatusPath( "/Customization/status" )
{
QgsDebugMsg( "Entered" );
@@ -41,6 +41,9 @@
QgsFieldsProperties::QgsFieldsProperties( QgsVectorLayer *layer, QWidget* parent )
: QWidget( parent )
, mLayer( layer )
, mDesignerTree( NULL )
, mFieldsList( NULL )
, mRelationsList( NULL )
{
if ( !layer )
return;
@@ -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 );

}

/*
@@ -26,7 +26,10 @@

QgsMapToolDeletePart::QgsMapToolDeletePart( QgsMapCanvas* canvas )
: QgsMapToolEdit( canvas )
, vlayer( NULL )
, mRubberBand( 0 )
, mPressedFid( 0 )
, mPressedPartNum( 0 )
{
mToolName = tr( "Delete part" );
}
@@ -24,7 +24,11 @@

QgsMapToolDeleteRing::QgsMapToolDeleteRing( QgsMapCanvas* canvas )
: QgsMapToolEdit( canvas )
, vlayer( NULL )
, mRubberBand( 0 )
, mPressedFid( 0 )
, mPressedPartNum( 0 )
, mPressedRingNum( 0 )
{
mToolName = tr( "Delete ring" );
}
@@ -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
@@ -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;
@@ -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 )
{
}

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

@@ -144,6 +144,7 @@ namespace pal

struct StackElement
{
StackElement() : m_node( NULL ), m_branchIndex( 0 ) {}
Node* m_node;
int m_branchIndex;
};
@@ -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();
@@ -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"
@@ -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 );
@@ -81,6 +81,7 @@ QgsPalLayerSettings::QgsPalLayerSettings()
: palLayer( NULL )
, mCurFeat( 0 )
, mCurFields( 0 )
, xform( NULL )
, ct( NULL )
, extentGeom( NULL )
, mFeaturesToLabel( 0 )
@@ -89,6 +90,8 @@ QgsPalLayerSettings::QgsPalLayerSettings()
, expression( NULL )
{
enabled = false;
isExpression = false;
fieldIndex = 0;

// text style
textFont = QApplication::font();
@@ -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

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

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


@@ -131,7 +131,7 @@ class CORE_EXPORT QgsVectorLayerEditBuffer : public QObject

protected:

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

void updateFields( QgsFields& fields );

@@ -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 )
{

}
@@ -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
@@ -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 )
{
}

@@ -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 );
@@ -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 */

0 comments on commit 88c928a

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