[Git][debian-gis-team/geos][upstream] New upstream version 3.9.0

Bas Couwenberg gitlab at salsa.debian.org
Thu Dec 10 05:19:00 GMT 2020



Bas Couwenberg pushed to branch upstream at Debian GIS Project / geos


Commits:
cf4450f6 by Bas Couwenberg at 2020-12-10T05:29:12+01:00
New upstream version 3.9.0
- - - - -


30 changed files:

- CMakeLists.txt
- ChangeLog
- NEWS
- Version.txt
- benchmarks/algorithm/UnaryUnionSegmentsPerfTest.cpp
- benchmarks/capi/GEOSPreparedContainsPerfTest.cpp
- configure
- configure.ac
- doc/Doxyfile
- include/geos/algorithm/LineIntersector.h
- include/geos/geomgraph/EdgeEndStar.h
- include/geos/geomgraph/Label.h
- include/geos/geomgraph/Label.inl
- include/geos/geomgraph/TopologyLocation.h
- include/geos/geomgraph/TopologyLocation.inl
- include/geos/precision/GeometryPrecisionReducer.h
- include/geos/util/GeometricShapeFactory.h
- src/algorithm/LineIntersector.cpp
- src/algorithm/Orientation.cpp
- src/geom/Polygon.cpp
- src/geomgraph/Depth.cpp
- src/geomgraph/DirectedEdge.cpp
- src/geomgraph/DirectedEdgeStar.cpp
- src/geomgraph/EdgeEndStar.cpp
- src/precision/GeometryPrecisionReducer.cpp
- src/util/GeometricShapeFactory.cpp
- tests/bigtest/GeometryTestFactory.cpp
- tests/bigtest/bigtest.h
- tests/unit/util/NodingTestUtil.cpp
- tests/unit/utility.h


Changes:

=====================================
CMakeLists.txt
=====================================
@@ -153,6 +153,21 @@ set(CMAKE_CXX_EXTENSIONS OFF)
 add_library(geos_cxx_flags INTERFACE)
 target_compile_features(geos_cxx_flags INTERFACE cxx_std_11)
 
+#-----------------------------------------------------------------------------
+# Add flags to prevent 'fused multiply-add' operations on targets (ARM64)
+# that allow it, as it breaks calculations in DD.cpp. 
+# TODO: Replace DD calculations with 'long float' where target supports
+# true long float, and remove other cases where FMA causes regression
+# failures.
+#   https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98207
+#-----------------------------------------------------------------------------
+
+target_compile_options(geos_cxx_flags INTERFACE 
+	"$<$<CXX_COMPILER_ID:Clang>:-ffp-contract=off>"
+	"$<$<CXX_COMPILER_ID:GNU>:-ffp-contract=off>"
+	"$<$<CXX_COMPILER_ID:MSVC>:/fp:precise>"
+	)
+	
 #-----------------------------------------------------------------------------
 # Target geos_cxx_flags: common compilation flags
 #-----------------------------------------------------------------------------


=====================================
ChangeLog
=====================================
@@ -1,3 +1,54 @@
+2020-12-09  Paul Ramsey <pramsey at cleverelephant.ca>
+
+	* tests/unit/util/NodingTestUtil.cpp: remove leak in noding test?
+
+2020-12-09  Paul Ramsey <pramsey at cleverelephant.ca>
+
+	* include/geos/precision/GeometryPrecisionReducer.h,
+	src/precision/GeometryPrecisionReducer.cpp: Initialize
+	useAreaReducer. Closes #1067
+
+2020-12-08  EC2 Default User <ec2-user at ip-172-31-55-124.us-west-2.compute.internal>
+
+	* CMakeLists.txt, configure.ac: Add fp-contract=off flag to builds
+	to avoid precision mistakes in the double-double code
+
+2020-12-08  Paul Ramsey <pramsey at cleverelephant.ca>
+
+	* include/geos/geomgraph/EdgeEndStar.h,
+	include/geos/util/GeometricShapeFactory.h,
+	src/algorithm/Orientation.cpp, src/geom/Polygon.cpp,
+	src/geomgraph/Depth.cpp, src/geomgraph/DirectedEdge.cpp,
+	src/geomgraph/DirectedEdgeStar.cpp, src/geomgraph/EdgeEndStar.cpp,
+	src/util/GeometricShapeFactory.cpp: Quiet compiler warnings
+
+2020-12-08  Paul Ramsey <pramsey at cleverelephant.ca>
+
+	* benchmarks/algorithm/UnaryUnionSegmentsPerfTest.cpp,
+	benchmarks/capi/GEOSPreparedContainsPerfTest.cpp,
+	tests/bigtest/GeometryTestFactory.cpp, tests/bigtest/bigtest.h: 
+	Quite compiler warnings
+
+2020-12-08  Paul Ramsey <pramsey at cleverelephant.ca>
+
+	* include/geos/geomgraph/Label.h, include/geos/geomgraph/Label.inl,
+	include/geos/geomgraph/TopologyLocation.h,
+	include/geos/geomgraph/TopologyLocation.inl: Remove more CI warnings
+
+
+2020-12-08  Paul Ramsey <pramsey at cleverelephant.ca>
+
+	* include/geos/algorithm/LineIntersector.h,
+	include/geos/geomgraph/Label.h, include/geos/geomgraph/Label.inl,
+	include/geos/geomgraph/TopologyLocation.h,
+	include/geos/geomgraph/TopologyLocation.inl,
+	src/algorithm/LineIntersector.cpp, src/algorithm/Orientation.cpp,
+	tests/unit/utility.h: Quiet some compiler warnings
+
+2020-12-03  Paul Ramsey <pramsey at cleverelephant.ca>
+
+	* Version.txt: Revert partial revision edit in version.txt
+
 2020-12-02  Paul Ramsey <pramsey at cleverelephant.ca>
 
 	* Version.txt: bump version for beta2


