[geos-commits] [SCM] GEOS branch master updated. d0c602b817e6ae8b97965956bc5ecf9763a3c563

git at osgeo.org git at osgeo.org
Fri Jan 29 09:35:13 PST 2021


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GEOS".

The branch, master has been updated
       via  d0c602b817e6ae8b97965956bc5ecf9763a3c563 (commit)
      from  b2e7efc30a979954bf7dfa8fb252473afcd509b8 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit d0c602b817e6ae8b97965956bc5ecf9763a3c563
Author: Daniel Baston <dbaston at gmail.com>
Date:   Fri Jan 29 12:34:30 2021 -0500

    Clear more clang warnings

diff --git a/include/geos/geomgraph/index/SegmentIntersector.h b/include/geos/geomgraph/index/SegmentIntersector.h
index f2f55b6..bde18f5 100644
--- a/include/geos/geomgraph/index/SegmentIntersector.h
+++ b/include/geos/geomgraph/index/SegmentIntersector.h
@@ -112,7 +112,7 @@ public:
         includeProper(newIncludeProper),
         recordIsolated(newRecordIsolated),
         numIntersections(0),
-        bdyNodes{nullptr, nullptr},
+        bdyNodes{{nullptr, nullptr}},
         numTests(0)
     {}
 
diff --git a/include/geos/operation/buffer/RightmostEdgeFinder.h b/include/geos/operation/buffer/RightmostEdgeFinder.h
index 2500b61..d32af1e 100644
--- a/include/geos/operation/buffer/RightmostEdgeFinder.h
+++ b/include/geos/operation/buffer/RightmostEdgeFinder.h
@@ -64,7 +64,7 @@ private:
 
     int getRightmostSide(geomgraph::DirectedEdge* de, int index);
 
-    int getRightmostSideOfSegment(geomgraph::DirectedEdge* de, int i);
+    static int getRightmostSideOfSegment(geomgraph::DirectedEdge* de, int i);
 
 public:
 
