[geos-commits] r3962 - in trunk: src/triangulate tests/unit/triangulate/quadedge

svn_geos at osgeo.org svn_geos at osgeo.org
Tue Nov 19 04:30:23 PST 2013


Author: strk
Date: 2013-11-19 04:30:22 -0800 (Tue, 19 Nov 2013)
New Revision: 3962

Modified:
   trunk/src/triangulate/VoronoiDiagramBuilder.cpp
   trunk/tests/unit/triangulate/quadedge/QuadEdgeSubdivisionTest.cpp
Log:
Prefer std::max over fmax (#674)

Should fix MSVC11 builds.
Patches by Twiddeldidu.

Modified: trunk/src/triangulate/VoronoiDiagramBuilder.cpp
===================================================================
--- trunk/src/triangulate/VoronoiDiagramBuilder.cpp	2013-11-19 08:58:04 UTC (rev 3961)
+++ trunk/src/triangulate/VoronoiDiagramBuilder.cpp	2013-11-19 12:30:22 UTC (rev 3962)
@@ -78,7 +78,7 @@
 
 	diagramEnv = DelaunayTriangulationBuilder::envelope(*siteCoords);
 	//adding buffer around the final envelope
-	double expandBy = fmax(diagramEnv.getWidth() , diagramEnv.getHeight());
+	double expandBy = std::max(diagramEnv.getWidth() , diagramEnv.getHeight());
 	diagramEnv.expandBy(expandBy);
 	if(clipEnv)
 		diagramEnv.expandToInclude(clipEnv);

Modified: trunk/tests/unit/triangulate/quadedge/QuadEdgeSubdivisionTest.cpp
===================================================================
--- trunk/tests/unit/triangulate/quadedge/QuadEdgeSubdivisionTest.cpp	2013-11-19 08:58:04 UTC (rev 3961)
+++ trunk/tests/unit/triangulate/quadedge/QuadEdgeSubdivisionTest.cpp	2013-11-19 12:30:22 UTC (rev 3962)
@@ -20,6 +20,7 @@
 // std
 #include <stdio.h>
 #include <iostream>
+#include <algorithm>
 using namespace geos::triangulate::quadedge;
 using namespace geos::triangulate;
 using namespace geos::geom;
@@ -88,7 +89,7 @@
 		CoordinateSequence* siteCoords = DelaunayTriangulationBuilder::extractUniqueCoordinates(*sites);
 		Envelope Env = DelaunayTriangulationBuilder::envelope(*siteCoords);
 
-		double expandBy = fmax(Env.getWidth() , Env.getHeight());
+		double expandBy = std::max(Env.getWidth() , Env.getHeight());
 		Env.expandBy(expandBy);
 
 		IncrementalDelaunayTriangulator::VertexList* vertices = DelaunayTriangulationBuilder::toVertices(*siteCoords);



More information about the geos-commits mailing list