=====================================
NEWS
=====================================
@@ -1,11 +1,13 @@
-Changes in 3.9.0beta1
-2020-11-27
+Changes in 3.9.0
+2020-12-09
 
 - New things:
+  - OverlayNG engine from JTS, now the default (Martin Davis, Paul Ramsey)
   - MaximumInscribedCircle and LargestEmptyCircle (JTS-530, Paul Ramsey)
-  - CAPI: Fixed precision overlay operations (Sandro Santilli, Paul Ramsey)
+  - CAPI: Fixed precision overlay operations (Sandro Santilli)
   - CAPI: GEOSPreparedNearestPoints (#1007, Sandro Santilli)
   - CAPI: GEOSPreparedDistance (#1066, Sandro Santilli)
+  - CAPI: GEOSGeom_setPrecision uses OverlayNG (Paul Ramsey)
   - SimpleSTRTree spatial index implementation (Paul Ramsey)
   - Add support for pkg-config for GEOS C API (#1073, Mike Taves)
 


=====================================
Version.txt
=====================================
@@ -5,7 +5,7 @@ GEOS_VERSION_MINOR=9
 GEOS_VERSION_PATCH=0
 
 # OPTIONS: "", "dev", "rc1" etc.
-GEOS_PATCH_WORD=beta2
+GEOS_PATCH_WORD=
 
 # GEOS CAPI Versions
 #
@@ -14,9 +14,9 @@ GEOS_PATCH_WORD=beta2
 # added, removed or changed.
 # Increase the age value only if the changes made to the ABI
 # are backward compatible.
-CAPI_INTERFACE_CURRENT=15
-CAPI_INTERFACE_REVISION=1
-CAPI_INTERFACE_AGE=15
+CAPI_INTERFACE_CURRENT=17
+CAPI_INTERFACE_REVISION=2
+CAPI_INTERFACE_AGE=16
 
 # JTS Port
-JTS_PORT=1.16.0
+JTS_PORT=1.17.0


=====================================
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 (int i = 0; i < num_reps; i++) {
+    for (std::size_t i = 0; i < num_reps; i++) {
         tester.test(num_lines);
     }
-}
\ No newline at end of file
+}


=====================================
benchmarks/capi/GEOSPreparedContainsPerfTest.cpp
=====================================
@@ -87,7 +87,7 @@ int main(int argc, char** argv) {
 
     GEOSPreparedContainsPerfTest tester;
 
-    int n = std::atoi(argv[2]);
+    std::size_t n = static_cast<std::size_t>(std::atoi(argv[2]));
     std::cout << "Performing " << n << " point-in-polygon tests." << std::endl;
 
     std::string fname{argv[1]};


=====================================
configure
=====================================
@@ -18525,9 +18525,6 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 
-# Set default AM_CXXFLAGS and AM_CFLAGS
-# -pedantic: ISO does not support long long
-# we add -Wno-long-long to avoid those messages
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -pedantic" >&5
 $as_echo_n "checking if $compiler supports -pedantic... " >&6; }
 if ${dummy_cv_pedantic+:} false; then :
@@ -18661,10 +18658,7 @@ else
 fi
 
 
-# To make numerical computation more stable, we use --ffloat-store
-# on 32-bit platforms
 NUMERICFLAGS=""
-# 32-bit platforms have a 4-byte pointer
 # The cast to long int works around a bug in the HP C Compiler
 # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
 # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
@@ -18745,6 +18739,8 @@ fi
 
 fi
 
+NUMERICFLAGS="$NUMERICFLAGS -ffp-contract=off"
+
 HUSHWARNING="-DUSE_UNSTABLE_GEOS_CPP_API"
 DEFAULTFLAGS="${WARNFLAGS} ${NUMERICFLAGS} ${HUSHWARNING} ${OVERLAYNG_FLAGS}"
 


=====================================
configure.ac
=====================================
@@ -195,22 +195,33 @@ dnl to AC_LANG(CXX) or AC_LANG_PUSH(CXX)/AC_LANG_POP()
 dnl
 AC_LIBTOOL_LANG_CXX_CONFIG
 
-# Set default AM_CXXFLAGS and AM_CFLAGS
-# -pedantic: ISO does not support long long
-# we add -Wno-long-long to avoid those messages
+dnl Set default AM_CXXFLAGS and AM_CFLAGS
+dnl -pedantic: ISO does not support long long
+dnl we add -Wno-long-long to avoid those messages
 AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -pedantic], [dummy_cv_pedantic], [-pedantic], [], [WARNFLAGS="$WARNFLAGS -pedantic"], [])
 AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -Wall], [dummy_cv_wall], [-Wall], [], [WARNFLAGS="$WARNFLAGS -Wall"], [])
 AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -Wno-long-long], [dummy_cv_wno_long_long], [-Wno-long-long], [], [WARNFLAGS="$WARNFLAGS -Wno-long-long"], [])
 
