[geos-commits] r2131 - in trunk: . capi source/algorithm source/algorithm/locate source/geomgraph source/headers/geos/geom source/headers/geos/io source/headers/geos/noding source/index/bintree source/index/quadtree source/io source/noding source/operation/buffer source/operation/distance source/planargraph source/precision source/util tests/xmltester tests/xmltester/markup

svn_geos at osgeo.org svn_geos at osgeo.org
Tue Jul 15 18:04:51 EDT 2008


Author: mloskot
Date: 2008-07-15 18:04:51 -0400 (Tue, 15 Jul 2008)
New Revision: 2131

Modified:
   trunk/ChangeLog
   trunk/capi/geos_c.cpp
   trunk/source/algorithm/ConvexHull.cpp
   trunk/source/algorithm/RobustDeterminant.cpp
   trunk/source/algorithm/locate/IndexedPointInAreaLocator.cpp
   trunk/source/geomgraph/EdgeEnd.cpp
   trunk/source/geomgraph/GeometryGraph.cpp
   trunk/source/headers/geos/geom/Coordinate.inl
   trunk/source/headers/geos/geom/LineSegment.inl
   trunk/source/headers/geos/io/WKBReader.h
   trunk/source/headers/geos/noding/IntersectionAdder.h
   trunk/source/index/bintree/Key.cpp
   trunk/source/index/quadtree/Key.cpp
   trunk/source/io/ByteOrderValues.cpp
   trunk/source/noding/Octant.cpp
   trunk/source/operation/buffer/BufferBuilder.cpp
   trunk/source/operation/buffer/BufferOp.cpp
   trunk/source/operation/buffer/OffsetCurveSetBuilder.cpp
   trunk/source/operation/distance/ConnectedElementPointFilter.cpp
   trunk/source/planargraph/DirectedEdge.cpp
   trunk/source/precision/SimpleGeometryPrecisionReducer.cpp
   trunk/source/util/math.cpp
   trunk/tests/xmltester/XMLTester.cpp
   trunk/tests/xmltester/markup/MarkupSTL.h
Log:
Fixed compilation on with Sun Studio compiler on Solaris x86 and Sparc (Ticket #189). Thanks to Magne Mahre for the patch.

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2008-07-15 13:35:05 UTC (rev 2130)
+++ trunk/ChangeLog	2008-07-15 22:04:51 UTC (rev 2131)
@@ -1,5 +1,26 @@
 $Id$
 
+2008-07-15 Mateusz Loskot <mateusz at loskot.net>
+
+	* source\algorithm\RobustDeterminant.cpp,
+	  source\algorithm\locate\IndexedPointInAreaLocator.cpp,
+	  source\algorithm\ConvexHull.cpp,
+	  source\precision\SimpleGeometryPrecisionReducer.cpp,
+	  source\planargraph\DirectedEdge.cpp,
+	  source\operation\buffer\OffsetCurveSetBuilder.cpp,
+	  source\operation\buffer\BufferBuilder.cpp,
+	  source\operation\buffer\BufferOp.cpp,
+	  source\operation\distance\ConnectedElementPointFilter.cpp,
+	  source\io\ByteOrderValues.cpp, source\index\bintree\Key.cpp,
+	  source\index\quadtree\Key.cpp, source\geomgraph\GeometryGraph.cpp,
+	  source\geomgraph\EdgeEnd.cpp, source\headers\geos\geom\LineSegment.inl,
+	  source\headers\geos\geom\Coordinate.inl, source\headers\geos\io\WKBReader.h,
+	  source\headers\geos\noding\IntersectionAdder.h, source\util\math.cpp,
+	  source\noding\Octant.cpp, tests\xmltester\markup\MarkupSTL.h,
+	  tests\xmltester\XMLTester.cpp, capi\geos_c.cpp: Fixed compilation on
+	  with Sun Studio compiler on Solaris x86 and Sparc (Ticket #189). Thanks
+	  to Magne Mahre for the patch.
+
 2008-05-20 Mateusz Loskot <mateusz at loskot.net>
 
 	* bootstrap.bat: Added script generating headers for use with Visual C++

Modified: trunk/capi/geos_c.cpp
===================================================================
--- trunk/capi/geos_c.cpp	2008-07-15 13:35:05 UTC (rev 2130)
+++ trunk/capi/geos_c.cpp	2008-07-15 22:04:51 UTC (rev 2131)
@@ -566,7 +566,7 @@
 
 		unsigned char *result;
 		result = (unsigned char*) std::malloc(len);
-		memcpy(result, wkbstring.c_str(), len);
+        std::memcpy(result, wkbstring.c_str(), len);
 		*size = len;
 		return result;
 	}
@@ -628,7 +628,7 @@
 
 		char *result;
 		result = (char*) std::malloc(len);
-		memcpy(result, hexstring.c_str(), len);
+        std::memcpy(result, hexstring.c_str(), len);
 		*size = len;
 		return (unsigned char*) result;
 	}
