Skip to content
Permalink
Browse files

Fix cppcheck warnings

  • Loading branch information
nyalldawson committed Dec 29, 2020
1 parent 87fc2dc commit 2505f54dfd90e3468a4937b968687cfaba63b6dc
Showing with 13 additions and 10 deletions.
  1. +11 −10 src/core/qgsogcutils.cpp
  2. +2 −0 src/providers/oracle/CMakeLists.txt
@@ -1281,7 +1281,8 @@ QDomElement QgsOgcUtils::geometryToGML( const QgsGeometry &geometry,

wkbPtr.readHeader();

double x, y;
double x = 0;
double y = 0;
if ( invertAxisOrientation )
wkbPtr >> y >> x;
else
@@ -1325,7 +1326,8 @@ QDomElement QgsOgcUtils::geometryToGML( const QgsGeometry &geometry,
coordString += ts;
}

double x, y;
double x = 0;
double y = 0;
if ( invertAxisOrientation )
wkbPtr >> y >> x;
else
@@ -1378,7 +1380,8 @@ QDomElement QgsOgcUtils::geometryToGML( const QgsGeometry &geometry,
coordString += ts;
}

double x, y;
double x = 0;
double y = 0;
if ( invertAxisOrientation )
wkbPtr >> y >> x;
else
@@ -1418,8 +1421,6 @@ QDomElement QgsOgcUtils::geometryToGML( const QgsGeometry &geometry,
if ( numRings == 0 ) // sanity check for zero rings in polygon
return QDomElement();

int *ringNumPoints = new int[numRings]; // number of points in each ring

for ( int idx = 0; idx < numRings; idx++ )
{
QString boundaryName = ( gmlVersion == GML_2_1_2 ) ? "gml:outerBoundaryIs" : "gml:exterior";
@@ -1430,9 +1431,8 @@ QDomElement QgsOgcUtils::geometryToGML( const QgsGeometry &geometry,
QDomElement boundaryElem = doc.createElement( boundaryName );
QDomElement ringElem = doc.createElement( QStringLiteral( "gml:LinearRing" ) );
// get number of points in the ring
int nPoints;
int nPoints = 0;
wkbPtr >> nPoints;
ringNumPoints[idx] = nPoints;

QDomElement coordElem = baseCoordElem.cloneNode().toElement();
QString coordString;
@@ -1443,7 +1443,8 @@ QDomElement QgsOgcUtils::geometryToGML( const QgsGeometry &geometry,
coordString += ts;
}

double x, y;
double x = 0;
double y = 0;
if ( invertAxisOrientation )
wkbPtr >> y >> x;
else
@@ -1461,7 +1462,6 @@ QDomElement QgsOgcUtils::geometryToGML( const QgsGeometry &geometry,
boundaryElem.appendChild( ringElem );
polygonElem.appendChild( boundaryElem );
}
delete [] ringNumPoints;
return polygonElem;
}
case QgsWkbTypes::MultiPolygon25D:
@@ -1513,7 +1513,8 @@ QDomElement QgsOgcUtils::geometryToGML( const QgsGeometry &geometry,
coordString += ts;
}

double x, y;
double x = 0;
double y = 0;
if ( invertAxisOrientation )
wkbPtr >> y >> x;
else
@@ -37,7 +37,9 @@ include_directories(
${CMAKE_SOURCE_DIR}/src/core/expression
${CMAKE_SOURCE_DIR}/src/core/geometry
${CMAKE_SOURCE_DIR}/src/core/metadata
${CMAKE_SOURCE_DIR}/src/core/project
${CMAKE_SOURCE_DIR}/src/core/symbology
${CMAKE_SOURCE_DIR}/src/core/vector
${CMAKE_SOURCE_DIR}/src/gui
${CMAKE_SOURCE_DIR}/src/gui/auth
${CMAKE_SOURCE_DIR}/src/gui/codeeditors

0 comments on commit 2505f54

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