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

git at osgeo.org git at osgeo.org
Mon Mar 2 10:23:58 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  e37d04f8384b2e1fee83d64c6221adc3749a404a (commit)
       via  4ca6d47ae271c5b38969fb60158f273a3e36700d (commit)
       via  dcfa3c3a6766172ab42db52517fab35fa0806d85 (commit)
       via  fc6dcdddb0426aefe8a72df44988d99e873f40a7 (commit)
       via  b1439de6bbeaa4c1a5458fb2f2c8e7bc2546ba66 (commit)
      from  7ad488a7334552dae774d1130559c46a921efc02 (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 e37d04f8384b2e1fee83d64c6221adc3749a404a
Author: Dan Baston <dbaston at gmail.com>
Date:   Mon Mar 2 13:20:28 2020 -0500

    Add test showing LineString vtable creation
    
    References https://github.com/libgeos/geos/issues/285
    References #1016

diff --git a/tests/unit/geom/LineStringTest.cpp b/tests/unit/geom/LineStringTest.cpp
index a31ef10..d7f0bb8 100644
--- a/tests/unit/geom/LineStringTest.cpp
+++ b/tests/unit/geom/LineStringTest.cpp
@@ -512,5 +512,20 @@ void object::test<28>
     ensure(geo->isDimensionStrict(geos::geom::Dimension::L));
     ensure(!geo->isDimensionStrict(geos::geom::Dimension::A));
 }
+
+// test dynamic_cast for LineString (shows that vtable is created)
+// https://github.com/libgeos/geos/issues/285
+template<>
+template<>
+void object::test<29>
+()
+{
+    std::unique_ptr<geos::geom::LineString> a = geos::geom::GeometryFactory::getDefaultInstance()->createLineString();
+    geos::geom::Geometry *b = a.get(); // ok
+    geos::geom::LineString *c = dynamic_cast<geos::geom::LineString *>(b);
+
+    ensure(c != nullptr);
+}
+
 } // namespace tut
 

commit 4ca6d47ae271c5b38969fb60158f273a3e36700d
Author: Dan Baston <dbaston at gmail.com>
Date:   Mon Mar 2 13:14:50 2020 -0500

    Fix comment typos

diff --git a/tests/unit/geom/LineStringTest.cpp b/tests/unit/geom/LineStringTest.cpp
index 2adffdb..a31ef10 100644
--- a/tests/unit/geom/LineStringTest.cpp
+++ b/tests/unit/geom/LineStringTest.cpp
@@ -69,7 +69,7 @@ void object::test<1>
 {
     using geos::geom::Coordinate;
 
-    // Empty sequence of coordiantes
+    // Empty sequence of coordinates
     CoordArrayPtr pseq = new geos::geom::CoordinateArraySequence();
     ensure("sequence is null pointer.", pseq != nullptr);
 
@@ -81,7 +81,7 @@ void object::test<1>
     ensure(ls->isValid());
 }
 
-// Test of non-tempty LineString created with user's constructor
+// Test of non-empty LineString created with user's constructor
 template<>
 template<>
 void object::test<2>
