[geos-commits] [SCM] GEOS branch master updated. 65791765e58af02edf6471c4cc7b7fb193abeca7

git at osgeo.org git at osgeo.org
Fri Jan 29 15:37:30 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  65791765e58af02edf6471c4cc7b7fb193abeca7 (commit)
      from  d8a1b32762a799ad8364c48ba84924f61c93c132 (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 65791765e58af02edf6471c4cc7b7fb193abeca7
Author: Daniel Baston <dbaston at gmail.com>
Date:   Fri Jan 29 18:36:16 2021 -0500

    Quiet clang warnings

diff --git a/benchmarks/algorithm/UnaryUnionSegmentsPerfTest.cpp b/benchmarks/algorithm/UnaryUnionSegmentsPerfTest.cpp
index b3c6a22..330e681 100644
--- a/benchmarks/algorithm/UnaryUnionSegmentsPerfTest.cpp
+++ b/benchmarks/algorithm/UnaryUnionSegmentsPerfTest.cpp
@@ -66,6 +66,6 @@ int main(int argc, char** argv) {
     auto num_reps = argc > 2 ? std::atol(argv[2]) : 1;
 
     for (decltype(num_reps) i = 0; i < num_reps; i++) {
-        tester.test(num_lines);
+        tester.test(static_cast<std::size_t>(num_lines));
     }
 }
diff --git a/capi/geos_ts_c.cpp b/capi/geos_ts_c.cpp
index 052c60f..507b743 100644
--- a/capi/geos_ts_c.cpp
+++ b/capi/geos_ts_c.cpp
@@ -2092,7 +2092,7 @@ extern "C" {
     int
     GEOS_getWKBOutputDims_r(GEOSContextHandle_t extHandle)
     {
-        return execute(extHandle, -1, [&]() {
+        return execute(extHandle, -1, [&]() -> int {
             GEOSContextHandleInternal_t* handle = reinterpret_cast<GEOSContextHandleInternal_t*>(extHandle);
             return handle->WKBOutputDims;
         });
diff --git a/include/geos/index/quadtree/Quadtree.h b/include/geos/index/quadtree/Quadtree.h
index e3897c2..c0bbc5e 100644
--- a/include/geos/index/quadtree/Quadtree.h
+++ b/include/geos/index/quadtree/Quadtree.h
@@ -115,7 +115,7 @@ public:
     ~Quadtree() override = default;
 
     /// Returns the number of levels in the tree.
-    int depth();
+    std::size_t depth();
 
     /// Returns the number of items in the tree.
     std::size_t size();
diff --git a/include/geos/io/WKTWriter.h b/include/geos/io/WKTWriter.h
index c0af8e7..f25da28 100644
--- a/include/geos/io/WKTWriter.h
+++ b/include/geos/io/WKTWriter.h
@@ -220,7 +220,7 @@ protected:
     void appendCoordinate(const geom::Coordinate* coordinate,
                           Writer* writer);
 
-    std::string writeNumber(double d);
+    std::string writeNumber(double d) const;
 
     void appendLineStringText(
         const geom::LineString* lineString,
@@ -270,7 +270,7 @@ private:
         const geom::Geometry* geometry,
         bool isFormatted, Writer* writer);
 
-    void indent(int level, Writer* writer);
+    void indent(int level, Writer* writer) const;
 };
 
 } // namespace geos::io
diff --git a/include/geos/operation/overlayng/EdgeNodingBuilder.h b/include/geos/operation/overlayng/EdgeNodingBuilder.h
index 033ab66..44cc0d8 100644
--- a/include/geos/operation/overlayng/EdgeNodingBuilder.h
+++ b/include/geos/operation/overlayng/EdgeNodingBuilder.h
@@ -199,7 +199,7 @@ public:
         : pm(p_pm)
         , inputEdges(new std::vector<SegmentString*>)
         , customNoder(p_customNoder)
-        , hasEdges({false,false})
+        , hasEdges{{false,false}}
         , clipEnv(nullptr)
         , intAdder(lineInt)
         {};
diff --git a/include/geos/operation/union/OverlapUnion.h b/include/geos/operation/union/OverlapUnion.h
index e0f1db0..383b513 100644
--- a/include/geos/operation/union/OverlapUnion.h
+++ b/include/geos/operation/union/OverlapUnion.h
@@ -123,13 +123,13 @@ private:
 
     geounion::ClassicUnionStrategy defaultUnionFunction;
 
-    geom::Envelope overlapEnvelope(const geom::Geometry* geom0, const geom::Geometry* geom1);
+    static geom::Envelope overlapEnvelope(const geom::Geometry* geom0, const geom::Geometry* geom1);
     std::unique_ptr<geom::Geometry> extractByEnvelope(const geom::Envelope& env, const geom::Geometry* geom, std::vector<std::unique_ptr<geom::Geometry>>& disjointGeoms);
-    std::unique_ptr<geom::Geometry> combine(std::unique_ptr<geom::Geometry>& unionGeom, std::vector<std::unique_ptr<geom::Geometry>>& disjointPolys);
+    static std::unique_ptr<geom::Geometry> combine(std::unique_ptr<geom::Geometry>& unionGeom, std::vector<std::unique_ptr<geom::Geometry>>& disjointPolys);
     std::unique_ptr<geom::Geometry> unionFull(const geom::Geometry* geom0, const geom::Geometry* geom1);
-    std::unique_ptr<geom::Geometry> unionBuffer(const geom::Geometry* geom0, const geom::Geometry* geom1);
+    static std::unique_ptr<geom::Geometry> unionBuffer(const geom::Geometry* geom0, const geom::Geometry* geom1);
     bool isBorderSegmentsSame(const geom::Geometry* result, const geom::Envelope& env);
-    bool isEqual(std::vector<geom::LineSegment>& segs0, std::vector<geom::LineSegment>& segs1);
+    static bool isEqual(std::vector<geom::LineSegment>& segs0, std::vector<geom::LineSegment>& segs1);
     std::vector<geom::LineSegment> extractBorderSegments(const geom::Geometry* geom0, const geom::Geometry* geom1, const geom::Envelope& env);
     void extractBorderSegments(const geom::Geometry* geom, const geom::Envelope& penv, std::vector<geom::LineSegment>& psegs);
 
diff --git a/include/geos/shape/fractal/HilbertCode.h b/include/geos/shape/fractal/HilbertCode.h
index 46012ef..76defbc 100644
--- a/include/geos/shape/fractal/HilbertCode.h
+++ b/include/geos/shape/fractal/HilbertCode.h
@@ -113,7 +113,7 @@ private:
 
     static uint32_t descan(uint32_t x);
 
-    static void checkLevel(int level);
+    static void checkLevel(uint32_t level);
 
 
 };
diff --git a/include/geos/triangulate/quadedge/QuadEdgeQuartet.h b/include/geos/triangulate/quadedge/QuadEdgeQuartet.h
index 30817d9..0614fa4 100644
--- a/include/geos/triangulate/quadedge/QuadEdgeQuartet.h
+++ b/include/geos/triangulate/quadedge/QuadEdgeQuartet.h
@@ -25,7 +25,7 @@ namespace quadedge {
 class GEOS_DLL QuadEdgeQuartet {
 
 public:
-    QuadEdgeQuartet() : e{QuadEdge(0), QuadEdge(1), QuadEdge(2), QuadEdge(3)} {
+    QuadEdgeQuartet() : e{{QuadEdge(0), QuadEdge(1), QuadEdge(2), QuadEdge(3)}} {
         e[0].next = &(e[0]);
         e[1].next = &(e[3]);
         e[2].next = &(e[2]);
diff --git a/include/geos/triangulate/quadedge/QuadEdgeSubdivision.h b/include/geos/triangulate/quadedge/QuadEdgeSubdivision.h
index f5852f9..005d096 100644
--- a/include/geos/triangulate/quadedge/QuadEdgeSubdivision.h
+++ b/include/geos/triangulate/quadedge/QuadEdgeSubdivision.h
@@ -24,6 +24,7 @@
 #include <list>
 #include <stack>
 #include <unordered_set>
+#include <array>
 #include <vector>
 
 #include <geos/geom/MultiLineString.h>
@@ -360,7 +361,7 @@ private:
      *
      * Only one visitor is allowed to be active at a time, so this is safe.
      */
-    QuadEdge* triEdges[3];
+    std::array<QuadEdge*, 3> m_triEdges;
 
     /** \brief
      * Resets the `visited` flag of each `QuadEdge` prior to iteration, if necessary.
@@ -378,7 +379,7 @@ private:
      * @return `null` if the triangle should not be visited (for instance, if it is
      *         outer)
      */
-    QuadEdge** fetchTriangleToVisit(QuadEdge* edge, QuadEdgeStack& edgeStack, bool includeFrame);
+    std::array<QuadEdge*, 3>* fetchTriangleToVisit(QuadEdge* edge, QuadEdgeStack& edgeStack, bool includeFrame);
 
     /** \brief
      * Gets the coordinates for each triangle in the subdivision as an array.
diff --git a/include/geos/triangulate/quadedge/TriangleVisitor.h b/include/geos/triangulate/quadedge/TriangleVisitor.h
index 443b665..7989a60 100644
--- a/include/geos/triangulate/quadedge/TriangleVisitor.h
+++ b/include/geos/triangulate/quadedge/TriangleVisitor.h
@@ -38,7 +38,7 @@ public:
      *
      * @param triEdges an array of the 3 quad edges in a triangle (in CCW order)
      */
-    virtual void visit(QuadEdge* triEdges[3]) = 0;
+    virtual void visit(std::array<QuadEdge*, 3> &) = 0;
     virtual ~TriangleVisitor() = default;
 private:
 } ;
diff --git a/src/index/quadtree/Quadtree.cpp b/src/index/quadtree/Quadtree.cpp
index 5c72c04..b8834cd 100644
--- a/src/index/quadtree/Quadtree.cpp
+++ b/src/index/quadtree/Quadtree.cpp
@@ -68,7 +68,7 @@ Quadtree::ensureExtent(const Envelope* itemEnv, double minExtent)
 }
 
 /*public*/
-int
+size_t
 Quadtree::depth()
 {
     return root.depth();
diff --git a/src/io/WKTWriter.cpp b/src/io/WKTWriter.cpp
index 1c010a2..7ad23fd 100644
--- a/src/io/WKTWriter.cpp
+++ b/src/io/WKTWriter.cpp
@@ -358,9 +358,9 @@ WKTWriter::appendCoordinate(const Coordinate* coordinate,
 
 /* protected */
 std::string
-WKTWriter::writeNumber(double d)
+WKTWriter::writeNumber(double d) const
 {
-    int precision = decimalPlaces >= 0 ? decimalPlaces : 0;
+    uint32_t precision = decimalPlaces >= 0 ? static_cast<std::uint32_t>(decimalPlaces) : 0;
     /*
     * For a "trimmed" result, with no trailing zeros we use
     * the ryu library.
@@ -379,7 +379,7 @@ WKTWriter::writeNumber(double d)
     else {
         std::stringstream ss;
         ss << std::fixed;
-        ss << std::setprecision(precision);
+        ss << std::setprecision(static_cast<int>(precision));
         ss << d;
         return ss.str();
     }
@@ -533,13 +533,13 @@ WKTWriter::appendGeometryCollectionText(
 }
 
 void
-WKTWriter::indent(int p_level, Writer* writer)
+WKTWriter::indent(int p_level, Writer* writer) const
 {
     if(!isFormatted || p_level <= 0) {
         return;
     }
     writer->write("\n");
-    writer->write(std::string(INDENT * p_level, ' '));
+    writer->write(std::string(INDENT * static_cast<std::size_t>(p_level), ' '));
 }
 
 } // namespace geos.io
diff --git a/src/noding/OrientedCoordinateArray.cpp b/src/noding/OrientedCoordinateArray.cpp
index 99d4fd0..352d6fb 100644
--- a/src/noding/OrientedCoordinateArray.cpp
+++ b/src/noding/OrientedCoordinateArray.cpp
@@ -70,14 +70,14 @@ OrientedCoordinateArray::compareOriented(const geom::CoordinateSequence& pts1,
 {
     int dir1 = orientation1 ? 1 : -1;
     int dir2 = orientation2 ? 1 : -1;
-    auto limit1 = orientation1 ? pts1.size() : -1;
-    auto limit2 = orientation2 ? pts2.size() : -1;
+    int limit1 = orientation1 ? static_cast<int>(pts1.size()) : -1;
+    int limit2 = orientation2 ? static_cast<int>(pts2.size()) : -1;
 
-    auto i1 = orientation1 ? 0 : pts1.size() - 1;
-    auto i2 = orientation2 ? 0 : pts2.size() - 1;
+    int i1 = orientation1 ? 0 : static_cast<int>(pts1.size() - 1);
+    int i2 = orientation2 ? 0 : static_cast<int>(pts2.size() - 1);
     //int comp = 0; // unused, but is in JTS ...
     while(true) {
-        int compPt = pts1[i1].compareTo(pts2[i2]);
+        int compPt = pts1[static_cast<std::size_t>(i1)].compareTo(pts2[static_cast<std::size_t>(i2)]);
         if(compPt != 0) {
             return compPt;
         }
diff --git a/src/operation/intersection/RectangleIntersection.cpp b/src/operation/intersection/RectangleIntersection.cpp
index 0b2164e..9fc320f 100644
--- a/src/operation/intersection/RectangleIntersection.cpp
+++ b/src/operation/intersection/RectangleIntersection.cpp
@@ -228,10 +228,10 @@ RectangleIntersection::clip_linestring_parts(const geom::LineString* gi,
                         Rectangle::onEdge(pos) &&
                         !Rectangle::onSameEdge(prev_pos, pos)	// discard if travels along edge
                   ) {
-                    std::vector<Coordinate>* coords = new std::vector<Coordinate>(2);
-                    (*coords)[0] = Coordinate(x0, y0);
-                    (*coords)[1] = Coordinate(x, y);
-                    auto seq = _csf->create(coords);
+                    std::vector<Coordinate> coords(2);
+                    coords[0] = Coordinate(x0, y0);
+                    coords[1] = Coordinate(x, y);
+                    auto seq = _csf->create(std::move(coords));
                     geom::LineString* line = _gf->createLineString(seq.release());
                     parts.add(line);
                 }
@@ -257,7 +257,7 @@ RectangleIntersection::clip_linestring_parts(const geom::LineString* gi,
         }
 
         else {
-            // The point is now stricly inside or on the edge.
+            // The point is now strictly inside or on the edge.
             // Keep iterating until the end or the point goes
             // outside. We may have to output partial linestrings
             // while iterating until we go strictly outside
@@ -290,19 +290,20 @@ RectangleIntersection::clip_linestring_parts(const geom::LineString* gi,
                     // Output a LineString if it at least one segment long
 
                     if(start_index < i - 1 || add_start || through_box) {
-                        std::vector<Coordinate>* coords = new std::vector<Coordinate>();
+                        std::vector<Coordinate> coords;
                         if(add_start) {
-                            coords->push_back(Coordinate(x0, y0));
+                            coords.emplace_back(x0, y0);
                             add_start = false;
                         }
                         //line->addSubLineString(&g, start_index, i-1);
-                        coords->insert(coords->end(), cs.begin() + start_index, cs.begin() + i);
+                        coords.insert(coords.end(), cs.begin() + static_cast<long>(start_index), cs.begin() +
+                                                                                                 static_cast<long>(i));
 
                         if(through_box) {
-                            coords->push_back(Coordinate(x, y));
+                            coords.emplace_back(x, y);
                         }
 
-                        auto seq = _csf->create(coords);
+                        auto seq = _csf->create(std::move(coords));
                         geom::LineString* line = _gf->createLineString(seq.release());
                         parts.add(line);
                     }
@@ -313,17 +314,18 @@ RectangleIntersection::clip_linestring_parts(const geom::LineString* gi,
                     if(Rectangle::onSameEdge(prev_pos, pos)) {
                         // Nothing to output if we haven't been elsewhere
                         if(start_index < i - 1 || add_start) {
-                            std::vector<Coordinate>* coords = new std::vector<Coordinate>();
+                            std::vector<Coordinate> coords;
                             //geom::LineString * line = new geom::LineString();
                             if(add_start) {
                                 //line->addPoint(x0,y0);
-                                coords->push_back(Coordinate(x0, y0));
+                                coords.emplace_back(x0, y0);
                                 add_start = false;
                             }
                             //line->addSubLineString(&g, start_index, i-1);
-                            coords->insert(coords->end(), cs.begin() + start_index, cs.begin() + i);
+                            coords.insert(coords.end(), cs.begin() + static_cast<long>(start_index), cs.begin() +
+                                                                                                     static_cast<long>(i));
 
-                            auto seq = _csf->create(coords);
+                            auto seq = _csf->create(std::move(coords));
                             geom::LineString* line = _gf->createLineString(seq.release());
                             parts.add(line);
                         }
@@ -346,17 +348,18 @@ RectangleIntersection::clip_linestring_parts(const geom::LineString* gi,
 
             if(!go_outside &&						// meaning data ended
                     (start_index < i - 1 || add_start)) {	// meaning something has to be generated
-                std::vector<Coordinate>* coords = new std::vector<Coordinate>();
+                std::vector<Coordinate> coords;
                 //geom::LineString * line = new geom::LineString();
                 if(add_start) {
                     //line->addPoint(x0,y0);
-                    coords->push_back(Coordinate(x0, y0));
+                    coords.emplace_back(x0, y0);
                     add_start = false;
                 }
                 //line->addSubLineString(&g, start_index, i-1);
-                coords->insert(coords->end(), cs.begin() + start_index, cs.begin() + i);
+                coords.insert(coords.end(), cs.begin() + static_cast<long>(start_index), cs.begin() +
+                                                                                         static_cast<long>(i));
 
-                auto seq = _csf->create(coords);
+                auto seq = _csf->create(std::move(coords));
                 geom::LineString* line = _gf->createLineString(seq.release());
                 parts.add(line);
             }
diff --git a/src/operation/overlay/ElevationMatrix.cpp b/src/operation/overlay/ElevationMatrix.cpp
index 262cb36..f5682d3 100644
--- a/src/operation/overlay/ElevationMatrix.cpp
+++ b/src/operation/overlay/ElevationMatrix.cpp
@@ -166,7 +166,7 @@ ElevationMatrix::getCell(const Coordinate& c)
         double xoffset = c.x - env.getMinX();
         col = (int)(xoffset / cellwidth);
         if(col == (int)cols) {
-            col = cols - 1;
+            col = static_cast<int>(cols - 1);
         }
     }
     if(cellheight == 0) {
@@ -176,10 +176,10 @@ ElevationMatrix::getCell(const Coordinate& c)
         double yoffset = c.y - env.getMinY();
         row = (int)(yoffset / cellheight);
         if(row == (int)rows) {
-            row = rows - 1;
+            row = static_cast<int>(rows - 1);
         }
     }
-    int celloffset = (cols * row) + col;
+    int celloffset = static_cast<int>(cols) * row + col;
 
     if(celloffset < 0 || celloffset >= (int)(cols * rows)) {
         std::ostringstream s;
@@ -188,7 +188,7 @@ ElevationMatrix::getCell(const Coordinate& c)
         throw util::IllegalArgumentException(s.str());
     }
 
-    return cells[celloffset];
+    return cells[static_cast<std::size_t>(celloffset)];
 }
 
 const ElevationMatrixCell&
diff --git a/src/operation/overlayng/InputGeometry.cpp b/src/operation/overlayng/InputGeometry.cpp
index 04d70f3..9df59e0 100644
--- a/src/operation/overlayng/InputGeometry.cpp
+++ b/src/operation/overlayng/InputGeometry.cpp
@@ -21,8 +21,8 @@ namespace overlayng { // geos.operation.overlayng
 
 /*public*/
 InputGeometry::InputGeometry(const Geometry* geomA, const Geometry* geomB)
-    : geom({geomA, geomB})
-    , isCollapsed({false, false})
+    : geom{{geomA, geomB}}
+    , isCollapsed{{false, false}}
 {}
 
 /*public*/
diff --git a/src/operation/polygonize/EdgeRing.cpp b/src/operation/polygonize/EdgeRing.cpp
index 8e6d65e..3d99c54 100644
--- a/src/operation/polygonize/EdgeRing.cpp
+++ b/src/operation/polygonize/EdgeRing.cpp
@@ -213,7 +213,7 @@ const CoordinateSequence*
 EdgeRing::getCoordinates()
 {
     if(ringPts == nullptr) {
-        ringPts = detail::make_unique<CoordinateArraySequence>(0, 0);
+        ringPts = detail::make_unique<CoordinateArraySequence>(0u, 0u);
         for(const auto& de : deList) {
             auto edge = dynamic_cast<PolygonizeEdge*>(de->getEdge());
             addEdge(edge->getLine()->getCoordinatesRO(),
diff --git a/src/operation/predicate/RectangleIntersects.cpp b/src/operation/predicate/RectangleIntersects.cpp
index c8ad09f..a2feea7 100644
--- a/src/operation/predicate/RectangleIntersects.cpp
+++ b/src/operation/predicate/RectangleIntersects.cpp
@@ -157,8 +157,7 @@ protected:
         }
 
         // test each corner of rectangle for inclusion
-        for(int i = 0; i < 4; i++) {
-
+        for(unsigned int i = 0; i < 4; i++) {
             const geom::Coordinate& rectPt = rectSeq.getAt(i);
 
             if(!elementEnv.contains(rectPt)) {
diff --git a/src/operation/union/OverlapUnion.cpp b/src/operation/union/OverlapUnion.cpp
index ea4fb8c..7e21ed2 100644
--- a/src/operation/union/OverlapUnion.cpp
+++ b/src/operation/union/OverlapUnion.cpp
@@ -80,7 +80,7 @@ OverlapUnion::overlapEnvelope(const Geometry* geom0, const Geometry* geom1)
 std::unique_ptr<Geometry>
 OverlapUnion::combine(std::unique_ptr<Geometry>& unionGeom, std::vector<std::unique_ptr<Geometry>>& disjointPolys)
 {
-    if (disjointPolys.size() <= 0)
+    if (disjointPolys.empty())
         return std::move(unionGeom);
 
     disjointPolys.push_back(std::move(unionGeom));
@@ -221,14 +221,14 @@ OverlapUnion::extractBorderSegments(const Geometry* geom, const Envelope& penv,
     class BorderSegmentFilter : public CoordinateSequenceFilter {
 
     private:
-        const Envelope env;
-        std::vector<LineSegment>* segs;
+        const Envelope m_env;
+        std::vector<LineSegment>* m_segs;
 
     public:
 
-        BorderSegmentFilter(const Envelope& penv, std::vector<LineSegment>* psegs)
-            : env(penv),
-              segs(psegs) {};
+        BorderSegmentFilter(const Envelope& env, std::vector<LineSegment>* segs)
+            : m_env(env),
+              m_segs(segs) {};
 
         bool
         isDone() const override { return false; }
@@ -244,9 +244,9 @@ OverlapUnion::extractBorderSegments(const Geometry* geom, const Envelope& penv,
             // extract LineSegment
             const Coordinate& p0 = seq.getAt(i-1);
             const Coordinate& p1 = seq.getAt(i  );
-            bool isBorder = intersects(env, p0, p1) && ! containsProperly(env, p0, p1);
+            bool isBorder = intersects(m_env, p0, p1) && ! containsProperly(m_env, p0, p1);
             if (isBorder) {
-                segs->emplace_back(p0, p1);
+                m_segs->emplace_back(p0, p1);
             }
         };
 
diff --git a/src/operation/valid/RepeatedPointRemover.cpp b/src/operation/valid/RepeatedPointRemover.cpp
index b4aac9a..2b3dd7c 100644
--- a/src/operation/valid/RepeatedPointRemover.cpp
+++ b/src/operation/valid/RepeatedPointRemover.cpp
@@ -27,7 +27,7 @@ RepeatedPointRemover::removeRepeatedPoints(const geom::CoordinateSequence* seq)
     using geom::Coordinate;
 
     if (seq->isEmpty()) {
-        return detail::make_unique<geom::CoordinateArraySequence>(0, seq->getDimension());
+        return detail::make_unique<geom::CoordinateArraySequence>(0u, seq->getDimension());
     }
 
     auto pts = detail::make_unique<std::vector<Coordinate>>();
diff --git a/src/shape/fractal/HilbertCode.cpp b/src/shape/fractal/HilbertCode.cpp
index 484f475..8cfdcba 100644
--- a/src/shape/fractal/HilbertCode.cpp
+++ b/src/shape/fractal/HilbertCode.cpp
@@ -89,7 +89,7 @@ HilbertCode::descan(uint32_t x)
 
 /*private static*/
 void
-HilbertCode::checkLevel(int level)
+HilbertCode::checkLevel(uint32_t level)
 {
     if (level > MAX_LEVEL) {
         throw util::IllegalArgumentException("Level out of range");
diff --git a/src/simplify/TopologyPreservingSimplifier.cpp b/src/simplify/TopologyPreservingSimplifier.cpp
index bd99e12..6bec39f 100644
--- a/src/simplify/TopologyPreservingSimplifier.cpp
+++ b/src/simplify/TopologyPreservingSimplifier.cpp
@@ -224,7 +224,7 @@ LineStringMapBuilderFilter::filter_ro(const Geometry* geom)
 
     if(const LineString* ls =
                 dynamic_cast<const LineString*>(geom)) {
-        int minSize = ls->isClosed() ? 4 : 2;
+        std::size_t minSize = ls->isClosed() ? 4 : 2;
         taggedLine = new TaggedLineString(ls, minSize);
     }
     else {
diff --git a/src/triangulate/quadedge/QuadEdgeSubdivision.cpp b/src/triangulate/quadedge/QuadEdgeSubdivision.cpp
index 613e891..4917f87 100644
--- a/src/triangulate/quadedge/QuadEdgeSubdivision.cpp
+++ b/src/triangulate/quadedge/QuadEdgeSubdivision.cpp
@@ -320,15 +320,15 @@ QuadEdgeSubdivision::getPrimaryEdges(bool includeFrame)
     return std::unique_ptr<QuadEdgeList>(edges);
 }
 
-QuadEdge**
+std::array<QuadEdge*, 3>*
 QuadEdgeSubdivision::fetchTriangleToVisit(QuadEdge* edge,
         QuadEdgeStack& edgeStack, bool includeFrame)
 {
     QuadEdge* curr = edge;
-    int edgeCount = 0;
+    std::size_t edgeCount = 0;
     bool isFrame = false;
     do {
-        triEdges[edgeCount] = curr;
+        m_triEdges[edgeCount] = curr;
 
         if(!includeFrame && isFrameEdge(*curr)) {
             isFrame = true;
@@ -351,7 +351,7 @@ QuadEdgeSubdivision::fetchTriangleToVisit(QuadEdge* edge,
     if(!includeFrame && isFrame) {
         return nullptr;
     }
-    return triEdges;
+    return &m_triEdges;
 }
 
 class
@@ -366,7 +366,7 @@ public:
     }
 
     void
-    visit(QuadEdge* triEdges[3]) override
+    visit(std::array<QuadEdge*, 3>& triEdges) override
     {
         auto coordSeq = coordSeqFact.create(4, 0);
         for(std::size_t i = 0; i < 3; i++) {
@@ -383,7 +383,7 @@ class
     QuadEdgeSubdivision::TriangleCircumcentreVisitor : public TriangleVisitor {
 public:
     void
-    visit(QuadEdge* triEdges[3]) override
+    visit(std::array<QuadEdge*, 3>& triEdges) override
     {
         Triangle triangle(triEdges[0]->orig().getCoordinate(),
                           triEdges[1]->orig().getCoordinate(), triEdges[2]->orig().getCoordinate());
@@ -394,7 +394,7 @@ public:
 
         Vertex ccVertex(cc);
 
-        for(int i = 0 ; i < 3 ; i++) {
+        for(uint8_t i = 0 ; i < 3 ; i++) {
             triEdges[i]->rot().setOrig(ccVertex);
         }
     }
@@ -431,9 +431,9 @@ QuadEdgeSubdivision::visitTriangles(TriangleVisitor* triVisitor, bool includeFra
         QuadEdge* edge = edgeStack.top();
         edgeStack.pop();
         if(!edge->isVisited()) {
-            QuadEdge** p_triEdges = fetchTriangleToVisit(edge, edgeStack, includeFrame);
-            if(p_triEdges != nullptr) {
-                triVisitor->visit(p_triEdges);
+            auto triEdges = fetchTriangleToVisit(edge, edgeStack, includeFrame);
+            if(triEdges != nullptr) {
+                triVisitor->visit(*triEdges);
             }
         }
     }
diff --git a/src/util/GeometricShapeFactory.cpp b/src/util/GeometricShapeFactory.cpp
index 6ac97dc..3f04ee4 100644
--- a/src/util/GeometricShapeFactory.cpp
+++ b/src/util/GeometricShapeFactory.cpp
@@ -85,7 +85,7 @@ std::unique_ptr<Polygon>
 GeometricShapeFactory::createRectangle()
 {
     uint32_t i;
-    int ipt = 0;
+    uint32_t ipt = 0;
     uint32_t nSide = nPts / 4;
     if(nSide < 1) {
         nSide = 1;
@@ -135,7 +135,7 @@ GeometricShapeFactory::createCircle()
     env.reset();
 
     std::vector<Coordinate> pts(nPts + 1);
-    int iPt = 0;
+    uint32_t iPt = 0;
     for(uint32_t i = 0; i < nPts; i++) {
         double ang = i * (2 * 3.14159265358979 / nPts);
         double x = xRadius * cos(ang) + centreX;
@@ -167,7 +167,7 @@ GeometricShapeFactory::createArc(double startAng, double angExtent)
     double angInc = angSize / (nPts - 1);
 
     std::vector<Coordinate> pts(nPts);
-    int iPt = 0;
+    uint32_t iPt = 0;
     for(uint32_t i = 0; i < nPts; i++) {
         double ang = startAng + i * angInc;
         double x = xRadius * cos(ang) + centreX;
@@ -197,7 +197,7 @@ GeometricShapeFactory::createArcPolygon(double startAng, double angExtent)
     double angInc = angSize / (nPts - 1);
 
     std::vector<Coordinate> pts(nPts + 2);
-    int iPt = 0;
+    uint32_t iPt = 0;
     pts[iPt++] = coord(centreX, centreY);
     for(uint32_t i = 0; i < nPts; i++) {
         double ang = startAng + i * angInc;
diff --git a/src/util/Profiler.cpp b/src/util/Profiler.cpp
index 524fd4c..be5f411 100644
--- a/src/util/Profiler.cpp
+++ b/src/util/Profiler.cpp
@@ -62,7 +62,7 @@ Profile::getTotFormatted() const
     std::string fmt = usec.str();
     int insertPosition = static_cast<int>(fmt.length()) - 3;
     while (insertPosition > 0) {
-        fmt.insert(insertPosition, ",");
+        fmt.insert(static_cast<std::string::size_type>(insertPosition), ",");
         insertPosition-=3;
     }
     return fmt + " usec";
diff --git a/tests/unit/algorithm/RobustLineIntersectionTest.cpp b/tests/unit/algorithm/RobustLineIntersectionTest.cpp
index 6172352..0e3ef2b 100644
--- a/tests/unit/algorithm/RobustLineIntersectionTest.cpp
+++ b/tests/unit/algorithm/RobustLineIntersectionTest.cpp
@@ -111,7 +111,7 @@ struct test_robustlineintersection_data {
     void
     checkIntersection(const std::string& wkt1,
                       const std::string& wkt2,
-                      int expectedIntersectionNum,
+                      std::size_t expectedIntersectionNum,
                       const std::string& expectedWKT,
                       double distanceTolerance)
     //throws ParseException
@@ -150,7 +150,7 @@ struct test_robustlineintersection_data {
     void
     checkIntersection(const std::string& wkt1,
                       const std::string& wkt2,
-                      int expectedIntersectionNum,
+                      std::size_t expectedIntersectionNum,
                       const std::vector<Coordinate>& intPt,
                       double distanceTolerance)
     // throws ParseException
@@ -239,7 +239,7 @@ struct test_robustlineintersection_data {
         li.computeIntersection(pt[0], pt[1], pt[2], pt[3]);
 
         // check that input points are unchanged
-        for(int i = 0; i < 4; i++) {
+        for(std::size_t i = 0; i < 4; i++) {
             ensure_equals(savePt[i], pt[i]);
         }
     }
diff --git a/tests/unit/capi/GEOSGeom_createCollectionTest.cpp b/tests/unit/capi/GEOSGeom_createCollectionTest.cpp
index 68da373..ab45d3c 100644
--- a/tests/unit/capi/GEOSGeom_createCollectionTest.cpp
+++ b/tests/unit/capi/GEOSGeom_createCollectionTest.cpp
@@ -83,11 +83,11 @@ template<>
 void object::test<2>
 ()
 {
-    std::array<GEOSGeom, geom_size> geoms = {
+    std::array<GEOSGeom, geom_size> geoms = {{
         GEOSGeom_createEmptyPoint_r(handle_),
         GEOSGeom_createEmptyPoint_r(handle_),
         GEOSGeom_createEmptyPoint_r(handle_)
-    };
+    }};
     // takes ownership of individual geometries
     geom_ = GEOSGeom_createCollection_r(handle_, GEOS_MULTIPOINT,
                                         geoms.data(), static_cast<int>(geoms.size()));
diff --git a/tests/unit/capi/GEOSGeom_createPolygonTest.cpp b/tests/unit/capi/GEOSGeom_createPolygonTest.cpp
index b560975..025d4f6 100644
--- a/tests/unit/capi/GEOSGeom_createPolygonTest.cpp
+++ b/tests/unit/capi/GEOSGeom_createPolygonTest.cpp
@@ -23,7 +23,7 @@ void object::test<1>
 
     double shell_coords[] = {0,0, 0,10, 10,10, 10,0, 0,0};
     double hole_coords[] = {5,5, 5,6, 6,6, 6,5, 5,5};
-    for (int i = 0; i < 5; i++) {
+    for (unsigned int i = 0; i < 5; i++) {
         GEOSCoordSeq_setXY(shell_seq, i, shell_coords[2*i], shell_coords[2*i+1]);
         GEOSCoordSeq_setXY(hole_seq, i, hole_coords[2*i], hole_coords[2*i+1]);
     }
diff --git a/tests/unit/edgegraph/EdgeGraphTest.cpp b/tests/unit/edgegraph/EdgeGraphTest.cpp
index 39fa0bc..7162edd 100644
--- a/tests/unit/edgegraph/EdgeGraphTest.cpp
+++ b/tests/unit/edgegraph/EdgeGraphTest.cpp
@@ -46,7 +46,7 @@ struct test_edgegraph_data {
     void checkEdgeRing(EdgeGraph& graph, Coordinate& p, std::vector<Coordinate>& dest) {
         HalfEdge* e = graph.findEdge(p, dest[0]);
         HalfEdge* onext = e;
-        int i = 0;
+        std::size_t i = 0;
         do {
             ensure(onext->dest().equals2D(dest[i++]));
             onext = onext->oNext();
diff --git a/tests/unit/geom/GeometryComponentFilterTest.cpp b/tests/unit/geom/GeometryComponentFilterTest.cpp
index a42551b..afb48ca 100644
--- a/tests/unit/geom/GeometryComponentFilterTest.cpp
+++ b/tests/unit/geom/GeometryComponentFilterTest.cpp
@@ -72,7 +72,7 @@ void object::test<1>
 ()
 {
     // collection of 4 geometries
-    GeometryPtr g(reader.read("GEOMETRYCOLLECTION("
+    GeometryPtr input(reader.read("GEOMETRYCOLLECTION("
                               "POINT(0 0),"
                               "LINESTRING(0 0,1 1,1 2),"
                               "POLYGON((0 0,4 0,4 4,0 4,0 0)),"
@@ -104,7 +104,7 @@ void object::test<1>
     GeometryRefArray lineal;
     GeometryRefArray nonlineal;
     GeometryComponentSplitter splitter(lineal, nonlineal);
-    g->apply_ro(&splitter);
+    input->apply_ro(&splitter);
 
     // TODO: Verify the actual results
     // lineal:
diff --git a/tests/unit/geom/GeometryFilterTest.cpp b/tests/unit/geom/GeometryFilterTest.cpp
index 13c76a3..010bf03 100644
--- a/tests/unit/geom/GeometryFilterTest.cpp
+++ b/tests/unit/geom/GeometryFilterTest.cpp
@@ -42,7 +42,7 @@ void object::test<1>
 ()
 {
     // collection of 4 geometries
-    GeometryPtr g(reader.read("GEOMETRYCOLLECTION("
+    GeometryPtr input(reader.read("GEOMETRYCOLLECTION("
                               "POINT(0 0),"
                               "LINESTRING(0 0,1 1,1 2),"
                               "POLYGON((0 0,4 0,4 4,0 4,0 0)),"
@@ -74,7 +74,7 @@ void object::test<1>
     GeometryRefArray lineal;
     GeometryRefArray nonlineal;
     GeometrySplitter splitter(lineal, nonlineal);
-    g->apply_ro(&splitter);
+    input->apply_ro(&splitter);
 
     // TODO: Verify the actual results
     // lineal:
@@ -91,7 +91,7 @@ void object::test<1>
     ensure_equals(nonlineal.size(), 3ul);
     // TODO: is 7, shouldn't be not 4?
     //ensure_equals(lineal.size() + nonlineal.size(), g->getNumGeometries());
-    ensure_equals(g->getNumGeometries(), 4ul);
+    ensure_equals(input->getNumGeometries(), 4ul);
     ensure_equals(lineal.size() + nonlineal.size(), 7ul);
 }
 
diff --git a/tests/unit/noding/BasicSegmentStringTest.cpp b/tests/unit/noding/BasicSegmentStringTest.cpp
index cc49126..e0c2f5e 100644
--- a/tests/unit/noding/BasicSegmentStringTest.cpp
+++ b/tests/unit/noding/BasicSegmentStringTest.cpp
@@ -63,7 +63,7 @@ template<>
 void object::test<1>
 ()
 {
-    auto cs = geos::detail::make_unique<geos::geom::CoordinateArraySequence>(0, 2);
+    auto cs = geos::detail::make_unique<geos::geom::CoordinateArraySequence>(0u, 2u);
 
     ensure(nullptr != cs.get());
 
@@ -108,7 +108,7 @@ template<>
 void object::test<2>
 ()
 {
-    auto cs = geos::detail::make_unique<geos::geom::CoordinateArraySequence>(0, 2);
+    auto cs = geos::detail::make_unique<geos::geom::CoordinateArraySequence>(0u, 2u);
 
     ensure(nullptr != cs.get());
 
@@ -145,7 +145,7 @@ template<>
 void object::test<3>
 ()
 {
-    auto cs = geos::detail::make_unique<geos::geom::CoordinateArraySequence>(0, 2);
+    auto cs = geos::detail::make_unique<geos::geom::CoordinateArraySequence>(0u, 2u);
 
     ensure(nullptr != cs.get());
 
diff --git a/tests/unit/noding/SegmentNodeTest.cpp b/tests/unit/noding/SegmentNodeTest.cpp
index 50f2139..5c631b7 100644
--- a/tests/unit/noding/SegmentNodeTest.cpp
+++ b/tests/unit/noding/SegmentNodeTest.cpp
@@ -103,7 +103,7 @@ void object::test<2>
 
     // Create coordinates sequence
     const std::size_t coords_size = 2;
-    auto cs = geos::detail::make_unique<geos::geom::CoordinateArraySequence>(0, coords_size);
+    auto cs = geos::detail::make_unique<geos::geom::CoordinateArraySequence>(0u, coords_size);
 
     ensure(nullptr != cs.get());
 
@@ -146,7 +146,7 @@ void object::test<3>
 
     // Create coordinates sequence
     const std::size_t coords_size = 2;
-    auto cs = geos::detail::make_unique<geos::geom::CoordinateArraySequence>(0, coords_size);
+    auto cs = geos::detail::make_unique<geos::geom::CoordinateArraySequence>(0u, coords_size);
 
     ensure(nullptr != cs.get());
 
@@ -189,7 +189,7 @@ void object::test<4>
 
     // Create coordinates sequence
     const std::size_t coords_size = 2;
-    auto cs = geos::detail::make_unique<geos::geom::CoordinateArraySequence>(0, coords_size);
+    auto cs = geos::detail::make_unique<geos::geom::CoordinateArraySequence>(0u, coords_size);
 
     ensure(nullptr != cs.get());
 
diff --git a/tests/unit/precision/CommonBitsTest.cpp b/tests/unit/precision/CommonBitsTest.cpp
index 9725f57..fbd4c2c 100644
--- a/tests/unit/precision/CommonBitsTest.cpp
+++ b/tests/unit/precision/CommonBitsTest.cpp
@@ -36,7 +36,7 @@ template<>
 void object::test<2>
 ()
 {
-    constexpr int64_t val = 0xffffffffffffffffull;
+    constexpr int64_t val = static_cast<int64_t>(0xffffffffffffffffull);
     for(int i = 0; i < 64; i++) {
         ensure_equals(CommonBits::getBit(val, i), 1);
     }
@@ -48,7 +48,7 @@ template<>
 void object::test<3>
 ()
 {
-    constexpr int64_t val = 0xffffffff00000000ull;
+    constexpr int64_t val = static_cast<int64_t>(0xffffffff00000000ull);
     ensure_equals(CommonBits::getBit(val, 0), 0);
     ensure_equals(CommonBits::getBit(val, 63), 1);
 }
diff --git a/tests/unit/shape/fractal/MortonCodeTest.cpp b/tests/unit/shape/fractal/MortonCodeTest.cpp
index 0fac995..276bf41 100644
--- a/tests/unit/shape/fractal/MortonCodeTest.cpp
+++ b/tests/unit/shape/fractal/MortonCodeTest.cpp
@@ -16,7 +16,7 @@ namespace tut {
 // Common data used by tests
 struct test_mortoncode_data {
 
-    void checkDecode(uint32_t index, int x, int y)
+    static void checkDecode(uint32_t index, int x, int y)
     {
         Coordinate p = MortonCode::decode(index);
         //System.out.println(p);
@@ -24,7 +24,7 @@ struct test_mortoncode_data {
         ensure_equals(y, (int) p.y);
     }
 
-    void checkDecodeEncodeForLevel(uint32_t level)
+    static void checkDecodeEncodeForLevel(uint32_t level)
     {
         uint32_t n = MortonCode::levelSize(level);
         for (uint32_t i = 0; i < n; i++) {
@@ -33,11 +33,11 @@ struct test_mortoncode_data {
     }
 
 
-    void
+    static void
     checkDecodeEncode(uint32_t index)
     {
         Coordinate p = MortonCode::decode(index);
-        uint32_t encode = MortonCode::encode((uint32_t)(p.x), (uint32_t)(p.y));
+        uint32_t encode = MortonCode::encode(static_cast<int>(p.x), static_cast<int>(p.y));
         ensure_equals(index, encode);
     }
 

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

Summary of changes:
 .../algorithm/UnaryUnionSegmentsPerfTest.cpp       |  2 +-
 capi/geos_ts_c.cpp                                 |  2 +-
 include/geos/index/quadtree/Quadtree.h             |  2 +-
 include/geos/io/WKTWriter.h                        |  4 +--
 .../geos/operation/overlayng/EdgeNodingBuilder.h   |  2 +-
 include/geos/operation/union/OverlapUnion.h        |  8 ++---
 include/geos/shape/fractal/HilbertCode.h           |  2 +-
 .../geos/triangulate/quadedge/QuadEdgeQuartet.h    |  2 +-
 .../triangulate/quadedge/QuadEdgeSubdivision.h     |  5 +--
 .../geos/triangulate/quadedge/TriangleVisitor.h    |  2 +-
 src/index/quadtree/Quadtree.cpp                    |  2 +-
 src/io/WKTWriter.cpp                               | 10 +++---
 src/noding/OrientedCoordinateArray.cpp             | 10 +++---
 .../intersection/RectangleIntersection.cpp         | 39 ++++++++++++----------
 src/operation/overlay/ElevationMatrix.cpp          |  8 ++---
 src/operation/overlayng/InputGeometry.cpp          |  4 +--
 src/operation/polygonize/EdgeRing.cpp              |  2 +-
 src/operation/predicate/RectangleIntersects.cpp    |  3 +-
 src/operation/union/OverlapUnion.cpp               | 16 ++++-----
 src/operation/valid/RepeatedPointRemover.cpp       |  2 +-
 src/shape/fractal/HilbertCode.cpp                  |  2 +-
 src/simplify/TopologyPreservingSimplifier.cpp      |  2 +-
 src/triangulate/quadedge/QuadEdgeSubdivision.cpp   | 20 +++++------
 src/util/GeometricShapeFactory.cpp                 |  8 ++---
 src/util/Profiler.cpp                              |  2 +-
 .../unit/algorithm/RobustLineIntersectionTest.cpp  |  6 ++--
 tests/unit/capi/GEOSGeom_createCollectionTest.cpp  |  4 +--
 tests/unit/capi/GEOSGeom_createPolygonTest.cpp     |  2 +-
 tests/unit/edgegraph/EdgeGraphTest.cpp             |  2 +-
 tests/unit/geom/GeometryComponentFilterTest.cpp    |  4 +--
 tests/unit/geom/GeometryFilterTest.cpp             |  6 ++--
 tests/unit/noding/BasicSegmentStringTest.cpp       |  6 ++--
 tests/unit/noding/SegmentNodeTest.cpp              |  6 ++--
 tests/unit/precision/CommonBitsTest.cpp            |  4 +--
 tests/unit/shape/fractal/MortonCodeTest.cpp        |  8 ++---
 35 files changed, 106 insertions(+), 103 deletions(-)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list