-# To make numerical computation more stable, we use --ffloat-store
-# on 32-bit platforms
+dnl -----------------------------------------------------------------------------
+dnl To make numerical computation more stable, we use --ffloat-store
+dnl on 32-bit platforms
 NUMERICFLAGS=""
-# 32-bit platforms have a 4-byte pointer
+dnl 32-bit platforms have a 4-byte pointer
 AC_CHECK_SIZEOF([void *])
 if test $ac_cv_sizeof_void_p -eq 4 ; then
   AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -ffloat-store], [dummy_cv_ffloat_store], [-ffloat-store], [], [NUMERICFLAGS="$NUMERICFLAGS -ffloat-store"], [])
 fi
 
+dnl -----------------------------------------------------------------------------
+dnl Add flags to prevent 'fused multiply-add' operations on targets (ARM64)
+dnl that allow it, as it breaks calculations in math/DD.cpp.
+dnl TODO: Replace DD calculations with 'long float' where target supports
+dnl true long float, and remove other cases where FMA causes regression
+dnl failures.
+dnl     https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98207
+NUMERICFLAGS="$NUMERICFLAGS -ffp-contract=off"
+
+dnl -----------------------------------------------------------------------------
 HUSHWARNING="-DUSE_UNSTABLE_GEOS_CPP_API"
 DEFAULTFLAGS="${WARNFLAGS} ${NUMERICFLAGS} ${HUSHWARNING} ${OVERLAYNG_FLAGS}"
 


=====================================
doc/Doxyfile
=====================================
@@ -38,7 +38,7 @@ PROJECT_NAME           = GEOS
 # could be handy for archiving the generated documentation or if some version
 # control system is used.
 
-PROJECT_NUMBER         = 3.9.0beta2
+PROJECT_NUMBER         = 3.9.0
 
 # Using the PROJECT_BRIEF tag one can provide an optional one line description
 # for a project that appears at the top of each page and should give viewer a


=====================================
include/geos/algorithm/LineIntersector.h
=====================================
@@ -298,8 +298,8 @@ private:
 
     void computeIntLineIndex(size_t segmentIndex);
 
-    int computeCollinearIntersection(const geom::Coordinate& p1, const geom::Coordinate& p2,
-                                     const geom::Coordinate& q1, const geom::Coordinate& q2);
+    uint8_t computeCollinearIntersection(const geom::Coordinate& p1, const geom::Coordinate& p2,
+                                         const geom::Coordinate& q1, const geom::Coordinate& q2);
 
     /** \brief
      * This method computes the actual value of the intersection point.


=====================================
include/geos/geomgraph/EdgeEndStar.h
=====================================
@@ -123,7 +123,7 @@ public:
 
     virtual bool isAreaLabelsConsistent(const GeometryGraph& geomGraph);
 
-    virtual void propagateSideLabels(int geomIndex);
+    virtual void propagateSideLabels(uint32_t geomIndex);
     // throw(TopologyException *);
 
     //virtual int findIndex(EdgeEnd *eSearch);
@@ -150,7 +150,7 @@ protected:
 
 private:
 
-    virtual geom::Location getLocation(int geomIndex,
+    virtual geom::Location getLocation(uint32_t geomIndex,
                                        const geom::Coordinate& p,
                                        std::vector<GeometryGraph*>* geom);
 
@@ -162,7 +162,7 @@ private:
 
     virtual void computeEdgeEndLabels(const algorithm::BoundaryNodeRule&);
 
-    virtual bool checkAreaLabelsConsistent(int geomIndex);
+    virtual bool checkAreaLabelsConsistent(uint32_t geomIndex);
 
 };
 


=====================================
include/geos/geomgraph/Label.h
=====================================
@@ -81,7 +81,7 @@ public:
      * Other geometry location will be set to
      * Location::NONE.
      */