@@ -89,7 +89,7 @@ void object::test<2>
 {
     using geos::geom::Coordinate;
 
-    // Non-empty sequence of coordiantes
+    // Non-empty sequence of coordinates
     const size_t size3 = 3;
 
     CoordArrayPtr pseq = new geos::geom::CoordinateArraySequence();
@@ -101,7 +101,7 @@ void object::test<2>
 
     ensure_equals(pseq->size(), size3);
 
-    // Create non-empty linstring instance
+    // Create non-empty LineString instance
     LineStringAutoPtr ls(factory_->createLineString(pseq));
 
     ensure(!ls->isEmpty());
@@ -139,7 +139,7 @@ template<>
 void object::test<3>
 ()
 {
-    // Single-element sequence of coordiantes
+    // Single-element sequence of coordinates
     CoordArrayPtr pseq = nullptr;
     try {
         pseq = new geos::geom::CoordinateArraySequence();
@@ -147,7 +147,7 @@ void object::test<3>
         pseq->add(geos::geom::Coordinate(0, 0, 0));
         ensure_equals(pseq->size(), 1u);
 
-        // Create incomplete linstring
+        // Create incomplete LineString
         LineStringAutoPtr ls(factory_->createLineString(pseq));
         fail("IllegalArgumentException expected.");
     }
@@ -169,7 +169,7 @@ void object::test<4>
 {
     using geos::geom::Coordinate;
 
-    // Non-empty sequence of coordiantes
+    // Non-empty sequence of coordinates
     const size_t size = 3;
 
     CoordArrayPtr pseq = new geos::geom::CoordinateArraySequence();
@@ -181,7 +181,7 @@ void object::test<4>
 
     ensure_equals(pseq->size(), size);
 
-    // Create examplar of linstring instance
+    // Create example of LineString instance
     LineStringAutoPtr examplar(factory_->createLineString(pseq));
 
     // Create copy

commit dcfa3c3a6766172ab42db52517fab35fa0806d85
Merge: b1439de fc6dcdd
Author: Dan Baston <dbaston at gmail.com>
Date:   Mon Mar 2 13:11:46 2020 -0500

    Merge remote-tracking branch 'rouault/add_deleted_copyconstructors'


commit fc6dcdddb0426aefe8a72df44988d99e873f40a7
Author: Even Rouault <even.rouault at spatialys.com>
Date:   Fri Feb 28 14:53:52 2020 +0100

    include/: add deleted copy constructors and assignment operators
    
    cppcheck spots classes that have pointer member variables, but lack an
    explicit copy constructor and assignment operator. The default behaviour
    of bitwise copy is dangerous, so add explicit '= delete'

diff --git a/include/geos/geomgraph/PlanarGraph.h b/include/geos/geomgraph/PlanarGraph.h
index f22555b..374b7fa 100644
--- a/include/geos/geomgraph/PlanarGraph.h
+++ b/include/geos/geomgraph/PlanarGraph.h
@@ -194,6 +194,9 @@ private:
                               const geom::Coordinate& p1,
                               const geom::Coordinate& ep0,
                               const geom::Coordinate& ep1);
+
+    PlanarGraph(const PlanarGraph&) = delete;
+    PlanarGraph& operator=(const PlanarGraph&) = delete;
 };
 
 
diff --git a/include/geos/index/bintree/Bintree.h b/include/geos/index/bintree/Bintree.h
index 3f776d2..f9e4321 100644
--- a/include/geos/index/bintree/Bintree.h
+++ b/include/geos/index/bintree/Bintree.h
@@ -115,6 +115,9 @@ private:
     double minExtent;
 
     void collectStats(Interval* interval);
+
+    Bintree(const Bintree&) = delete;
+    Bintree& operator=(const Bintree&) = delete;
 };
 
 } // namespace geos::index::bintree
diff --git a/include/geos/index/bintree/NodeBase.h b/include/geos/index/bintree/NodeBase.h
index b4f0d2b..e47dddb 100644
--- a/include/geos/index/bintree/NodeBase.h
+++ b/include/geos/index/bintree/NodeBase.h
@@ -70,6 +70,12 @@ protected:
     Node* subnode[2];
 
     virtual bool isSearchMatch(Interval* interval) = 0;
+
+private:
+
+    NodeBase(const NodeBase&) = delete;
+    NodeBase& operator=(const NodeBase&) = delete;
+
 };
 
 } // namespace geos::index::bintree
diff --git a/include/geos/index/strtree/AbstractSTRtree.h b/include/geos/index/strtree/AbstractSTRtree.h
index b2e10bc..6f0f18c 100644
--- a/include/geos/index/strtree/AbstractSTRtree.h
+++ b/include/geos/index/strtree/AbstractSTRtree.h
@@ -163,6 +163,9 @@ private:
 
     ItemsList* itemsTree(AbstractNode* node);
 