diff --git a/src/geom/LineSegment.cpp b/src/geom/LineSegment.cpp
index c798f66..04773fe 100644
--- a/src/geom/LineSegment.cpp
+++ b/src/geom/LineSegment.cpp
@@ -190,7 +190,7 @@ LineSegment::closestPoints(const LineSegment& line)
     // test for intersection
     Coordinate intPt = intersection(line);
     if(!intPt.isNull()) {
-        return { intPt, intPt };
+        return {{ intPt, intPt }};
     }
 
     /*
diff --git a/src/noding/snap/SnappingIntersectionAdder.cpp b/src/noding/snap/SnappingIntersectionAdder.cpp
index 2a7b504..cd0c1aa 100644
--- a/src/noding/snap/SnappingIntersectionAdder.cpp
+++ b/src/noding/snap/SnappingIntersectionAdder.cpp
@@ -112,8 +112,8 @@ bool
 SnappingIntersectionAdder::isAdjacent(SegmentString* ss0, std::size_t segIndex0, SegmentString* ss1, std::size_t segIndex1)
 {
     if (ss0 != ss1) return false;
-    long l0 = segIndex0;
-    long l1 = segIndex1;
+    long l0 = static_cast<long>(segIndex0);
+    long l1 = static_cast<long>(segIndex1);
 
     bool isAdjacent = (std::abs(l0 - l1) == 1);
     if (isAdjacent) {
diff --git a/src/operation/buffer/RightmostEdgeFinder.cpp b/src/operation/buffer/RightmostEdgeFinder.cpp
index a45208b..9004eed 100644
--- a/src/operation/buffer/RightmostEdgeFinder.cpp
+++ b/src/operation/buffer/RightmostEdgeFinder.cpp
@@ -165,8 +165,8 @@ RightmostEdgeFinder::findRightmostEdgeAtVertex()
     assert(minIndex > 0);
     assert((std::size_t)minIndex < pts->getSize());
 
-    const Coordinate& pPrev = pts->getAt(minIndex - 1);
-    const Coordinate& pNext = pts->getAt(minIndex + 1);
+    const Coordinate& pPrev = pts->getAt(static_cast<std::size_t>(minIndex) - 1);
+    const Coordinate& pNext = pts->getAt(static_cast<std::size_t>(minIndex) + 1);
     int orientation = Orientation::index(
                           minCoord,
                           pNext,
@@ -256,12 +256,14 @@ RightmostEdgeFinder::getRightmostSideOfSegment(DirectedEdge* de, int i)
     }
 
     // indicates edge is parallel to x-axis
-    if(coord->getAt(i).y == coord->getAt(i + 1).y) {
+    const Coordinate& p0 = coord->getAt(static_cast<std::size_t>(i));
+    const Coordinate& p1 = coord->getAt(static_cast<std::size_t>(i) + 1);
+    if(p0.y == p1.y) {
         return -1;
     }
 
     int pos = Position::LEFT;
-    if(coord->getAt(i).y < coord->getAt(i + 1).y) {
+    if(p0.y < p1.y) {
         pos = Position::RIGHT;
     }
     return pos;
diff --git a/src/operation/distance/DistanceOp.cpp b/src/operation/distance/DistanceOp.cpp
index c79af7a..33f6e8c 100644
--- a/src/operation/distance/DistanceOp.cpp
+++ b/src/operation/distance/DistanceOp.cpp
@@ -80,20 +80,20 @@ DistanceOp::nearestPoints(const Geometry* g0, const Geometry* g1)
 }
 
 DistanceOp::DistanceOp(const Geometry* g0, const Geometry* g1):
-    geom{g0, g1},
+    geom{{g0, g1}},
     terminateDistance(0.0),
     minDistance(DoubleMax)
 {}
 
 DistanceOp::DistanceOp(const Geometry& g0, const Geometry& g1):
-    geom{&g0, &g1},
+    geom{{&g0, &g1}},
     terminateDistance(0.0),
     minDistance(DoubleMax)
 {}
 
 DistanceOp::DistanceOp(const Geometry& g0, const Geometry& g1, double tdist)
     :
-    geom{&g0, &g1},
+    geom{{&g0, &g1}},
     terminateDistance(tdist),
     minDistance(DoubleMax)
 {}
diff --git a/src/operation/overlay/EdgeSetNoder.cpp b/src/operation/overlay/EdgeSetNoder.cpp
index 8d2448c..3ba98d7 100644
--- a/src/operation/overlay/EdgeSetNoder.cpp
+++ b/src/operation/overlay/EdgeSetNoder.cpp
@@ -49,8 +49,7 @@ EdgeSetNoder::getNodedEdges()
     esi->computeIntersections(inputEdges, si, true);
     //Debug.println("has proper int = " + si.hasProperIntersection());
     std::vector<Edge*>* splitEdges = new std::vector<Edge*>();
-    for(int i = 0; i < (int)inputEdges->size(); i++) {
-        Edge* e = (*inputEdges)[i];
+    for(Edge* e : *inputEdges) {
         e->getEdgeIntersectionList().addSplitEdges(splitEdges);
     }
     return splitEdges;
diff --git a/src/operation/overlay/ElevationMatrix.cpp b/src/operation/overlay/ElevationMatrix.cpp
index 128c368..262cb36 100644
--- a/src/operation/overlay/ElevationMatrix.cpp
+++ b/src/operation/overlay/ElevationMatrix.cpp
@@ -100,10 +100,10 @@ ElevationMatrix::ElevationMatrix(const Envelope& newEnv,
 {
     cellwidth = env.getWidth() / cols;
     cellheight = env.getHeight() / rows;
-    if(! cellwidth) {
+    if(cellwidth == 0) {
         cols = 1;
     }
-    if(! cellheight) {
+    if(cellheight == 0) {
         rows = 1;
     }
 }
@@ -159,7 +159,7 @@ ElevationMatrix::getCell(const Coordinate& c)
 {
     int col, row;
 
-    if(! cellwidth) {
+    if(cellwidth == 0) {
         col = 0;
     }
     else {
@@ -169,7 +169,7 @@ ElevationMatrix::getCell(const Coordinate& c)
             col = cols - 1;
         }
     }
-    if(! cellheight) {
+    if(cellheight == 0) {
         row = 0;
     }
     else {

-----------------------------------------------------------------------

Summary of changes:
 include/geos/geomgraph/index/SegmentIntersector.h   |  2 +-
 include/geos/operation/buffer/RightmostEdgeFinder.h |  2 +-
 src/geom/LineSegment.cpp                            |  2 +-
 src/noding/snap/SnappingIntersectionAdder.cpp       |  4 ++--
 src/operation/buffer/RightmostEdgeFinder.cpp        | 10 ++++++----
 src/operation/distance/DistanceOp.cpp               |  6 +++---
 src/operation/overlay/EdgeSetNoder.cpp              |  3 +--
 src/operation/overlay/ElevationMatrix.cpp           |  8 ++++----
 8 files changed, 19 insertions(+), 18 deletions(-)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list