-    Label(int geomIndex, geom::Location onLoc);
+    Label(uint32_t geomIndex, geom::Location onLoc);
 
     /** \brief
      * Construct a Label with On, Left and Right locations for both Geometries.
@@ -108,21 +108,21 @@ public:
      * Initialize the locations for the other Geometry to
      * Location::NONE
      */
-    Label(int geomIndex, geom::Location onLoc, geom::Location leftLoc, geom::Location rightLoc);
+    Label(uint32_t geomIndex, geom::Location onLoc, geom::Location leftLoc, geom::Location rightLoc);
 
     void flip();
 
-    geom::Location getLocation(int geomIndex, int posIndex) const;
+    geom::Location getLocation(uint32_t geomIndex, uint32_t posIndex) const;
 
-    geom::Location getLocation(int geomIndex) const;
+    geom::Location getLocation(uint32_t geomIndex) const;
 
-    void setLocation(int geomIndex, int posIndex, geom::Location location);
+    void setLocation(uint32_t geomIndex, uint32_t posIndex, geom::Location location);
 
-    void setLocation(int geomIndex, geom::Location location);
+    void setLocation(uint32_t geomIndex, geom::Location location);
 
-    void setAllLocations(int geomIndex, geom::Location location);
+    void setAllLocations(uint32_t geomIndex, geom::Location location);
 
-    void setAllLocationsIfNull(int geomIndex, geom::Location location);
+    void setAllLocationsIfNull(uint32_t geomIndex, geom::Location location);
 
     void setAllLocationsIfNull(geom::Location location);
 
@@ -138,24 +138,24 @@ public:
 
     bool isNull() const;
 
-    bool isNull(int geomIndex) const;
+    bool isNull(uint32_t geomIndex) const;
 
-    bool isAnyNull(int geomIndex) const;
+    bool isAnyNull(uint32_t geomIndex) const;
 
     bool isArea() const;
 
-    bool isArea(int geomIndex) const;
+    bool isArea(uint32_t geomIndex) const;
 
-    bool isLine(int geomIndex) const;
+    bool isLine(uint32_t geomIndex) const;
 
-    bool isEqualOnSide(const Label& lbl, int side) const;
+    bool isEqualOnSide(const Label& lbl, uint32_t side) const;
 
-    bool allPositionsEqual(int geomIndex, geom::Location loc) const;
+    bool allPositionsEqual(uint32_t geomIndex, geom::Location loc) const;
 
     /** \brief
      * Converts one GeometryLocation to a Line location
      */
-    void toLine(int geomIndex);
+    void toLine(uint32_t geomIndex);
 
     std::string toString() const;
 


