[geos-commits] [SCM] GEOS branch master updated. 656712ec6fbf20006fd5eca06a0604bd57cef768

git at osgeo.org git at osgeo.org
Fri Nov 27 12:00:12 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  656712ec6fbf20006fd5eca06a0604bd57cef768 (commit)
      from  54cb7a43ae77f8ca137ec4039689fe6a62c79ae2 (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 656712ec6fbf20006fd5eca06a0604bd57cef768
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Fri Nov 27 12:00:03 2020 -0800

    More warning work

diff --git a/benchmarks/capi/memleak_mp_prep.c b/benchmarks/capi/memleak_mp_prep.c
index 27f8dca..23b6bae 100644
--- a/benchmarks/capi/memleak_mp_prep.c
+++ b/benchmarks/capi/memleak_mp_prep.c
@@ -8,30 +8,30 @@ int main(void) {
   GEOSGeometry *p;
   const GEOSPreparedGeometry *prep_mp;
   unsigned long int i;
-  unsigned long int count = 1e6;
-  
+  unsigned long int count = 1000000;
+
   initGEOS(NULL, NULL);
-  
+
   reader = GEOSWKTReader_create();
-  
-  mp = GEOSWKTReader_read(reader, 
+
+  mp = GEOSWKTReader_read(reader,
     "MULTIPOLYGON(((0 0, 10 0, 10 10, 0 10, 0 0)))");
-  
-  p = GEOSWKTReader_read(reader, 
+
+  p = GEOSWKTReader_read(reader,
     "POLYGON((2 2, 6 2, 6 6, 2 6, 2 2))");
 
   assert(GEOSisValid(mp));
   assert(GEOSisValid(p));
-  
+
   prep_mp = GEOSPrepare(mp);
-  
+
   for (i=0; i<count; i++) {
 
     if ( !(i%100) ) printf("%lu iterations\n", i);
 
     /* does not leak */
     /* GEOSContains(mp, p); */
-    
+
     /* leaks */
     GEOSPreparedContains(prep_mp, p);
   }
diff --git a/include/geos/io/WKBWriter.h b/include/geos/io/WKBWriter.h
index 3b3799c..48f6bea 100644
--- a/include/geos/io/WKBWriter.h
+++ b/include/geos/io/WKBWriter.h
@@ -85,7 +85,7 @@ public:
      * @param incudeSRID true if SRID should be included in WKB (an
      * extension).
      */
-    WKBWriter(int dims = 2, int bo = getMachineByteOrder(), bool includeSRID = false);
+    WKBWriter(uint8_t dims = 2, int bo = getMachineByteOrder(), bool includeSRID = false);
 
     /*
      * \brief
@@ -111,7 +111,7 @@ public:
      * Note that 3 indicates up to 3 dimensions will be written but
      * 2D WKB is still produced for 2D geometries.
      */
-    virtual void setOutputDimension(int newOutputDimension);
+    virtual void setOutputDimension(uint8_t newOutputDimension);
 
     /*
      * \brief
diff --git a/include/geos/io/WKTWriter.h b/include/geos/io/WKTWriter.h
index e61d9f9..c0af8e7 100644
--- a/include/geos/io/WKTWriter.h
+++ b/include/geos/io/WKTWriter.h
@@ -174,7 +174,7 @@ public:
      *        Note that 3 indicates up to 3 dimensions will be
      *        written but 2D WKB is still produced for 2D geometries.
      */
-    void setOutputDimension(int newOutputDimension);
+    void setOutputDimension(uint8_t newOutputDimension);
 
 protected:
 
diff --git a/src/geom/LineString.cpp b/src/geom/LineString.cpp
index 0f6881c..2faf90e 100644
--- a/src/geom/LineString.cpp
+++ b/src/geom/LineString.cpp
@@ -139,7 +139,7 @@ LineString::getDimension() const
 uint8_t
 LineString::getCoordinateDimension() const
 {
-    return (int) points->getDimension();
+    return (uint8_t) points->getDimension();
 }
 
 int
diff --git a/src/geom/Point.cpp b/src/geom/Point.cpp
index 93bc34b..0b2e454 100644
--- a/src/geom/Point.cpp
+++ b/src/geom/Point.cpp
@@ -121,7 +121,7 @@ Point::getDimension() const
 uint8_t
 Point::getCoordinateDimension() const
 {
-    return (int) getCoordinatesRO()->getDimension();
+    return (uint8_t) getCoordinatesRO()->getDimension();
 }
 
 int
diff --git a/src/io/WKBWriter.cpp b/src/io/WKBWriter.cpp
index 061e6ed..d6bbb7e 100644
--- a/src/io/WKBWriter.cpp
+++ b/src/io/WKBWriter.cpp
@@ -45,7 +45,7 @@ using namespace geos::geom;
 namespace geos {
 namespace io { // geos.io
 
-WKBWriter::WKBWriter(int dims, int bo, bool srid):
+WKBWriter::WKBWriter(uint8_t dims, int bo, bool srid):
     defaultOutputDimension(dims), byteOrder(bo), includeSRID(srid), outStream(nullptr)
 {
     if(dims < 2 || dims > 3) {
@@ -57,7 +57,7 @@ WKBWriter::WKBWriter(int dims, int bo, bool srid):
 
 /* public */
 void
-WKBWriter::setOutputDimension(int dims)
+WKBWriter::setOutputDimension(uint8_t dims)
 {
     if(dims < 2 || dims > 3) {
         throw util::IllegalArgumentException("WKB output dimension must be 2 or 3");
diff --git a/src/io/WKTWriter.cpp b/src/io/WKTWriter.cpp
index 5ce1c93..ff35edc 100644
--- a/src/io/WKTWriter.cpp
+++ b/src/io/WKTWriter.cpp
@@ -61,7 +61,7 @@ WKTWriter::WKTWriter():
 
 /* public */
 void
-WKTWriter::setOutputDimension(int dims)
+WKTWriter::setOutputDimension(uint8_t dims)
 {
     if(dims < 2 || dims > 3) {
         throw util::IllegalArgumentException("WKT output dimension must be 2 or 3");

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

Summary of changes:
 benchmarks/capi/memleak_mp_prep.c | 20 ++++++++++----------
 include/geos/io/WKBWriter.h       |  4 ++--
 include/geos/io/WKTWriter.h       |  2 +-
 src/geom/LineString.cpp           |  2 +-
 src/geom/Point.cpp                |  2 +-
 src/io/WKBWriter.cpp              |  4 ++--
 src/io/WKTWriter.cpp              |  2 +-
 7 files changed, 18 insertions(+), 18 deletions(-)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list