Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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 63d9a29
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/core/qgsgeometry.cpp
Expand Up @@ -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)));
}
Expand Down Expand Up @@ -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)));
}
Expand Down Expand Up @@ -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
Expand All @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 63d9a29

Please sign in to comment.