[geos-commits] r4346 - in trunk: include/geos/index/strtree src/algorithm
Mateusz Loskot
mateusz at loskot.net
Mon Mar 20 16:24:15 PDT 2017
Author: mloskot
Date: 2017-03-20 16:24:15 -0700 (Mon, 20 Mar 2017)
New Revision: 4346
Modified:
trunk/include/geos/index/strtree/AbstractSTRtree.h
trunk/src/algorithm/CGAlgorithms.cpp
trunk/src/algorithm/LineIntersector.cpp
Log:
Fix warnings about variables aliasing within scope
Modified: trunk/include/geos/index/strtree/AbstractSTRtree.h
===================================================================
--- trunk/include/geos/index/strtree/AbstractSTRtree.h 2017-03-20 23:23:14 UTC (rev 4345)
+++ trunk/include/geos/index/strtree/AbstractSTRtree.h 2017-03-20 23:24:15 UTC (rev 4346)
@@ -1,4 +1,4 @@
-/**********************************************************************
+/**********************************************************************
*
* GEOS - Geometry Engine Open Source
* http://geos.osgeo.org
@@ -193,11 +193,11 @@
virtual std::auto_ptr<BoundableList> createParentBoundables(
BoundableList* childBoundables, int newLevel);
- virtual AbstractNode* lastNode(BoundableList* nodes)
+ virtual AbstractNode* lastNode(BoundableList* nodeList)
{
- assert(!nodes->empty());
+ assert(!nodeList->empty());
// Cast from Boundable to AbstractNode
- return static_cast<AbstractNode*>( nodes->back() );
+ return static_cast<AbstractNode*>(nodeList->back() );
}
virtual AbstractNode* getRoot() {
Modified: trunk/src/algorithm/CGAlgorithms.cpp
===================================================================
--- trunk/src/algorithm/CGAlgorithms.cpp 2017-03-20 23:23:14 UTC (rev 4345)
+++ trunk/src/algorithm/CGAlgorithms.cpp 2017-03-20 23:24:15 UTC (rev 4346)
@@ -1,4 +1,4 @@
-/**********************************************************************
+/**********************************************************************
*
* GEOS - Geometry Engine Open Source
* http://geos.osgeo.org
@@ -329,9 +329,9 @@
double len = 0.0;
- const Coordinate& p = pts->getAt(0);
- double x0 = p.x;
- double y0 = p.y;
+ const Coordinate& p0 = pts->getAt(0);
+ double x0 = p0.x;
+ double y0 = p0.y;
for(size_t i = 1; i < npts; ++i)
{
Modified: trunk/src/algorithm/LineIntersector.cpp
===================================================================
--- trunk/src/algorithm/LineIntersector.cpp 2017-03-20 23:23:14 UTC (rev 4345)
+++ trunk/src/algorithm/LineIntersector.cpp 2017-03-20 23:24:15 UTC (rev 4346)
@@ -1,4 +1,4 @@
-/**********************************************************************
+/**********************************************************************
*
* GEOS - Geometry Engine Open Source
* http://geos.osgeo.org
@@ -794,7 +794,7 @@
void
LineIntersector::intersectionWithNormalization(const Coordinate& p1,
const Coordinate& p2, const Coordinate& q1, const Coordinate& q2,
- Coordinate &intPt) const
+ Coordinate &intPtOut) const
{
Coordinate n1=p1;
Coordinate n2=p2;
@@ -803,10 +803,10 @@
Coordinate normPt;
normalizeToEnvCentre(n1, n2, n3, n4, normPt);
- safeHCoordinateIntersection(n1, n2, n3, n4, intPt);
+ safeHCoordinateIntersection(n1, n2, n3, n4, intPtOut);
- intPt.x += normPt.x;
- intPt.y += normPt.y;
+ intPtOut.x += normPt.x;
+ intPtOut.y += normPt.y;
}
@@ -832,11 +832,11 @@
/*private*/
bool
-LineIntersector::isInSegmentEnvelopes(const Coordinate& intPt) const
+LineIntersector::isInSegmentEnvelopes(const Coordinate& pt) const
{
Envelope env0(*inputLines[0][0], *inputLines[0][1]);
Envelope env1(*inputLines[1][0], *inputLines[1][1]);
- return env0.contains(intPt) && env1.contains(intPt);
+ return env0.contains(pt) && env1.contains(pt);
}
/*private*/
@@ -895,10 +895,10 @@
void
LineIntersector::safeHCoordinateIntersection(const Coordinate& p1,
const Coordinate& p2, const Coordinate& q1,
- const Coordinate& q2, Coordinate& intPt) const
+ const Coordinate& q2, Coordinate& intPtOut) const
{
try {
- HCoordinate::intersection(p1, p2, q1, q2, intPt);
+ HCoordinate::intersection(p1, p2, q1, q2, intPtOut);
#if GEOS_DEBUG
cerr<<" HCoordinate found intersection h:"<<intPt.toString()<<endl;
#endif
@@ -906,7 +906,7 @@
} catch (const NotRepresentableException& /* e */) {
// compute an approximate result
//intPt = CentralEndpointIntersector::getIntersection(p1, p2, q1, q2);
- intPt = nearestEndpoint(p1, p2, q1, q2);
+ intPtOut = nearestEndpoint(p1, p2, q1, q2);
}
}
More information about the geos-commits
mailing list