Skip to content
Permalink
Browse files

another round of coverity and cppcheck fixes

  • Loading branch information
jef-n committed Jul 3, 2015
1 parent 5b54e26 commit 3856ccf2f8f2799cd4e873079992f40779cdbf55
@@ -19,18 +19,18 @@

#include "Triangulation.h"

/**Decorator class for Triangulations (s. Decorator pattern in Gamma et al.)*/
/** Decorator class for Triangulations (s. Decorator pattern in Gamma et al.)*/
class TriDecorator : public Triangulation
{
public:
TriDecorator();
TriDecorator( Triangulation* t );
explicit TriDecorator( Triangulation* t );
virtual ~TriDecorator();
virtual void addLine( Line3D* line, bool breakline ) override;
virtual int addPoint( Point3D* p ) override;
/**Adds an association to a triangulation*/
/** Adds an association to a triangulation*/
virtual void addTriangulation( Triangulation* t );
/**Performs a consistency check, remove this later*/
/** Performs a consistency check, remove this later*/
virtual void performConsistencyTest() override;
virtual bool calcNormal( double x, double y, Vector3D* result ) override;
virtual bool calcPoint( double x, double y, Point3D* result ) override;
@@ -56,7 +56,7 @@ class TriDecorator : public Triangulation
virtual bool swapEdge( double x, double y ) override;
virtual QList<int>* getPointsAroundEdge( double x, double y ) override;
protected:
/**Association with a Triangulation object*/
/** Association with a Triangulation object*/
Triangulation* mTIN;
};

@@ -35,8 +35,8 @@
class QgsPointCompare
{
public:
QgsPointCompare( double tolerance ) :
mTolerance( tolerance )
explicit QgsPointCompare( double tolerance )
: mTolerance( tolerance )
{ }

bool operator()( const QgsPoint& p1, const QgsPoint& p2 ) const
@@ -325,6 +325,7 @@ void QgsLineVectorLayerDirector::makeGraph( QgsGraphBuilderInterface *builder, c
TiePointInfo t;
t.mFirstPoint = pt1;
t.mLastPoint = pt2;
t.mLength = 0.0;
pointLengthIt = my_binary_search( pointLengthMap.begin(), pointLengthMap.end(), t, TiePointInfoCompare );

if ( pointLengthIt != pointLengthMap.end() )
@@ -556,6 +556,7 @@ bool QgsAlignRaster::suggestedWarpOutput( const QgsAlignRaster::RasterInfo& info


QgsAlignRaster::RasterInfo::RasterInfo( const QString& layerpath )
: mBandCnt( 0 )
{
mDataset = GDALOpen( layerpath.toLocal8Bit().constData(), GA_ReadOnly );
if ( !mDataset )
@@ -564,7 +565,7 @@ QgsAlignRaster::RasterInfo::RasterInfo( const QString& layerpath )
mXSize = GDALGetRasterXSize( mDataset );
mYSize = GDALGetRasterYSize( mDataset );

GDALGetGeoTransform( mDataset, mGeoTransform );
( void ) GDALGetGeoTransform( mDataset, mGeoTransform );

// TODO: may be null or empty string
mCrsWkt = QString::fromAscii( GDALGetProjectionRef( mDataset ) );
@@ -104,8 +104,12 @@ class ANALYSIS_EXPORT QgsAlignRaster
struct Item
{
Item( const QString& input, const QString& output )
: inputFilename( input ), outputFilename( output )
, resampleMethod( RA_NearestNeighbour ), rescaleValues( false ) {}
: inputFilename( input )
, outputFilename( output )
, resampleMethod( RA_NearestNeighbour )
, rescaleValues( false )
, srcCellSizeInDestCRS( 0.0 )
{}

//! filename of the source raster
QString inputFilename;
@@ -526,11 +526,7 @@ void QgsMssqlSourceSelect::on_btnConnect_clicked()
if ( useGeometryColumns )
{
QString testquery( "SELECT count(*) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'geometry_columns'" );
q.exec( testquery );
q.first();
int count = q.value( 0 ).toInt();
bool geometryColumnsFound = count != 0;
if ( !geometryColumnsFound )
if ( !q.exec( testquery ) || !q.first() || q.value( 0 ).toInt() == 0 )
{
QMessageBox::StandardButtons reply;
reply = QMessageBox::question( this, "Scan full database?",
@@ -44,6 +44,7 @@ class TestQgsAtlasComposition : public QObject
, mLabel2( 0 )
, mAtlasMap( 0 )
, mOverview( 0 )
, mMapSettings( 0 )
, mVectorLayer( 0 )
, mVectorLayer2( 0 )
, mAtlas( 0 )
@@ -88,7 +89,6 @@ class TestQgsAtlasComposition : public QObject
QgsComposerLabel* mLabel2;
QgsComposerMap* mAtlasMap;
QgsComposerMap* mOverview;
//QgsMapRenderer* mMapRenderer;
QgsMapSettings *mMapSettings;
QgsVectorLayer* mVectorLayer;
QgsVectorLayer* mVectorLayer2;
@@ -70,8 +70,9 @@ class TestQgsComposerPicture : public QObject
};

TestQgsComposerPicture::TestQgsComposerPicture()
: mComposition( NULL )
, mComposerPicture( NULL )
: mComposition( 0 )
, mComposerPicture( 0 )
, mMapSettings( 0 )
{

}
@@ -41,6 +41,7 @@ class TestQgsComposerTableV2 : public QObject
public:
TestQgsComposerTableV2()
: mComposition( 0 )
, mMapSettings( 0 )
, mVectorLayer( 0 )
, mComposerAttributeTable( 0 )
, mFrame1( 0 )
@@ -42,6 +42,7 @@ class TestQgsMapRotation : public QObject
: mRasterLayer( 0 )
, mPointsLayer( 0 )
, mLinesLayer( 0 )
, mMapSettings( 0 )
{
mTestDataDir = QString( TEST_DATA_DIR ) + "/";
}

0 comments on commit 3856ccf

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