Skip to content

Commit deffd96

Browse files
author
jef
committed
fix warnings
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@12541 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent fc4fd9e commit deffd96

File tree

5 files changed

+21
-11
lines changed

5 files changed

+21
-11
lines changed

CMakeLists.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ IF (WITH_BINDINGS)
7575
SET (BINDINGS_GLOBAL_INSTALL FALSE CACHE BOOL "Install bindings to global python directory? (might need root)")
7676
ENDIF (WITH_BINDINGS)
7777

78-
# Compile flag. Make it posible to turn it off.
78+
# Compile flag. Make it possible to turn it off.
7979
SET (PEDANTIC FALSE CACHE BOOL "Determines if we should compile in pedantic mode.")
8080

8181
# whether unit tests should be build
@@ -214,8 +214,9 @@ IF (PEDANTIC)
214214
ADD_DEFINITIONS( /wd4510 ) # default constructor could not be generated (sqlite3_index_info, QMap)
215215
ADD_DEFINITIONS( /wd4512 ) # assignment operator could not be generated (sqlite3_index_info)
216216
ADD_DEFINITIONS( /wd4610 ) # user defined constructor required (sqlite3_index_info)
217+
ADD_DEFINITIONS( /wd4706 ) # assignment within conditional expression (pal)
217218
ELSE (MSVC)
218-
ADD_DEFINITIONS( -Wall -Wno-long-long -Wformat-security )
219+
ADD_DEFINITIONS( -Wall -Wno-long-long -Wformat-security -Wno-strict-aliasing )
219220
# Qt produces lots of warnings with strict aliasing (as of Qt 4.4.0 & GCC 4.3)
220221
# ADD_DEFINITIONS( -fstrict-aliasing -Wstrict-aliasing=1 )
221222
ENDIF (MSVC)
@@ -284,7 +285,7 @@ ENDIF (WIN32)
284285

285286
#assume we have excaped compiler directives
286287
#eventually we want to change this to new
287-
#since we dont need to jump through so many
288+
#since we don't need to jump through so many
288289
#hoops to escape compiler directives then
289290
IF(COMMAND cmake_policy)
290291
cmake_policy(SET CMP0003 NEW)

src/analysis/interpolation/NormVecDecorator.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ bool NormVecDecorator::estimateFirstDerivative( int pointno )
384384
if ( !vlist )
385385
{
386386
//something went wrong in getSurroundingTriangles, set the normal to (0,0,0)
387-
if ( mNormVec->size() <= mNormVec->count() )//allocate more memory if neccessary
387+
if ( mNormVec->size() <= mNormVec->count() )//allocate more memory if necessary
388388
{
389389
QgsDebugMsg( QString( "resizing mNormVec from %1 to %2" ).arg( mNormVec->size() ).arg( mNormVec->size() + 1 ) );
390390
mNormVec->resize( mNormVec->size() + 1 );
@@ -474,15 +474,15 @@ bool NormVecDecorator::estimateFirstDerivative( int pointno )
474474
{
475475
status = ENDPOINT;
476476
}
477-
else if ( numberofbreaks > 1 )
477+
else
478478
{
479479
status = BREAKLINE;
480480
}
481481

482482
delete vlist;
483483

484484
//insert the new calculated vector
485-
if ( mNormVec->size() <= mNormVec->count() )//allocate more memory if neccessary
485+
if ( mNormVec->size() <= mNormVec->count() )//allocate more memory if necessary
486486
{
487487
mNormVec->resize( mNormVec->size() + 1 );
488488
}

src/analysis/vector/qgsgeometryanalyzer.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ bool QgsGeometryAnalyzer::convexHull( QgsVectorLayer* layer, const QString& shap
408408

409409
QgsVectorFileWriter vWriter( shapefileName, dp->encoding(), fields, outputType, &crs );
410410
QgsFeature currentFeature;
411-
QgsGeometry* dissolveGeometry; //dissolve geometry
411+
QgsGeometry* dissolveGeometry = 0; //dissolve geometry
412412
QMultiMap<QString, int> map;
413413

414414
if ( onlySelectedFeatures )
@@ -493,6 +493,11 @@ bool QgsGeometryAnalyzer::convexHull( QgsVectorLayer* layer, const QString& shap
493493
++jt;
494494
}
495495
QList<double> values;
496+
if( !dissolveGeometry )
497+
{
498+
QgsDebugMsg( "no dissolved geometry - should not happen" );
499+
return false;
500+
}
496501
dissolveGeometry = dissolveGeometry->convexHull();
497502
values = simpleMeasure( dissolveGeometry );
498503
QgsAttributeMap attributeMap;
@@ -534,6 +539,11 @@ bool QgsGeometryAnalyzer::convexHull( QgsVectorLayer* layer, const QString& shap
534539
}
535540
QList<double> values;
536541
// QgsGeometry* tmpGeometry = 0;
542+
if( !dissolveGeometry )
543+
{
544+
QgsDebugMsg( "no dissolved geometry - should not happen" );
545+
return false;
546+
}
537547
dissolveGeometry = dissolveGeometry->convexHull();
538548
// values = simpleMeasure( tmpGeometry );
539549
values = simpleMeasure( dissolveGeometry );
@@ -629,7 +639,7 @@ bool QgsGeometryAnalyzer::dissolve( QgsVectorLayer* layer, const QString& shapef
629639
}
630640
}
631641

632-
QgsGeometry* dissolveGeometry; //dissolve geometry
642+
QgsGeometry *dissolveGeometry = 0; //dissolve geometry
633643
QMultiMap<QString, int>::const_iterator jt = map.constBegin();
634644
QgsFeature outputFeature;
635645
while ( jt != map.constEnd() )

src/core/pal/layer.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,6 @@ namespace pal
237237
{
238238
modMutex->unlock();
239239
throw new PalException::FeatureExists();
240-
return false;
241240
}
242241

243242
// Split MULTI GEOM and Collection in simple geometries

src/core/raster/qgsrastertransparency.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ int QgsRasterTransparency::alphaValue( double theValue, int theGlobalTransparenc
105105

106106
//Search through he transparency list looking for a match
107107
bool myTransparentPixelFound = false;
108-
TransparentSingleValuePixel myTransparentPixel;
108+
TransparentSingleValuePixel myTransparentPixel = {0,100};
109109
for ( int myListRunner = 0; myListRunner < mTransparentSingleValuePixelList.count(); myListRunner++ )
110110
{
111111
myTransparentPixel = mTransparentSingleValuePixelList[myListRunner];
@@ -143,7 +143,7 @@ int QgsRasterTransparency::alphaValue( double theRedValue, double theGreenValue,
143143

144144
//Search through he transparency list looking for a match
145145
bool myTransparentPixelFound = false;
146-
TransparentThreeValuePixel myTransparentPixel;
146+
TransparentThreeValuePixel myTransparentPixel = {0,0,0,100};
147147
for ( int myListRunner = 0; myListRunner < mTransparentThreeValuePixelList.count(); myListRunner++ )
148148
{
149149
myTransparentPixel = mTransparentThreeValuePixelList[myListRunner];

0 commit comments

Comments
 (0)