[geos-commits] r4356 - trunk/src/algorithm

Mateusz Loskot mateusz at loskot.net
Tue Mar 21 03:27:52 PDT 2017


Author: mloskot
Date: 2017-03-21 03:27:52 -0700 (Tue, 21 Mar 2017)
New Revision: 4356

Modified:
   trunk/src/algorithm/LineIntersector.cpp
Log:
Fix warnings about variables aliasing within scope

Modified: trunk/src/algorithm/LineIntersector.cpp
===================================================================
--- trunk/src/algorithm/LineIntersector.cpp	2017-03-21 10:06:20 UTC (rev 4355)
+++ trunk/src/algorithm/LineIntersector.cpp	2017-03-21 10:27:52 UTC (rev 4356)
@@ -743,10 +743,10 @@
 void
 LineIntersector::intersection(const Coordinate& p1,
 	const Coordinate& p2, const Coordinate& q1, const Coordinate& q2,
-	Coordinate &intPt) const
+	Coordinate &intPtOut) const
 {
 
-	intersectionWithNormalization(p1, p2, q1, q2, intPt);
+	intersectionWithNormalization(p1, p2, q1, q2, intPtOut);
 
 	/*
 	 * Due to rounding it can happen that the computed intersection is
@@ -763,10 +763,10 @@
 	 * int point = (2097408.2633752143,1144595.8008114607)
 	 */
 
-	if (! isInSegmentEnvelopes(intPt))
+	if (! isInSegmentEnvelopes(intPtOut))
 	{
 		//intPt = CentralEndpointIntersector::getIntersection(p1, p2, q1, q2);
-		intPt = nearestEndpoint(p1, p2, q1, q2);
+	  intPtOut = nearestEndpoint(p1, p2, q1, q2);
 #if GEOS_DEBUG
 		cerr << "Intersection outside segment envelopes, snapped to "
 		     << intPt.toString() << endl;
@@ -774,18 +774,18 @@
 	}
 
 	if (precisionModel!=NULL) {
-		precisionModel->makePrecise(intPt);
+		precisionModel->makePrecise(intPtOut);
 	}
 
 
 #if COMPUTE_Z
 	double ztot = 0;
 	double zvals = 0;
-	double zp = interpolateZ(intPt, p1, p2);
-	double zq = interpolateZ(intPt, q1, q2);
+	double zp = interpolateZ(intPtOut, p1, p2);
+	double zq = interpolateZ(intPtOut, q1, q2);
 	if ( !ISNAN(zp)) { ztot += zp; zvals++; }
 	if ( !ISNAN(zq)) { ztot += zq; zvals++; }
-	if ( zvals ) intPt.z = ztot/zvals;
+	if ( zvals ) intPtOut.z = ztot/zvals;
 #endif // COMPUTE_Z
 
 }



More information about the geos-commits mailing list