@@ -2149,7 +2149,7 @@
 
 		unsigned char *result;
 		result = (unsigned char*) std::malloc(len);
-		memcpy(result, wkbstring.c_str(), len);
+        std::memcpy(result, wkbstring.c_str(), len);
 		*size = len;
 		return result;
 	}
@@ -2179,7 +2179,7 @@
 
 		unsigned char *result;
 		result = (unsigned char*) std::malloc(len);
-		memcpy(result, wkbstring.c_str(), len);
+        std::memcpy(result, wkbstring.c_str(), len);
 		*size = len;
 		return result;
 	}

Modified: trunk/source/algorithm/ConvexHull.cpp
===================================================================
--- trunk/source/algorithm/ConvexHull.cpp	2008-07-15 13:35:05 UTC (rev 2130)
+++ trunk/source/algorithm/ConvexHull.cpp	2008-07-15 22:04:51 UTC (rev 2131)
@@ -164,7 +164,7 @@
 	// Remove consecutive equal Coordinates
 	// unique() returns an iterator to the end of the resulting
 	// sequence, we erase from there to the end.
-	dest.erase( unique(dest.begin(),dest.end()), dest.end() );
+	dest.erase( std::unique(dest.begin(),dest.end()), dest.end() );
 
 	// points must all lie in a line	
 	if ( dest.size() < 3 ) return false;
@@ -269,7 +269,7 @@
 	}
 
 	// sort the points radially around the focal point.
-	sort(pts.begin(), pts.end(), RadiallyLessThen(pts[0]));
+    std::sort(pts.begin(), pts.end(), RadiallyLessThen(pts[0]));
 }
 
 /*private*/