=====================================
include/geos/geomgraph/Label.inl
=====================================
@@ -34,7 +34,7 @@ INLINE Label
 Label::toLineLabel(const Label& label)
 {
     Label lineLabel(geom::Location::NONE);
-    for(int i = 0; i < 2; i++) {
+    for(uint32_t i = 0; i < 2; i++) {
         lineLabel.setLocation(i, label.getLocation(i));
     }
     return lineLabel;
@@ -49,10 +49,10 @@ Label::Label(geom::Location onLoc) :
 
 /*public*/
 INLINE
-Label::Label(int geomIndex, geom::Location onLoc) :
+Label::Label(uint32_t geomIndex, geom::Location onLoc) :
     elt{TopologyLocation(geom::Location::NONE), TopologyLocation(geom::Location::NONE)}
 {
-    assert(geomIndex >= 0 && geomIndex < 2);
+    assert(geomIndex < 2);
     elt[geomIndex].setLocation(onLoc);
 }
 
@@ -88,7 +88,7 @@ Label::operator=(const Label& l)
 
 /*public*/
 INLINE
-Label::Label(int geomIndex, geom::Location onLoc, geom::Location leftLoc, geom::Location rightLoc)
+Label::Label(uint32_t geomIndex, geom::Location onLoc, geom::Location leftLoc, geom::Location rightLoc)
 {
     elt[0] = TopologyLocation(geom::Location::NONE, geom::Location::NONE, geom::Location::NONE);
     elt[1] = TopologyLocation(geom::Location::NONE, geom::Location::NONE, geom::Location::NONE);
@@ -105,49 +105,49 @@ Label::flip()
 
 /*public*/
 INLINE geom::Location
-Label::getLocation(int geomIndex, int posIndex) const
+Label::getLocation(uint32_t geomIndex, uint32_t posIndex) const
 {
-    assert(geomIndex >= 0 && geomIndex < 2);
+    assert(geomIndex < 2);
     return elt[geomIndex].get(posIndex);
 }
 
 /*public*/
 INLINE geom::Location
-Label::getLocation(int geomIndex) const
+Label::getLocation(uint32_t geomIndex) const
 {
-    assert(geomIndex >= 0 && geomIndex < 2);
+    assert(geomIndex < 2);
     return elt[geomIndex].get(Position::ON);
 }
 
 /*public*/
 INLINE void
-Label::setLocation(int geomIndex, int posIndex, geom::Location location)
+Label::setLocation(uint32_t geomIndex, uint32_t posIndex, geom::Location location)
 {
-    assert(geomIndex >= 0 && geomIndex < 2);
+    assert(geomIndex < 2);
     elt[geomIndex].setLocation(posIndex, location);
 }
 
 /*public*/
 INLINE void
-Label::setLocation(int geomIndex, geom::Location location)
+Label::setLocation(uint32_t geomIndex, geom::Location location)
 {
-    assert(geomIndex >= 0 && geomIndex < 2);
+    assert(geomIndex < 2);
     elt[geomIndex].setLocation(Position::ON, location);
 }
 
 /*public*/
 INLINE void
-Label::setAllLocations(int geomIndex, geom::Location location)
+Label::setAllLocations(uint32_t geomIndex, geom::Location location)
 {
-    assert(geomIndex >= 0 && geomIndex < 2);
+    assert(geomIndex < 2);
     elt[geomIndex].setAllLocations(location);
 }
 
 /*public*/
 INLINE void
-Label::setAllLocationsIfNull(int geomIndex, geom::Location location)
+Label::setAllLocationsIfNull(uint32_t geomIndex, geom::Location location)
 {
-    assert(geomIndex >= 0 && geomIndex < 2);
+    assert(geomIndex < 2);
     elt[geomIndex].setAllLocationsIfNull(location);
 }
 
@@ -184,9 +184,9 @@ Label::getGeometryCount() const
 
 /*public*/
 INLINE bool
-Label::isNull(int geomIndex) const
+Label::isNull(uint32_t geomIndex) const
 {
-    assert(geomIndex >= 0 && geomIndex < 2);
+    assert(geomIndex < 2);
     return elt[geomIndex].isNull();
 }
 
@@ -199,9 +199,9 @@ Label::isNull() const
 
 /*public*/
 INLINE bool
-Label::isAnyNull(int geomIndex) const
+Label::isAnyNull(uint32_t geomIndex) const
 {
-    assert(geomIndex >= 0 && geomIndex < 2);
+    assert(geomIndex < 2);
     return elt[geomIndex].isAnyNull();
 }
 
@@ -214,23 +214,23 @@ Label::isArea() const
 
 /*public*/
 INLINE bool
-Label::isArea(int geomIndex) const
+Label::isArea(uint32_t geomIndex) const
 {
-    assert(geomIndex >= 0 && geomIndex < 2);
+    assert(geomIndex < 2);
     return elt[geomIndex].isArea();
 }
 
 /*public*/
 INLINE bool
-Label::isLine(int geomIndex) const
+Label::isLine(uint32_t geomIndex) const
 {
-    assert(geomIndex >= 0 && geomIndex < 2);
+    assert(geomIndex < 2);
     return elt[geomIndex].isLine();
 }
 
 /*public*/
 INLINE bool
-Label::isEqualOnSide(const Label& lbl, int side) const
+Label::isEqualOnSide(const Label& lbl, uint32_t side) const
 {
     return elt[0].isEqualOnSide(lbl.elt[0], side)
             && elt[1].isEqualOnSide(lbl.elt[1], side);
@@ -238,17 +238,17 @@ Label::isEqualOnSide(const Label& lbl, int side) const
 
 /*public*/
 INLINE bool
-Label::allPositionsEqual(int geomIndex, geom::Location loc) const
+Label::allPositionsEqual(uint32_t geomIndex, geom::Location loc) const
 {
-    assert(geomIndex >= 0 && geomIndex < 2);
+    assert(geomIndex < 2);
     return elt[geomIndex].allPositionsEqual(loc);
 }
 
 /*public*/
 INLINE void
-Label::toLine(int geomIndex)
+Label::toLine(uint32_t geomIndex)
 {
-    assert(geomIndex >= 0 && geomIndex < 2);
+    assert(geomIndex < 2);
     if(elt[geomIndex].isArea()) {
         elt[geomIndex] = TopologyLocation(elt[geomIndex].getLocations()[0]);
     }


=====================================
include/geos/geomgraph/TopologyLocation.h
=====================================
@@ -96,7 +96,7 @@ public:
      */
     bool isAnyNull() const;
 
-    bool isEqualOnSide(const TopologyLocation& le, int locIndex) const;
+    bool isEqualOnSide(const TopologyLocation& le, uint32_t locIndex) const;
 
     bool isArea() const;
 


=====================================
include/geos/geomgraph/TopologyLocation.inl
=====================================
@@ -105,7 +105,7 @@ TopologyLocation::isAnyNull() const
 
 /*public*/
 INLINE bool
-TopologyLocation::isEqualOnSide(const TopologyLocation& le, int locIndex) const
+TopologyLocation::isEqualOnSide(const TopologyLocation& le, uint32_t locIndex) const
 {
     return location[locIndex] == le.location[locIndex];
 }


=====================================
include/geos/precision/GeometryPrecisionReducer.h
=====================================
@@ -128,6 +128,7 @@ public:
         , targetPM(pm)
         , removeCollapsed(true)
         , changePrecisionModel(false)
+        , useAreaReducer(false)
         , isPointwise(false)
     {}
 
@@ -136,12 +137,19 @@ public:
      * Create a reducer that will change the precision model of the
      * new reduced Geometry
      *
-     * @param gf the factory for the created Geometry.
+     * @param changeFactory the factory for the created Geometry.
      *           Its PrecisionModel will be used for the reduction.
      *           NOTE: ownership left to caller must be kept alive for
      *           the whole lifetime of the returned Geometry.
      */
-    GeometryPrecisionReducer(const geom::GeometryFactory& gf);
+    GeometryPrecisionReducer(const geom::GeometryFactory& changeFactory)
+        : newFactory(&changeFactory)
+        , targetPM(*(changeFactory.getPrecisionModel()))
+        , removeCollapsed(true)
+        , changePrecisionModel(false)
+        , useAreaReducer(false)
+        , isPointwise(false)
+    {}
 
     /**
      * Sets whether the reduction will result in collapsed components


=====================================
include/geos/util/GeometricShapeFactory.h
=====================================
@@ -85,7 +85,7 @@ protected:
     const geom::GeometryFactory* geomFact; // externally owned
     const geom::PrecisionModel* precModel; // externally owned
     Dimensions dim;
-    int nPts;
+    uint32_t nPts;
 
     geom::Coordinate coord(double x, double y) const;
 
@@ -171,7 +171,7 @@ public:
     /**
      * \brief Sets the total number of points in the created Geometry
      */
-    void setNumPoints(int nNPts);
+    void setNumPoints(uint32_t nNPts);
 
     /**
      * \brief


=====================================
src/algorithm/LineIntersector.cpp
=====================================
@@ -256,7 +256,7 @@ LineIntersector::interpolateZ(const Coordinate& p,
 
     //double zgap = fabs(p2.z - p1.z);
     double zgap = p2.z - p1.z;
-    if(! zgap) {
+    if(zgap == 0.0) {
 #if GEOS_DEBUG
         cerr << " no zgap, returning " << p2.z << endl;
 #endif
@@ -471,7 +471,7 @@ LineIntersector::computeIntersect(const Coordinate& p1, const Coordinate& p2,
 }
 
 /*private*/
-int
+uint8_t
 LineIntersector::computeCollinearIntersection(const Coordinate& p1, const Coordinate& p2,
                                               const Coordinate& q1, const Coordinate& q2)
 {


=====================================
src/algorithm/Orientation.cpp
=====================================
@@ -45,12 +45,13 @@ bool
 Orientation::isCCW(const geom::CoordinateSequence* ring)
 {
     // # of points without closing endpoint
-    int nPts = static_cast<int>(ring->size()) - 1;
+    int inPts = static_cast<int>(ring->size()) - 1;
     // sanity check
-    if (nPts < 3)
+    if (inPts < 3)
         throw util::IllegalArgumentException(
             "Ring has fewer than 4 points, so orientation cannot be determined");
 
+    uint32_t nPts = static_cast<uint32_t>(inPts);
     /**
      * Find first highest point after a lower point, if one exists
      * (e.g. a rising segment)
@@ -65,8 +66,8 @@ Orientation::isCCW(const geom::CoordinateSequence* ring)
     geom::Coordinate upLowPt;
     upLowPt.setNull();
     // const geom::Coordinate& upLowPt = nullptr;
-    int iUpHi = 0;
-    for (int i = 1; i <= nPts; i++) {
+    uint32_t iUpHi = 0;
+    for (uint32_t i = 1; i <= nPts; i++) {
         double py = ring->getY(i);
         /**
         * If segment is upwards and endpoint is higher, record it
@@ -88,13 +89,13 @@ Orientation::isCCW(const geom::CoordinateSequence* ring)
      * (e.g. a falling segment).
      * This must exist since ring is not flat.
      */
-    int iDownLow = iUpHi;
+    uint32_t iDownLow = iUpHi;
     do {
         iDownLow = (iDownLow + 1) % nPts;
     } while (iDownLow != iUpHi && ring->getY(iDownLow) == upHiPt.y );
 
     const geom::Coordinate& downLowPt = ring->getAt(iDownLow);
-    int iDownHi = iDownLow > 0 ? iDownLow - 1 : nPts - 1;
+    uint32_t iDownHi = iDownLow > 0 ? iDownLow - 1 : nPts - 1;
     const geom::Coordinate& downHiPt = ring->getAt(iDownHi);
 
     /**


=====================================
src/geom/Polygon.cpp
=====================================
@@ -473,7 +473,7 @@ Polygon::isRectangle() const
 
     // check vertices have correct values
     const Envelope& env = *getEnvelopeInternal();
-    for(int i = 0; i < 5; i++) {
+    for(uint32_t i = 0; i < 5; i++) {
         double x = seq.getX(i);
         if(!(x == env.getMinX() || x == env.getMaxX())) {
             return false;


=====================================
src/geomgraph/Depth.cpp
=====================================
@@ -68,8 +68,8 @@ Depth::normalize()
 void
 Depth::add(const Label& lbl)
 {
-    for(int i = 0; i < 2; i++) {
-        for(int j = 1; j < 3; j++) {
+    for(uint32_t i = 0; i < 2; i++) {
+        for(uint32_t j = 1; j < 3; j++) {
             Location loc = lbl.getLocation(i, j);
             if(loc == Location::EXTERIOR || loc == Location::INTERIOR) {
                 // initialize depth if it is null, otherwise


=====================================
src/geomgraph/DirectedEdge.cpp
=====================================
@@ -151,7 +151,7 @@ bool
 DirectedEdge::isInteriorAreaEdge()
 {
     bool p_isInteriorAreaEdge = true;
-    for(int i = 0; i < 2; i++) {
+    for(uint32_t i = 0; i < 2; i++) {
         if(!(label.isArea(i)
                 && label.getLocation(i, Position::LEFT) == Location::INTERIOR
                 && label.getLocation(i, Position::RIGHT) == Location::INTERIOR)) {


=====================================
src/geomgraph/DirectedEdgeStar.cpp
=====================================
@@ -148,7 +148,7 @@ DirectedEdgeStar::computeLabelling(std::vector<GeometryGraph*>* geom)
         Edge* e = ee->getEdge();
         assert(e);
         const Label& eLabel = e->getLabel();
-        for(int i = 0; i < 2; ++i) {
+        for(uint32_t i = 0; i < 2; ++i) {
             Location eLoc = eLabel.getLocation(i);
             if(eLoc == Location::INTERIOR || eLoc == Location::BOUNDARY) {
                 label.setLocation(i, Location::INTERIOR);


=====================================
src/geomgraph/EdgeEndStar.cpp
=====================================
@@ -161,7 +161,7 @@ EdgeEndStar::computeLabelling(std::vector<GeometryGraph*>* geomGraph)
         EdgeEnd* e = *it;
         assert(e);
         Label& label = e->getLabel();
-        for(int geomi = 0; geomi < 2; ++geomi) {
+        for(uint32_t geomi = 0; geomi < 2; ++geomi) {
             if(label.isAnyNull(geomi)) {
                 Location loc = Location::NONE;
                 if(hasDimensionalCollapseEdge[geomi]) {
@@ -192,7 +192,7 @@ EdgeEndStar::computeEdgeEndLabels(
 
 /*public*/
 Location
-EdgeEndStar::getLocation(int geomIndex,
+EdgeEndStar::getLocation(uint32_t geomIndex,
                          const Coordinate& p, std::vector<GeometryGraph*>* geom)
 {
     // compute location only on demand
@@ -213,7 +213,7 @@ EdgeEndStar::isAreaLabelsConsistent(const GeometryGraph& geomGraph)
 
 /*private*/
 bool
-EdgeEndStar::checkAreaLabelsConsistent(int geomIndex)
+EdgeEndStar::checkAreaLabelsConsistent(uint32_t geomIndex)
 {
     // Since edges are stored in CCW order around the node,
     // As we move around the ring we move from the right to
@@ -262,7 +262,7 @@ EdgeEndStar::checkAreaLabelsConsistent(int geomIndex)
 
 /*public*/
 void
-EdgeEndStar::propagateSideLabels(int geomIndex)
+EdgeEndStar::propagateSideLabels(uint32_t geomIndex)
 //throw(TopologyException *)
 {
     // Since edges are stored in CCW order around the node,


=====================================
src/precision/GeometryPrecisionReducer.cpp
=====================================
@@ -40,17 +40,6 @@ namespace geos {
 namespace precision { // geos.precision
 
 
-/* public */
-GeometryPrecisionReducer::GeometryPrecisionReducer(const GeometryFactory& changeFactory)
-    :
-    newFactory(&changeFactory),
-    targetPM(*(changeFactory.getPrecisionModel())),
-    removeCollapsed(true),
-    useAreaReducer(false),
-    isPointwise(false)
-{}
-
-
 /* public */
 std::unique_ptr<Geometry>
 GeometryPrecisionReducer::reduce(const Geometry& geom)


=====================================
src/util/GeometricShapeFactory.cpp
=====================================
@@ -58,7 +58,7 @@ GeometricShapeFactory::setCentre(const Coordinate& centre)
 }
 
 void
-GeometricShapeFactory::setNumPoints(int nNPts)
+GeometricShapeFactory::setNumPoints(uint32_t nNPts)
 {
     nPts = nNPts;
 }
@@ -86,7 +86,7 @@ GeometricShapeFactory::createRectangle()
 {
     int i;
     int ipt = 0;
-    int nSide = nPts / 4;
+    uint32_t nSide = nPts / 4;
     if(nSide < 1) {
         nSide = 1;
     }


=====================================
tests/bigtest/GeometryTestFactory.cpp
=====================================
@@ -70,7 +70,7 @@ GeometryTestFactory::createBox(double minx, double miny, int nSide, double segLe
  * @param nPts the number of points in the star
  */
 CoordinateSequence*
-GeometryTestFactory::createCircle(double basex, double basey, double size, int nPts)
+GeometryTestFactory::createCircle(double basex, double basey, double size, uint32_t nPts)
 {
     CoordinateArraySequence* pts = new CoordinateArraySequence(nPts + 1);
     double len = size / 2.0;
@@ -86,7 +86,7 @@ GeometryTestFactory::createCircle(double basex, double basey, double size, int n
 }
 
 Polygon*
-GeometryTestFactory::createCircle(GeometryFactory* fact, double basex, double basey, double size, int nPts)
+GeometryTestFactory::createCircle(GeometryFactory* fact, double basex, double basey, double size, uint32_t nPts)
 {
     CoordinateSequence* pts = createCircle(basex, basey, size, nPts);
     return fact->createPolygon(fact->createLinearRing(pts), nullptr);


=====================================
tests/bigtest/bigtest.h
=====================================
@@ -35,8 +35,8 @@ class GeometryTestFactory {
 public:
     static geom::Polygon* createBox(geom::GeometryFactory* fact, double minx, double miny, int nSide, double segLen);
     static geom::CoordinateSequence* createBox(double minx, double miny, int nSide, double segLen);
-    static geom::CoordinateSequence* createCircle(double basex, double basey, double size, int nPts);
-    static geom::Polygon* createCircle(geom::GeometryFactory* fact, double basex, double basey, double size, int nPts);
+    static geom::CoordinateSequence* createCircle(double basex, double basey, double size, uint32_t nPts);
+    static geom::Polygon* createCircle(geom::GeometryFactory* fact, double basex, double basey, double size, uint32_t nPts);
     static geom::CoordinateSequence* createSineStar(double basex, double basey, double size, double armLen, int nArms,
             int nPts);
     static geom::Polygon* createSineStar(geom::GeometryFactory* fact, double basex, double basey, double size,


=====================================
tests/unit/util/NodingTestUtil.cpp
=====================================
@@ -97,6 +97,7 @@ NodingTestUtil::nodeValidated(const Geometry* geom1, const Geometry* geom2, Node
     for (auto nss: *nodedList) {
         delete nss;
     }
+    delete nodedList;
 
     return lineGeom;
 }


=====================================
tests/unit/utility.h
=====================================
@@ -121,8 +121,8 @@ ensure_equals_geometry(T1 const* lhs, T2 const* rhs)
 {
     assert(0 != lhs);
     assert(0 != rhs);
-
     assert(!"DIFFERENT TYPES ARE NOT OF THE SAME STRUCTURE");
+    ensure(lhs != 0 && rhs != 0 && lhs != rhs);
 }
 
 template <typename T>
@@ -265,7 +265,7 @@ ensure_equals_dims(const geos::geom::CoordinateSequence *seq1,
         }
         else
         {
-            if ( tolerance )
+            if ( tolerance > 0.0 )
                 ensure_distance( val1, val2, tolerance );
             else
                 ensure_equals( val1, val2 );



View it on GitLab: https://salsa.debian.org/debian-gis-team/geos/-/commit/cf4450f68da69d10639daba2025f614edbb44db1

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/geos/-/commit/cf4450f68da69d10639daba2025f614edbb44db1
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20201210/d82e0d03/attachment-0001.html>


More information about the Pkg-grass-devel mailing list