+    AbstractSTRtree(const AbstractSTRtree&) = delete;
+    AbstractSTRtree& operator=(const AbstractSTRtree&) = delete;
+
 protected:
 
     /** \brief
diff --git a/include/geos/operation/buffer/OffsetSegmentString.h b/include/geos/operation/buffer/OffsetSegmentString.h
index b474703..2da1091 100644
--- a/include/geos/operation/buffer/OffsetSegmentString.h
+++ b/include/geos/operation/buffer/OffsetSegmentString.h
@@ -77,6 +77,8 @@ private:
         return false;
     }
 
+    OffsetSegmentString(const OffsetSegmentString&) = delete;
+    OffsetSegmentString& operator=(const OffsetSegmentString&) = delete;
 
 public:
 
diff --git a/include/geos/operation/overlay/EdgeSetNoder.h b/include/geos/operation/overlay/EdgeSetNoder.h
index f61438c..b3f820c 100644
--- a/include/geos/operation/overlay/EdgeSetNoder.h
+++ b/include/geos/operation/overlay/EdgeSetNoder.h
@@ -48,6 +48,10 @@ class GEOS_DLL EdgeSetNoder {
 private:
     algorithm::LineIntersector* li;
     std::vector<geomgraph::Edge*>* inputEdges;
+
+    EdgeSetNoder(const EdgeSetNoder&) = delete;
+    EdgeSetNoder& operator=(const EdgeSetNoder&) = delete;
+
 public:
     EdgeSetNoder(algorithm::LineIntersector* newLi)
         :
diff --git a/include/geos/operation/overlay/PointBuilder.h b/include/geos/operation/overlay/PointBuilder.h
index 86a7765..a1867bb 100644
--- a/include/geos/operation/overlay/PointBuilder.h
+++ b/include/geos/operation/overlay/PointBuilder.h
@@ -78,6 +78,9 @@ private:
     /// it from build()
     std::vector<geom::Point*>* resultPointList;
 
+    PointBuilder(const PointBuilder&) = delete;
+    PointBuilder& operator=(const PointBuilder&) = delete;
+
 public:
 
     PointBuilder(OverlayOp* newOp,
diff --git a/include/geos/operation/relate/RelateNodeGraph.h b/include/geos/operation/relate/RelateNodeGraph.h
index 7f642ee..a6b92b7 100644
--- a/include/geos/operation/relate/RelateNodeGraph.h
+++ b/include/geos/operation/relate/RelateNodeGraph.h
@@ -87,6 +87,10 @@ public:
 private:
 
     geomgraph::NodeMap* nodes;
+
+    RelateNodeGraph(const RelateNodeGraph&) = delete;
+    RelateNodeGraph& operator=(const RelateNodeGraph&) = delete;
+
 };
 
 
diff --git a/include/geos/operation/valid/SweeplineNestedRingTester.h b/include/geos/operation/valid/SweeplineNestedRingTester.h
index 8f9ac2d..b540dd7 100644
--- a/include/geos/operation/valid/SweeplineNestedRingTester.h
+++ b/include/geos/operation/valid/SweeplineNestedRingTester.h
@@ -69,6 +69,9 @@ private:
     geom::Coordinate* nestedPt;
     void buildIndex();
 
+    SweeplineNestedRingTester(const SweeplineNestedRingTester&) = delete;
+    SweeplineNestedRingTester& operator=(const SweeplineNestedRingTester&) = delete;
+
 public:
 
     SweeplineNestedRingTester(geomgraph::GeometryGraph* newGraph)
diff --git a/include/geos/planargraph/Node.h b/include/geos/planargraph/Node.h
index 721de4c..e29e4f8 100644
--- a/include/geos/planargraph/Node.h
+++ b/include/geos/planargraph/Node.h
@@ -143,6 +143,11 @@ public:
         return deStar->getIndex(edge);
     }
 
+private:
+
+    Node(const Node&) = delete;
+    Node& operator=(const Node&) = delete;
+
 };
 
 /// Print a Node
diff --git a/include/geos/precision/CommonBitsRemover.h b/include/geos/precision/CommonBitsRemover.h
index a493b93..0ffa086 100644
--- a/include/geos/precision/CommonBitsRemover.h
+++ b/include/geos/precision/CommonBitsRemover.h
@@ -45,6 +45,9 @@ private:
 
     CommonCoordinateFilter* ccFilter;
 
+    CommonBitsRemover(const CommonBitsRemover&) = delete;
+    CommonBitsRemover& operator=(const CommonBitsRemover&) = delete;
+
 public:
 
     CommonBitsRemover();

commit b1439de6bbeaa4c1a5458fb2f2c8e7bc2546ba66
Author: Evgen Bodunov <evgen at getyourmap.com>
Date:   Thu Feb 27 17:59:40 2020 +0300

    Fixed https://trac.osgeo.org/geos/ticket/894 and https://github.com/libgeos/geos/issues/285
    
    To have a vtable we should have explicit definition of key function. Details: https://lld.llvm.org/missingkeyfunction.html#missing-key-function

diff --git a/include/geos/geom/CoordinateArraySequenceFactory.inl b/include/geos/geom/CoordinateArraySequenceFactory.inl
index 761fdc6..e36a313 100644
--- a/include/geos/geom/CoordinateArraySequenceFactory.inl
+++ b/include/geos/geom/CoordinateArraySequenceFactory.inl
@@ -23,14 +23,6 @@ namespace geos {
 namespace geom { // geos::geom
 
 INLINE std::unique_ptr<CoordinateSequence>
-CoordinateArraySequenceFactory::create() const
-{
-    return std::unique_ptr<CoordinateSequence>(
-            new CoordinateArraySequence(
-                    reinterpret_cast<std::vector<Coordinate>*>(0), 0));
-}
-
-INLINE std::unique_ptr<CoordinateSequence>
 CoordinateArraySequenceFactory::create(std::vector<Coordinate>* coords,
                                        size_t dimension) const
 {
diff --git a/include/geos/geom/LineString.h b/include/geos/geom/LineString.h
index 6ed0348..0316d62 100644
--- a/include/geos/geom/LineString.h
+++ b/include/geos/geom/LineString.h
@@ -74,7 +74,7 @@ public:
     /// A vector of const LineString pointers
     typedef std::vector<const LineString*> ConstVect;
 
-    ~LineString() override = default;
+    ~LineString() override;
 
     /**
      * \brief
diff --git a/src/geom/CoordinateArraySequenceFactory.cpp b/src/geom/CoordinateArraySequenceFactory.cpp
index decd6bd..ab0a6e8 100644
--- a/src/geom/CoordinateArraySequenceFactory.cpp
+++ b/src/geom/CoordinateArraySequenceFactory.cpp
@@ -25,6 +25,14 @@ namespace geom { // geos::geom
 
 static CoordinateArraySequenceFactory defaultCoordinateSequenceFactory;
 
+std::unique_ptr<CoordinateSequence>
+CoordinateArraySequenceFactory::create() const
+{
+    return std::unique_ptr<CoordinateSequence>(
+            new CoordinateArraySequence(
+                    reinterpret_cast<std::vector<Coordinate>*>(0), 0));
+}
+
 const CoordinateSequenceFactory*
 CoordinateArraySequenceFactory::instance()
 {
diff --git a/src/geom/LineString.cpp b/src/geom/LineString.cpp
index cfcbb2b..65f86a0 100644
--- a/src/geom/LineString.cpp
+++ b/src/geom/LineString.cpp
@@ -45,6 +45,8 @@ using namespace geos::algorithm;
 namespace geos {
 namespace geom { // geos::geom
 
+LineString::~LineString(){};
+
 /*protected*/
 LineString::LineString(const LineString& ls)
     :
