Skip to content

Commit

Permalink
fix warnings
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@12541 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Dec 20, 2009
1 parent a81156f commit b2b6104
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 11 deletions.
7 changes: 4 additions & 3 deletions CMakeLists.txt
Expand Up @@ -75,7 +75,7 @@ IF (WITH_BINDINGS)
SET (BINDINGS_GLOBAL_INSTALL FALSE CACHE BOOL "Install bindings to global python directory? (might need root)")
ENDIF (WITH_BINDINGS)

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

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

#assume we have excaped compiler directives
#eventually we want to change this to new
#since we dont need to jump through so many
#since we don't need to jump through so many
#hoops to escape compiler directives then
IF(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW)
Expand Down
6 changes: 3 additions & 3 deletions src/analysis/interpolation/NormVecDecorator.cc
Expand Up @@ -384,7 +384,7 @@ bool NormVecDecorator::estimateFirstDerivative( int pointno )
if ( !vlist )
{
//something went wrong in getSurroundingTriangles, set the normal to (0,0,0)
if ( mNormVec->size() <= mNormVec->count() )//allocate more memory if neccessary
if ( mNormVec->size() <= mNormVec->count() )//allocate more memory if necessary
{
QgsDebugMsg( QString( "resizing mNormVec from %1 to %2" ).arg( mNormVec->size() ).arg( mNormVec->size() + 1 ) );
mNormVec->resize( mNormVec->size() + 1 );
Expand Down Expand Up @@ -474,15 +474,15 @@ bool NormVecDecorator::estimateFirstDerivative( int pointno )
{
status = ENDPOINT;
}
else if ( numberofbreaks > 1 )
else
{
status = BREAKLINE;
}

delete vlist;

//insert the new calculated vector
if ( mNormVec->size() <= mNormVec->count() )//allocate more memory if neccessary
if ( mNormVec->size() <= mNormVec->count() )//allocate more memory if necessary
{
mNormVec->resize( mNormVec->size() + 1 );
}
Expand Down
14 changes: 12 additions & 2 deletions src/analysis/vector/qgsgeometryanalyzer.cpp
Expand Up @@ -408,7 +408,7 @@ bool QgsGeometryAnalyzer::convexHull( QgsVectorLayer* layer, const QString& shap

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

if ( onlySelectedFeatures )
Expand Down Expand Up @@ -493,6 +493,11 @@ bool QgsGeometryAnalyzer::convexHull( QgsVectorLayer* layer, const QString& shap
++jt;
}
QList<double> values;
if( !dissolveGeometry )
{
QgsDebugMsg( "no dissolved geometry - should not happen" );
return false;
}
dissolveGeometry = dissolveGeometry->convexHull();
values = simpleMeasure( dissolveGeometry );
QgsAttributeMap attributeMap;
Expand Down Expand Up @@ -534,6 +539,11 @@ bool QgsGeometryAnalyzer::convexHull( QgsVectorLayer* layer, const QString& shap
}
QList<double> values;
// QgsGeometry* tmpGeometry = 0;
if( !dissolveGeometry )
{
QgsDebugMsg( "no dissolved geometry - should not happen" );
return false;
}
dissolveGeometry = dissolveGeometry->convexHull();
// values = simpleMeasure( tmpGeometry );
values = simpleMeasure( dissolveGeometry );
Expand Down Expand Up @@ -629,7 +639,7 @@ bool QgsGeometryAnalyzer::dissolve( QgsVectorLayer* layer, const QString& shapef
}
}

QgsGeometry* dissolveGeometry; //dissolve geometry
QgsGeometry *dissolveGeometry = 0; //dissolve geometry
QMultiMap<QString, int>::const_iterator jt = map.constBegin();
QgsFeature outputFeature;
while ( jt != map.constEnd() )
Expand Down
1 change: 0 additions & 1 deletion src/core/pal/layer.cpp
Expand Up @@ -237,7 +237,6 @@ namespace pal
{
modMutex->unlock();
throw new PalException::FeatureExists();
return false;
}

// Split MULTI GEOM and Collection in simple geometries
Expand Down
4 changes: 2 additions & 2 deletions src/core/raster/qgsrastertransparency.cpp
Expand Up @@ -105,7 +105,7 @@ int QgsRasterTransparency::alphaValue( double theValue, int theGlobalTransparenc

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

//Search through he transparency list looking for a match
bool myTransparentPixelFound = false;
TransparentThreeValuePixel myTransparentPixel;
TransparentThreeValuePixel myTransparentPixel = {0,0,0,100};
for ( int myListRunner = 0; myListRunner < mTransparentThreeValuePixelList.count(); myListRunner++ )
{
myTransparentPixel = mTransparentThreeValuePixelList[myListRunner];
Expand Down

0 comments on commit b2b6104

Please sign in to comment.