Modified: trunk/source/algorithm/RobustDeterminant.cpp
===================================================================
--- trunk/source/algorithm/RobustDeterminant.cpp	2008-07-15 13:35:05 UTC (rev 2130)
+++ trunk/source/algorithm/RobustDeterminant.cpp	2008-07-15 22:04:51 UTC (rev 2131)
@@ -184,7 +184,7 @@
 	*/
 	while (true) {
 		count=count+1;
-		k=floor(x2/x1);
+		k=std::floor(x2/x1);
 		x2=x2-k*x1;
 		y2=y2-k*y1;
 
@@ -228,7 +228,7 @@
 		/*
 		*  exchange 1 and 2 role.
 		*/
-		k=floor(x1/x2);
+		k=std::floor(x1/x2);
 		x1=x1-k*x2;
 		y1=y1-k*y2;
 		

Modified: trunk/source/algorithm/locate/IndexedPointInAreaLocator.cpp
===================================================================
--- trunk/source/algorithm/locate/IndexedPointInAreaLocator.cpp	2008-07-15 13:35:05 UTC (rev 2130)
+++ trunk/source/algorithm/locate/IndexedPointInAreaLocator.cpp	2008-07-15 22:04:51 UTC (rev 2131)
@@ -28,6 +28,7 @@
 #include <geos/index/ItemVisitor.h> 
 
 #include <algorithm>
+#include <typeinfo>
 
 namespace geos {
 namespace algorithm { 

Modified: trunk/source/geomgraph/EdgeEnd.cpp
===================================================================
--- trunk/source/geomgraph/EdgeEnd.cpp	2008-07-15 13:35:05 UTC (rev 2130)
+++ trunk/source/geomgraph/EdgeEnd.cpp	2008-07-15 22:04:51 UTC (rev 2131)
@@ -206,7 +206,7 @@
 	os << " - ";
 	os << ee.p1;
 	os << " ";
-	os << ee.quadrant << ":" << atan2(ee.dy, ee.dx);
+	os << ee.quadrant << ":" << std::atan2(ee.dy, ee.dx);
 	os << "  ";
 	os << *(ee.label);
 

Modified: trunk/source/geomgraph/GeometryGraph.cpp
===================================================================
--- trunk/source/geomgraph/GeometryGraph.cpp	2008-07-15 13:35:05 UTC (rev 2130)
+++ trunk/source/geomgraph/GeometryGraph.cpp	2008-07-15 22:04:51 UTC (rev 2131)
@@ -45,6 +45,7 @@
 #include <vector>
 #include <memory> // auto_ptr
 #include <cassert>
+#include <typeinfo>
 
 #ifndef GEOS_DEBUG
 #define GEOS_DEBUG 0

Modified: trunk/source/headers/geos/geom/Coordinate.inl
===================================================================
--- trunk/source/headers/geos/geom/Coordinate.inl	2008-07-15 13:35:05 UTC (rev 2130)
+++ trunk/source/headers/geos/geom/Coordinate.inl	2008-07-15 22:04:51 UTC (rev 2131)
@@ -119,7 +119,7 @@
 {
 	double dx = x - p.x;
 	double dy = y - p.y;
-	return sqrt(dx * dx + dy * dy);
+	return std::sqrt(dx * dx + dy * dy);
 }
 
 INLINE int

Modified: trunk/source/headers/geos/geom/LineSegment.inl
===================================================================
--- trunk/source/headers/geos/geom/LineSegment.inl	2008-07-15 13:35:05 UTC (rev 2130)
+++ trunk/source/headers/geos/geom/LineSegment.inl	2008-07-15 22:04:51 UTC (rev 2131)
@@ -140,7 +140,7 @@
 INLINE double
 LineSegment::angle() const
 {
-	return atan2(p1.y-p0.y,p1.x-p0.x);
+	return std::atan2(p1.y-p0.y,p1.x-p0.x);
 }
 
 INLINE std::ostream&

Modified: trunk/source/headers/geos/io/WKBReader.h
===================================================================
--- trunk/source/headers/geos/io/WKBReader.h	2008-07-15 13:35:05 UTC (rev 2130)
+++ trunk/source/headers/geos/io/WKBReader.h	2008-07-15 22:04:51 UTC (rev 2131)
@@ -22,6 +22,7 @@
 
 #include <iosfwd> // ostream, istream
 #include <vector>
+#include <string>
 
 // Forward declarations
 namespace geos {

Modified: trunk/source/headers/geos/noding/IntersectionAdder.h
===================================================================
--- trunk/source/headers/geos/noding/IntersectionAdder.h	2008-07-15 13:35:05 UTC (rev 2130)
+++ trunk/source/headers/geos/noding/IntersectionAdder.h	2008-07-15 22:04:51 UTC (rev 2131)
@@ -157,7 +157,7 @@
 
  
 	static bool isAdjacentSegments(int i1, int i2) {
-		return abs(i1 - i2) == 1;
+		return std::abs(i1 - i2) == 1;
 	}
 
 };

Modified: trunk/source/index/bintree/Key.cpp
===================================================================
--- trunk/source/index/bintree/Key.cpp	2008-07-15 13:35:05 UTC (rev 2130)
+++ trunk/source/index/bintree/Key.cpp	2008-07-15 22:04:51 UTC (rev 2131)
@@ -90,7 +90,7 @@
 
 	double size=DoubleBits::powerOf2(level);
 	//double size = pow2.power(level);
-	pt=floor(itemInterval->getMin()/size)*size;
+	pt=std::floor(itemInterval->getMin()/size)*size;
 	interval->init(pt,pt+size);
 }
 

Modified: trunk/source/index/quadtree/Key.cpp
===================================================================
--- trunk/source/index/quadtree/Key.cpp	2008-07-15 13:35:05 UTC (rev 2130)
+++ trunk/source/index/quadtree/Key.cpp	2008-07-15 22:04:51 UTC (rev 2131)
@@ -105,8 +105,8 @@
 {
 	double quadSize=DoubleBits::powerOf2(level);
 	//double quadSize=pow2.power(level);
-	pt->x=floor(itemEnv->getMinX()/quadSize)*quadSize;
-	pt->y=floor(itemEnv->getMinY()/quadSize)*quadSize;
+	pt->x=std::floor(itemEnv->getMinX()/quadSize)*quadSize;
+	pt->y=std::floor(itemEnv->getMinY()/quadSize)*quadSize;
 	env->init(pt->x,pt->x+quadSize,pt->y,pt->y+quadSize);
 }
 

Modified: trunk/source/io/ByteOrderValues.cpp
===================================================================
--- trunk/source/io/ByteOrderValues.cpp	2008-07-15 13:35:05 UTC (rev 2130)
+++ trunk/source/io/ByteOrderValues.cpp	2008-07-15 22:04:51 UTC (rev 2131)
@@ -21,6 +21,7 @@
 #include <geos/platform.h>
 #include <geos/util.h>
 
+#include <cstring>
 #include <cassert>
 
 namespace geos {
@@ -136,7 +137,7 @@
 {
 	int64 longValue = getLong(buf, byteOrder);
 	double ret;
-	memcpy(&ret, &longValue, sizeof(double));
+    std::memcpy(&ret, &longValue, sizeof(double));
 	return ret;
 }
 
@@ -144,7 +145,7 @@
 ByteOrderValues::putDouble(double doubleValue, unsigned char *buf, int byteOrder)
 {
 	int64 longValue;
-	memcpy(&longValue, &doubleValue, sizeof(double));
+    std::memcpy(&longValue, &doubleValue, sizeof(double));
 #if DEBUG_BYTEORDER_VALUES
 	cout<<"ByteOrderValues::putDouble("<<doubleValue<<
 		", order:"<<byteOrder

Modified: trunk/source/noding/Octant.cpp
===================================================================
--- trunk/source/noding/Octant.cpp	2008-07-15 13:35:05 UTC (rev 2130)
+++ trunk/source/noding/Octant.cpp	2008-07-15 22:04:51 UTC (rev 2131)
@@ -41,8 +41,8 @@
       		throw util::IllegalArgumentException(s.str());
 	}
 
-    double adx = fabs(dx);
-    double ady = fabs(dy);
+    double adx = std::fabs(dx);
+    double ady = std::fabs(dy);
 
     if (dx >= 0) {
       if (dy >= 0) {

Modified: trunk/source/operation/buffer/BufferBuilder.cpp
===================================================================
--- trunk/source/operation/buffer/BufferBuilder.cpp	2008-07-15 13:35:05 UTC (rev 2130)
+++ trunk/source/operation/buffer/BufferBuilder.cpp	2008-07-15 22:04:51 UTC (rev 2131)
@@ -360,7 +360,7 @@
 	 * subgraphs for shells will have been built before the subgraphs for
 	 * any holes they contain
 	 */
-	sort(subgraphList.begin(), subgraphList.end(), BufferSubgraphGT);
+    std::sort(subgraphList.begin(), subgraphList.end(), BufferSubgraphGT);
 }
 
 /*private*/

Modified: trunk/source/operation/buffer/BufferOp.cpp
===================================================================
--- trunk/source/operation/buffer/BufferOp.cpp	2008-07-15 13:35:05 UTC (rev 2130)
+++ trunk/source/operation/buffer/BufferOp.cpp	2008-07-15 22:04:51 UTC (rev 2131)
@@ -69,10 +69,10 @@
 	double expandByDistance=distance > 0.0 ? distance : 0.0;
 	double bufEnvSize=envSize + 2 * expandByDistance;
 	// the smallest power of 10 greater than the buffer envelope
-	int bufEnvLog10=(int) (log(bufEnvSize) / log(10.0) + 1.0);
+	int bufEnvLog10=(int) (std::log(bufEnvSize) / std::log(10.0) + 1.0);
 	int minUnitLog10=bufEnvLog10 - maxPrecisionDigits;
 	// scale factor is inverse of min Unit size, so flip sign of exponent
-	double scaleFactor=pow(10.0,-minUnitLog10);
+	double scaleFactor=std::pow(10.0,-minUnitLog10);
 	return scaleFactor;
 }
 

Modified: trunk/source/operation/buffer/OffsetCurveSetBuilder.cpp
===================================================================
--- trunk/source/operation/buffer/OffsetCurveSetBuilder.cpp	2008-07-15 13:35:05 UTC (rev 2130)
+++ trunk/source/operation/buffer/OffsetCurveSetBuilder.cpp	2008-07-15 22:04:51 UTC (rev 2131)
@@ -38,9 +38,10 @@
 #include <geos/noding/SegmentString.h>
 
 #include <cmath>
+#include <cassert>
+#include <memory>
 #include <vector>
-#include <memory>
-#include <cassert>
+#include <typeinfo>
 
 #ifndef GEOS_DEBUG
 #define GEOS_DEBUG 0
@@ -315,7 +316,7 @@
 
 	//delete md;
 	//System->out->println(md->getDiameter());
-	return minDiam < (2 * fabs(bufferDistance));
+	return minDiam < (2 * std::fabs(bufferDistance));
 }
 
 /*private*/
@@ -328,7 +329,7 @@
 	Coordinate inCentre;
 	tri.inCentre(inCentre);
 	double distToCentre=CGAlgorithms::distancePointLine(inCentre, tri.p0, tri.p1);
-	bool ret = distToCentre < fabs(bufferDistance);
+	bool ret = distToCentre < std::fabs(bufferDistance);
 	return ret;
 }
 

Modified: trunk/source/operation/distance/ConnectedElementPointFilter.cpp
===================================================================
--- trunk/source/operation/distance/ConnectedElementPointFilter.cpp	2008-07-15 13:35:05 UTC (rev 2130)
+++ trunk/source/operation/distance/ConnectedElementPointFilter.cpp	2008-07-15 22:04:51 UTC (rev 2131)
@@ -20,6 +20,7 @@
 #include <geos/geom/Polygon.h>
 
 #include <vector>
+#include <typeinfo>
 
 using namespace std;
 using namespace geos::geom;

Modified: trunk/source/planargraph/DirectedEdge.cpp
===================================================================
--- trunk/source/planargraph/DirectedEdge.cpp	2008-07-15 13:35:05 UTC (rev 2130)
+++ trunk/source/planargraph/DirectedEdge.cpp	2008-07-15 22:04:51 UTC (rev 2131)
@@ -21,6 +21,7 @@
 #include <cmath>
 #include <sstream>
 #include <vector>
+#include <typeinfo>
 
 using namespace std;
 using namespace geos::geom;

Modified: trunk/source/precision/SimpleGeometryPrecisionReducer.cpp
===================================================================
--- trunk/source/precision/SimpleGeometryPrecisionReducer.cpp	2008-07-15 13:35:05 UTC (rev 2130)
+++ trunk/source/precision/SimpleGeometryPrecisionReducer.cpp	2008-07-15 22:04:51 UTC (rev 2131)
@@ -30,6 +30,7 @@
 #include <geos/geom/LinearRing.h>
 
 #include <vector>
+#include <typeinfo>
 
 using namespace std;
 using namespace geos::geom;

Modified: trunk/source/util/math.cpp
===================================================================
--- trunk/source/util/math.cpp	2008-07-15 13:35:05 UTC (rev 2130)
+++ trunk/source/util/math.cpp	2008-07-15 22:04:51 UTC (rev 2131)
@@ -26,20 +26,20 @@
 sym_round(double val)
 {
         double n;
-        double f = fabs(modf(val, &n));
+        double f = std::fabs(modf(val, &n));
         if (val >= 0) {
                 if (f < 0.5) {
-                        return floor(val);
+                        return std::floor(val);
                 } else if (f > 0.5) {
-                        return ceil(val);
+                        return std::ceil(val);
                 } else {
                         return (n + 1.0);
                 }
         } else {
                 if (f < 0.5) {
-                        return ceil(val);
+                        return std::ceil(val);
                 } else if (f > 0.5) {
-                        return floor(val);
+                        return std::floor(val);
                 } else {
                         return (n - 1.0);
                 }
@@ -52,22 +52,22 @@
 double java_math_round(double val)
 {
 	double n;
-	double f = fabs(modf(val, &n));
+	double f = std::fabs(std::modf(val, &n));
 	
 	if (val >= 0)
 	{
 		if (f < 0.5) {
-			return floor(val);
+			return std::floor(val);
 		} else if (f > 0.5) {
-			return ceil(val);
+			return std::ceil(val);
 		} else {
 			return (n + 1.0);
 		}
 	} else {
 		if (f < 0.5) {
-			return ceil(val);
+			return std::ceil(val);
 		} else if (f > 0.5) {
-			return floor(val);
+			return std::floor(val);
 		} else {
 			return n;
 		}
@@ -81,27 +81,26 @@
 rint_vc(double val)
 {
 	double n;
-	double f=fabs(modf(val,&n));
+	double f=std::fabs(std::modf(val,&n));
 	if (val>=0) {
 		if (f<0.5) {
-			return floor(val);
+			return std::floor(val);
 		} else if (f>0.5) {
-			return ceil(val);
+			return std::ceil(val);
 		} else {
-			return(floor(n/2)==n/2)?n:n+1.0;
+			return(std::floor(n/2)==n/2)?n:n+1.0;
 		}
 	} else {
 		if (f<0.5) {
-			return ceil(val);
+			return std::ceil(val);
 		} else if (f>0.5) {
-			return floor(val);
+			return std::floor(val);
 		} else {
-			return(floor(n/2)==n/2)?n:n-1.0;
+			return(std::floor(n/2)==n/2)?n:n-1.0;
 		}
 	}
 }
 
-
-
 } // namespace geos.util
 } // namespace geos
+

Modified: trunk/tests/xmltester/XMLTester.cpp
===================================================================
--- trunk/tests/xmltester/XMLTester.cpp	2008-07-15 13:35:05 UTC (rev 2130)
+++ trunk/tests/xmltester/XMLTester.cpp	2008-07-15 22:04:51 UTC (rev 2131)
@@ -277,9 +277,9 @@
 		std::string offsetXStr=xml.GetChildAttrib("offsetx");
 		std::string offsetYStr=xml.GetChildAttrib("offsety");
 
-		double scale=strtod(scaleStr.c_str(),&stopstring);
-		double offsetX=strtod(offsetXStr.c_str(),&stopstring);
-		double offsetY=strtod(offsetYStr.c_str(),&stopstring);
+		double scale=std::strtod(scaleStr.c_str(),&stopstring);
+		double offsetX=std::strtod(offsetXStr.c_str(),&stopstring);
+		double offsetY=std::strtod(offsetYStr.c_str(),&stopstring);
 		pm.reset(new PrecisionModel(scale,offsetX,offsetY));
 	}
 
@@ -703,10 +703,10 @@
 			profile.start();
 
 			GeomAutoPtr gRealRes;
-			double dist = atof(opArg3.c_str());
+			double dist = std::atof(opArg3.c_str());
 
 			if ( opArg2 != "" ) {
-				gRealRes.reset(gT->buffer(dist, atoi(opArg2.c_str())));
+				gRealRes.reset(gT->buffer(dist, std::atoi(opArg2.c_str())));
 			} else {
 				gRealRes.reset(gT->buffer(dist));
 			}
@@ -806,7 +806,7 @@
 
 		else if (opName=="iswithindistance")
 		{
-			float dist=atof(opArg3.c_str());
+			float dist=std::atof(opArg3.c_str());
 			if (gA->isWithinDistance(gB, dist)) {
 				actual_result="true";
 			} else {
@@ -876,7 +876,7 @@
 		else if (opName=="areatest")
 		{
 			char* rest;
-			double toleratedDiff = strtod(opRes.c_str(), &rest);
+			double toleratedDiff = std::strtod(opRes.c_str(), &rest);
 			if ( rest == opRes.c_str() )
 			{
 				throw std::runtime_error("malformed testcase: missing tolerated area difference in 'areatest' op");
@@ -944,28 +944,28 @@
 			// ^ : intersection
 		
 			// A == ( A ^ B ) + ( A - B )
-			double diff = fabs ( areaA - areaI - areaDab );
+			double diff = std::fabs ( areaA - areaI - areaDab );
 			if ( diff > maxdiff ) {
 				maxdiffop = "A == ( A ^ B ) + ( A - B )";
 				maxdiff = diff;
 			}
 
 			// B == ( A ^ B ) + ( B - A )
-			diff = fabs ( areaB - areaI - areaDba );
+			diff = std::fabs ( areaB - areaI - areaDba );
 			if ( diff > maxdiff ) {
 				maxdiffop = "B == ( A ^ B ) + ( B - A )";
 				maxdiff = diff;
 			}
 
 			//  ( A @ B ) == ( A - B ) + ( B - A )
-			diff = fabs ( areaDab + areaDba - areaSD );
+			diff = std::fabs ( areaDab + areaDba - areaSD );
 			if ( diff > maxdiff ) {
 				maxdiffop = "( A @ B ) == ( A - B ) + ( B - A )";
 				maxdiff = diff;
 			}
 
 			//  ( A u B ) == ( A ^ B ) + ( A @ B )
-			diff = fabs ( areaI + areaSD - areaU );
+			diff = std::fabs ( areaI + areaSD - areaU );
 			if ( diff > maxdiff ) {
 				maxdiffop = "( A u B ) == ( A ^ B ) + ( A @ B )";
 				maxdiff = diff;
@@ -1052,7 +1052,7 @@
 	   << "--sql-output         Produce SQL output" << std::endl
 	   << "--wkb-output         Print Geometries as HEXWKB" << std::endl;
 
-	exit(exitcode);
+    std::exit(exitcode);
 }
 
 int
@@ -1074,30 +1074,30 @@
 	for (int i=1; i<argC; ++i)
 	{
 		// increment verbosity level
-		if ( ! strcmp(argV[i], "-v" ) )
+		if ( ! std::strcmp(argV[i], "-v" ) )
 		{
 			++verbose;
 			tester.setVerbosityLevel(verbose);
 			continue;
 		}
-		if ( ! strcmp(argV[i], "--test-valid-output" ) )
+		if ( ! std::strcmp(argV[i], "--test-valid-output" ) )
 		{
 			tester.testOutputValidity(true);
 			continue;
 		}
-		if ( ! strcmp(argV[i], "--sql-output" ) )
+		if ( ! std::strcmp(argV[i], "--sql-output" ) )
 		{
 			sql_output = true;
 			tester.setSQLOutput(sql_output);
 			continue;
 		}
-		if ( ! strcmp(argV[i], "--wkb-output" ) )
+		if ( ! std::strcmp(argV[i], "--wkb-output" ) )
 		{
 			sql_output = true;
 			tester.setHEXWKBOutput(sql_output);
 			continue;
 		}
-		if ( ! strcmp(argV[i], "--test-valid-input" ) )
+		if ( ! std::strcmp(argV[i], "--test-valid-input" ) )
 		{
 			tester.testInputValidity(true);
 			continue;

Modified: trunk/tests/xmltester/markup/MarkupSTL.h
===================================================================
--- trunk/tests/xmltester/markup/MarkupSTL.h	2008-07-15 13:35:05 UTC (rev 2130)
+++ trunk/tests/xmltester/markup/MarkupSTL.h	2008-07-15 22:04:51 UTC (rev 2131)
@@ -62,6 +62,7 @@
 #pragma warning(disable:4786)
 #endif
 
+#include <cstring>
 #include <string>
 #include <map>
 #include <vector>
@@ -193,9 +194,9 @@
 		#ifdef MARKUP_IGNORECASE
 			return ( (strnicmp( &szDoc[nL], szName, nLen ) == 0)
 		#else
-			return ( (strncmp( &szDoc[nL], szName, nLen ) == 0)
+			return ( (std::strncmp( &szDoc[nL], szName, nLen ) == 0)
 		#endif
-				&& ( szName[nLen] == '\0' || strchr(" =/[",szName[nLen]) ) );
+				&& ( szName[nLen] == '\0' || std::strchr(" =/[",szName[nLen]) ) );
 		};
 		int nL;
 		int nR;



More information about the geos-commits mailing list