diff --git a/tests/unit/geom/CoordinateArraySequenceFactoryTest.cpp b/tests/unit/geom/CoordinateArraySequenceFactoryTest.cpp
index caea683..a69413c 100644
--- a/tests/unit/geom/CoordinateArraySequenceFactoryTest.cpp
+++ b/tests/unit/geom/CoordinateArraySequenceFactoryTest.cpp
@@ -52,10 +52,8 @@ void object::test<1>
         ensure(nullptr != derived);
         ensure(typeid(derived).name(), typeid(derived) == typeid(CoordinateArrayFactoryCPtr));
     }
-    catch(std::exception& /* e */) {
-        /** ignore failure.  TODO figure out why this fails on BSD/Clang
-        *  https://trac.osgeo.org/geos/ticket/894 and then put back**/
-        //fail( e.what() );
+    catch(std::exception& e) {
+        fail( e.what() );
     }
 }
 

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

Summary of changes:
 .../geos/geom/CoordinateArraySequenceFactory.inl   |  8 ------
 include/geos/geom/LineString.h                     |  2 +-
 include/geos/geomgraph/PlanarGraph.h               |  3 +++
 include/geos/index/bintree/Bintree.h               |  3 +++
 include/geos/index/bintree/NodeBase.h              |  6 +++++
 include/geos/index/strtree/AbstractSTRtree.h       |  3 +++
 .../geos/operation/buffer/OffsetSegmentString.h    |  2 ++
 include/geos/operation/overlay/EdgeSetNoder.h      |  4 +++
 include/geos/operation/overlay/PointBuilder.h      |  3 +++
 include/geos/operation/relate/RelateNodeGraph.h    |  4 +++
 .../operation/valid/SweeplineNestedRingTester.h    |  3 +++
 include/geos/planargraph/Node.h                    |  5 ++++
 include/geos/precision/CommonBitsRemover.h         |  3 +++
 src/geom/CoordinateArraySequenceFactory.cpp        |  8 ++++++
 src/geom/LineString.cpp                            |  2 ++
 .../geom/CoordinateArraySequenceFactoryTest.cpp    |  6 ++---
 tests/unit/geom/LineStringTest.cpp                 | 31 ++++++++++++++++------
 17 files changed, 75 insertions(+), 21 deletions(-)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list