Skip to content
Permalink
Browse files
Fix compile warnings caused by using int instead of unsigned int for …
…loops. Now compiles in pedantic mode.

git-svn-id: http://svn.osgeo.org/qgis/trunk@6954 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux committed May 22, 2007
1 parent 2c24223 commit 63d9a2909c11beb5019c91becb665f2a45224b29
Showing with 6 additions and 6 deletions.
  1. +6 −6 src/core/qgsgeometry.cpp
@@ -65,7 +65,7 @@ mDirtyGeos( rhs.mDirtyGeos )
if(multiPoly)
{
std::vector<GEOS_GEOM::Geometry*> polygonVector;
for(int i = 0; i < multiPoly->getNumGeometries(); ++i)
for(unsigned int i = 0; i < multiPoly->getNumGeometries(); ++i)
{
polygonVector.push_back((GEOS_GEOM::Geometry*)(multiPoly->getGeometryN(i)));
}
@@ -187,7 +187,7 @@ QgsGeometry & QgsGeometry::operator=( QgsGeometry const & rhs )
if(multiPoly)
{
std::vector<GEOS_GEOM::Geometry*> polygonVector;
for(int i = 0; i < multiPoly->getNumGeometries(); ++i)
for(unsigned int i = 0; i < multiPoly->getNumGeometries(); ++i)
{
polygonVector.push_back((GEOS_GEOM::Geometry*)(multiPoly->getGeometryN(i)));
}
@@ -3553,7 +3553,7 @@ bool QgsGeometry::exportGeosToWkb()

//first determine size of geometry
int geometrySize = 1 + (2 * sizeof(int)); //endian, type, number of polygons
for(int i = 0; i < theMultiPolygon->getNumGeometries(); ++i)
for(unsigned int i = 0; i < theMultiPolygon->getNumGeometries(); ++i)
{
GEOS_GEOM::Polygon* thePoly = (GEOS_GEOM::Polygon*)(theMultiPolygon->getGeometryN(i));
geometrySize += (1 + (2 * sizeof(int))); //endian, type, number of rings
@@ -3563,7 +3563,7 @@ bool QgsGeometry::exportGeosToWkb()
geometrySize += (2*sizeof(double)*exRing->getNumPoints());

const GEOS_GEOM::LineString* intRing = 0;
for(int j = 0; j < thePoly->getNumInteriorRing(); ++j)
for(unsigned int j = 0; j < thePoly->getNumInteriorRing(); ++j)
{
geometrySize += sizeof(int); //number of points in ring
intRing = thePoly->getInteriorRingN(j);
@@ -3585,7 +3585,7 @@ bool QgsGeometry::exportGeosToWkb()
wkbPosition += sizeof(int);

//loop over polygons
for(int i = 0; i < theMultiPolygon->getNumGeometries(); ++i)
for(unsigned int i = 0; i < theMultiPolygon->getNumGeometries(); ++i)
{
GEOS_GEOM::Polygon* thePoly = (GEOS_GEOM::Polygon*)(theMultiPolygon->getGeometryN(i));
memcpy(&mGeometry[wkbPosition], &byteOrder, 1);
@@ -3618,7 +3618,7 @@ bool QgsGeometry::exportGeosToWkb()
}

//interior rings
for(int j = 0; j < thePoly->getNumInteriorRing(); ++j)
for(unsigned int j = 0; j < thePoly->getNumInteriorRing(); ++j)
{
theRing = thePoly->getInteriorRingN(j);
nPointsInRing = theRing->getNumPoints();

0 comments on commit 63d9a29

Please sign in to comment.