[geos-commits] [SCM] GEOS branch master updated. 4466ee0e4e85f21ef362098f0d61db4222b831b7

git at osgeo.org git at osgeo.org
Fri Dec 18 18:46:23 PST 2020


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  4466ee0e4e85f21ef362098f0d61db4222b831b7 (commit)
       via  929bbc425c0acb66e69c906c83c6310d1c146275 (commit)
       via  445ac910bd989af718decdc0b87dc920cb0f8863 (commit)
       via  03767e5c69c25155d96ebbb12cd9709abeb22d10 (commit)
      from  ba7a93fa8ebf5b083a96b80958843e7ae820a9b4 (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 4466ee0e4e85f21ef362098f0d61db4222b831b7
Author: Even Rouault <even.rouault at spatialys.com>
Date:   Sat Dec 19 01:59:34 2020 +0100

    Avoid shadowing of member variable pm

diff --git a/tests/unit/io/WKTWriterTest.cpp b/tests/unit/io/WKTWriterTest.cpp
index 1718fa5..3231cb5 100644
--- a/tests/unit/io/WKTWriterTest.cpp
+++ b/tests/unit/io/WKTWriterTest.cpp
@@ -195,8 +195,8 @@ void object::test<7>
     using geos::geom::CoordinateArraySequence;
     using geos::geom::Point;
 
-    PrecisionModel pm;
-    auto factory_ = GeometryFactory::create(&pm);
+    PrecisionModel pmLocal;
+    auto factory_ = GeometryFactory::create(&pmLocal);
     CoordinateArraySequence* coords = new CoordinateArraySequence();
     ensure(coords != nullptr);
 

commit 929bbc425c0acb66e69c906c83c6310d1c146275
Author: Even Rouault <even.rouault at spatialys.com>
Date:   Sat Dec 19 01:59:16 2020 +0100

    Fix wrong use of variable assingment instead of equality comparison

diff --git a/tests/unit/index/strtree/SimpleSTRtreeTest.cpp b/tests/unit/index/strtree/SimpleSTRtreeTest.cpp
index 67735d6..380785f 100644
--- a/tests/unit/index/strtree/SimpleSTRtreeTest.cpp
+++ b/tests/unit/index/strtree/SimpleSTRtreeTest.cpp
@@ -134,23 +134,23 @@ void object::test<3>
         t.insert(g.get());
     }
 
-    std::size_t leaf_before = t.getRoot()->getNumLeafNodes();
+    const std::size_t leaf_before = t.getRoot()->getNumLeafNodes();
     // std::cout << "leaf_before " << leaf_before << std::endl;
-    std::size_t all_before = t.getRoot()->getNumNodes();
+    const std::size_t all_before = t.getRoot()->getNumNodes();
     // std::cout << "all_before " << all_before << std::endl;
-    ensure(leaf_before = 4u);
-    ensure(all_before  = 5u);
+    ensure_equals(leaf_before, 4u);
+    ensure_equals(all_before, 5u);
 
     // std::cout << t << std::endl;
 
     t.remove(geoms[3]->getEnvelopeInternal(), geoms[3].get());
 
-    std::size_t leaf_after = t.getRoot()->getNumLeafNodes();
+    const std::size_t leaf_after = t.getRoot()->getNumLeafNodes();
     // std::cout << "leaf_after " << leaf_after << std::endl;
-    std::size_t all_after = t.getRoot()->getNumNodes();
+    const std::size_t all_after = t.getRoot()->getNumNodes();
     // std::cout << "all_after " << all_after << std::endl;
-    ensure(leaf_after = 3u);
-    ensure(all_after  = 4u);
+    ensure_equals(leaf_after, 3u);
+    ensure_equals(all_after, 4u);
 }
 
 

commit 445ac910bd989af718decdc0b87dc920cb0f8863
Author: Even Rouault <even.rouault at spatialys.com>
Date:   Sat Dec 19 01:58:44 2020 +0100

    Fix warnings about implicit int->uint8_t casts

diff --git a/capi/geos_ts_c.cpp b/capi/geos_ts_c.cpp
index 0aeda7f..c823bfe 100644
--- a/capi/geos_ts_c.cpp
+++ b/capi/geos_ts_c.cpp
@@ -177,7 +177,7 @@ typedef struct GEOSContextHandle_HS {
     GEOSMessageHandler errorMessageOld;
     GEOSMessageHandler_r errorMessageNew;
     void* errorData;
-    int WKBOutputDims;
+    uint8_t WKBOutputDims;
     int WKBByteOrder;
     int initialized;
 
@@ -2108,7 +2108,7 @@ extern "C" {
             }
 
             const int olddims = handle->WKBOutputDims;
-            handle->WKBOutputDims = newdims;
+            handle->WKBOutputDims = static_cast<uint8_t>(newdims);
 
             return olddims;
         });
@@ -2649,7 +2649,7 @@ extern "C" {
     GEOSWKTWriter_setOutputDimension_r(GEOSContextHandle_t extHandle, WKTWriter* writer, int dim)
     {
         execute(extHandle, [&]() {
-            writer->setOutputDimension(dim);
+            writer->setOutputDimension(static_cast<uint8_t>(dim));
         });
     }
 
@@ -2784,7 +2784,7 @@ extern "C" {
     GEOSWKBWriter_setOutputDimension_r(GEOSContextHandle_t extHandle, GEOSWKBWriter* writer, int newDimension)
     {
         execute(extHandle, [&]() {
-            writer->setOutputDimension(newDimension);
+            writer->setOutputDimension(static_cast<uint8_t>(newDimension));
         });
     }
 

commit 03767e5c69c25155d96ebbb12cd9709abeb22d10
Author: Even Rouault <even.rouault at spatialys.com>
Date:   Sat Dec 19 01:58:23 2020 +0100

    Fix warnings about signed vs unsigned comparisons

diff --git a/benchmarks/algorithm/UnaryUnionSegmentsPerfTest.cpp b/benchmarks/algorithm/UnaryUnionSegmentsPerfTest.cpp
index 46929ee..b3c6a22 100644
--- a/benchmarks/algorithm/UnaryUnionSegmentsPerfTest.cpp
+++ b/benchmarks/algorithm/UnaryUnionSegmentsPerfTest.cpp
@@ -65,7 +65,7 @@ int main(int argc, char** argv) {
     auto num_lines = std::atol(argv[1]);
     auto num_reps = argc > 2 ? std::atol(argv[2]) : 1;
 
-    for (std::size_t i = 0; i < num_reps; i++) {
+    for (decltype(num_reps) i = 0; i < num_reps; i++) {
         tester.test(num_lines);
     }
 }
diff --git a/src/util/GeometricShapeFactory.cpp b/src/util/GeometricShapeFactory.cpp
index af15880..6ac97dc 100644
--- a/src/util/GeometricShapeFactory.cpp
+++ b/src/util/GeometricShapeFactory.cpp
@@ -84,7 +84,7 @@ GeometricShapeFactory::setHeight(double height)
 std::unique_ptr<Polygon>
 GeometricShapeFactory::createRectangle()
 {
-    int i;
+    uint32_t i;
     int ipt = 0;
     uint32_t nSide = nPts / 4;
     if(nSide < 1) {
@@ -136,7 +136,7 @@ GeometricShapeFactory::createCircle()
 
     std::vector<Coordinate> pts(nPts + 1);
     int iPt = 0;
-    for(int i = 0; i < nPts; i++) {
+    for(uint32_t i = 0; i < nPts; i++) {
         double ang = i * (2 * 3.14159265358979 / nPts);
         double x = xRadius * cos(ang) + centreX;
         double y = yRadius * sin(ang) + centreY;
@@ -168,7 +168,7 @@ GeometricShapeFactory::createArc(double startAng, double angExtent)
 
     std::vector<Coordinate> pts(nPts);
     int iPt = 0;
-    for(int i = 0; i < nPts; i++) {
+    for(uint32_t i = 0; i < nPts; i++) {
         double ang = startAng + i * angInc;
         double x = xRadius * cos(ang) + centreX;
         double y = yRadius * sin(ang) + centreY;
@@ -199,7 +199,7 @@ GeometricShapeFactory::createArcPolygon(double startAng, double angExtent)
     std::vector<Coordinate> pts(nPts + 2);
     int iPt = 0;
     pts[iPt++] = coord(centreX, centreY);
-    for(int i = 0; i < nPts; i++) {
+    for(uint32_t i = 0; i < nPts; i++) {
         double ang = startAng + i * angInc;
         double x = xRadius * cos(ang) + centreX;
         double y = yRadius * sin(ang) + centreY;
diff --git a/tests/bigtest/GeometryTestFactory.cpp b/tests/bigtest/GeometryTestFactory.cpp
index 56bccf0..997426d 100644
--- a/tests/bigtest/GeometryTestFactory.cpp
+++ b/tests/bigtest/GeometryTestFactory.cpp
@@ -75,7 +75,7 @@ GeometryTestFactory::createCircle(double basex, double basey, double size, uint3
     CoordinateArraySequence* pts = new CoordinateArraySequence(nPts + 1);
     double len = size / 2.0;
 
-    for(int i = 0; i < nPts; i++) {
+    for(uint32_t i = 0; i < nPts; i++) {
         double ang = i * (2 * PI / nPts);
         double x = len * cos(ang) + basex;
         double y = len * sin(ang) + basey;
diff --git a/tests/unit/capi/GEOSSTRtreeTest.cpp b/tests/unit/capi/GEOSSTRtreeTest.cpp
index 8a3253e..5d9e757 100644
--- a/tests/unit/capi/GEOSSTRtreeTest.cpp
+++ b/tests/unit/capi/GEOSSTRtreeTest.cpp
@@ -274,7 +274,7 @@ void object::test<8>
 
     typedef std::vector<int*> IList;
     IList items;
-    ensure_equals(items.size(), 0);
+    ensure_equals(items.size(), 0U);
     GEOSSTRtree_query(
         tree,
         q,
@@ -284,7 +284,7 @@ void object::test<8>
         },
         &items);
 
-    ensure_equals(items.size(), 1);
+    ensure_equals(items.size(), 1U);
 
     ensure_equals(*(items[0]), payload);
 
@@ -309,7 +309,7 @@ void object::test<9>
 
     typedef std::vector<int*> IList;
     IList items;
-    ensure_equals(items.size(), 0);
+    ensure_equals(items.size(), 0U);
     GEOSSTRtree_query(
         tree,
         q,
@@ -319,7 +319,7 @@ void object::test<9>
         },
         &items);
 
-    ensure_equals(items.size(), 1);
+    ensure_equals(items.size(), 1U);
 
     ensure_equals(items[0], (void*)0);
 

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

Summary of changes:
 benchmarks/algorithm/UnaryUnionSegmentsPerfTest.cpp |  2 +-
 capi/geos_ts_c.cpp                                  |  8 ++++----
 src/util/GeometricShapeFactory.cpp                  |  8 ++++----
 tests/bigtest/GeometryTestFactory.cpp               |  2 +-
 tests/unit/capi/GEOSSTRtreeTest.cpp                 |  8 ++++----
 tests/unit/index/strtree/SimpleSTRtreeTest.cpp      | 16 ++++++++--------
 tests/unit/io/WKTWriterTest.cpp                     |  4 ++--
 7 files changed, 24 insertions(+), 24 deletions(-)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list