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

git at osgeo.org git at osgeo.org
Fri Jan 29 13:22:39 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  d8a1b32762a799ad8364c48ba84924f61c93c132 (commit)
      from  d0c602b817e6ae8b97965956bc5ecf9763a3c563 (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 d8a1b32762a799ad8364c48ba84924f61c93c132
Author: Daniel Baston <dbaston at gmail.com>
Date:   Fri Jan 29 16:22:09 2021 -0500

    Quiet clang warnings

diff --git a/include/geos/io/StringTokenizer.h b/include/geos/io/StringTokenizer.h
index e502c73..5c00cb5 100644
--- a/include/geos/io/StringTokenizer.h
+++ b/include/geos/io/StringTokenizer.h
@@ -45,8 +45,8 @@ public:
     ~StringTokenizer() {}
     int nextToken();
     int peekNextToken();
-    double getNVal();
-    std::string getSVal();
+    double getNVal() const;
+    std::string getSVal() const;
 private:
     const std::string& str;
     std::string stok;
diff --git a/src/index/quadtree/Node.cpp b/src/index/quadtree/Node.cpp
index 26a908e..894d42c 100644
--- a/src/index/quadtree/Node.cpp
+++ b/src/index/quadtree/Node.cpp
@@ -99,9 +99,9 @@ Node::find(const Envelope* searchEnv)
     if(subnodeIndex == -1) {
         return this;
     }
-    if(subnodes[subnodeIndex] != nullptr) {
+    if(subnodes[static_cast<std::size_t>(subnodeIndex)] != nullptr) {
         // query lies in subquad, so search it
-        Node* node = subnodes[subnodeIndex];
+        Node* node = subnodes[static_cast<std::size_t>(subnodeIndex)];
         return node->find(searchEnv);
     }
     // no existing subquad, so return this one anyway
@@ -118,8 +118,8 @@ Node::insertNode(std::unique_ptr<Node> node)
 
     if(node->level == level - 1) {
         // We take ownership of node
-        delete subnodes[index];
-        subnodes[index] = node.release();
+        delete subnodes[static_cast<std::size_t>(index)];
+        subnodes[static_cast<std::size_t>(index)] = node.release();
 
         //System.out.println("inserted");
     }
@@ -132,8 +132,8 @@ Node::insertNode(std::unique_ptr<Node> node)
         childNode->insertNode(std::move(node));
 
         // We take ownership of childNode
-        delete subnodes[index];
-        subnodes[index] = childNode.release();
+        delete subnodes[static_cast<std::size_t>(index)];
+        subnodes[static_cast<std::size_t>(index)] = childNode.release();
     }
 }
 
@@ -141,10 +141,10 @@ Node*
 Node::getSubnode(int index)
 {
     assert(index >= 0 && index < 4);
-    if(subnodes[index] == nullptr) {
-        subnodes[index] = createSubnode(index).release();
+    if(subnodes[static_cast<std::size_t>(index)] == nullptr) {
+        subnodes[static_cast<std::size_t>(index)] = createSubnode(index).release();
     }
-    return subnodes[index];
+    return subnodes[static_cast<std::size_t>(index)];
 }
 
 std::unique_ptr<Node>
diff --git a/src/index/quadtree/Root.cpp b/src/index/quadtree/Root.cpp
index 516b816..697b2ca 100644
--- a/src/index/quadtree/Root.cpp
+++ b/src/index/quadtree/Root.cpp
@@ -65,7 +65,7 @@ Root::insert(const Envelope* itemEnv, void* item)
      * the item must be contained in one quadrant, so insert it into the
      * tree for that quadrant (which may not yet exist)
      */
-    Node* node = subnodes[index];
+    Node* node = subnodes[static_cast<std::size_t>(index)];
 
 #if GEOS_DEBUG
     std::cerr << "(" << this << ") subnode[" << index << "] @ " << node << std::endl;
@@ -78,7 +78,7 @@ Root::insert(const Envelope* itemEnv, void* item)
     if(node == nullptr || !node->getEnvelope()->contains(itemEnv)) {
         std::unique_ptr<Node> snode(node);  // may be NULL
         node = nullptr;
-        subnodes[index] = nullptr;
+        subnodes[static_cast<std::size_t>(index)] = nullptr;
 
         std::unique_ptr<Node> largerNode =
             Node::createExpanded(std::move(snode), *itemEnv);
@@ -89,8 +89,8 @@ Root::insert(const Envelope* itemEnv, void* item)
 #endif
 
         // Previous subnode was passed as a child of the larger one
-        assert(!subnodes[index]);
-        subnodes[index] = largerNode.release();
+        assert(!subnodes[static_cast<std::size_t>(index)]);
+        subnodes[static_cast<std::size_t>(index)] = largerNode.release();
     }
 
 #if GEOS_DEBUG
@@ -100,7 +100,7 @@ Root::insert(const Envelope* itemEnv, void* item)
      * At this point we have a subquad which exists and must contain
      * contains the env for the item.  Insert the item into the tree.
      */
-    insertContained(subnodes[index], itemEnv, item);
+    insertContained(subnodes[static_cast<std::size_t>(index)], itemEnv, item);
 
 #if GEOS_DEBUG
     std::cerr << "(" << this << ") done calling insertContained with subnode " << subnode[index] << std::endl;
diff --git a/src/index/strtree/STRtree.cpp b/src/index/strtree/STRtree.cpp
index 0043de5..c26c80f 100644
--- a/src/index/strtree/STRtree.cpp
+++ b/src/index/strtree/STRtree.cpp
@@ -58,7 +58,7 @@ STRtree::createParentBoundables(BoundableList* childBoundables, int newLevel)
     std::unique_ptr<BoundableList> sortedChildBoundables(sortBoundablesX(childBoundables));
 
     std::unique_ptr< std::vector<BoundableList*> > verticalSlicesV(
-        verticalSlices(sortedChildBoundables.get(), (int)ceil(sqrt((double)minLeafCount)))
+        verticalSlices(sortedChildBoundables.get(), static_cast<std::size_t>(std::ceil(std::sqrt(static_cast<double>(minLeafCount)))))
     );
 
     std::unique_ptr<BoundableList> ret(
diff --git a/src/io/StringTokenizer.cpp b/src/io/StringTokenizer.cpp
index 173c1f4..b536120 100644
--- a/src/io/StringTokenizer.cpp
+++ b/src/io/StringTokenizer.cpp
@@ -92,17 +92,17 @@ StringTokenizer::nextToken()
     case '\t':
     case ' ':
         string::size_type pos = str.find_first_not_of(" \n\r\t",
-                                iter - str.begin());
+                                static_cast<string::size_type>(iter - str.begin()));
         if(pos == string::npos) {
             return StringTokenizer::TT_EOF;
         }
         else {
-            iter = str.begin() + pos;
+            iter = str.begin() + static_cast<string::difference_type>(pos);
             return nextToken();
         }
     }
     string::size_type pos = str.find_first_of("\n\r\t() ,",
-                            iter - str.begin());
+                            static_cast<string::size_type>(iter - str.begin()));
     if(pos == string::npos) {
         if(iter != str.end()) {
             tok.assign(iter, str.end());
@@ -113,8 +113,8 @@ StringTokenizer::nextToken()
         }
     }
     else {
-        tok.assign(iter, str.begin() + pos);
-        iter = str.begin() + pos;
+        tok.assign(iter, str.begin() + static_cast<string::difference_type>(pos));
+        iter = str.begin() + static_cast<string::difference_type>(pos);
     }
     char* stopstring;
     double dbl = strtod_with_vc_fix(tok.c_str(), &stopstring);
@@ -141,7 +141,7 @@ StringTokenizer::peekNextToken()
         return StringTokenizer::TT_EOF;
     }
 
-    pos = str.find_first_not_of(" \r\n\t", iter - str.begin());
+    pos = str.find_first_not_of(" \r\n\t", static_cast<string::size_type>(iter - str.begin()));
 
     if(pos == string::npos) {
         return StringTokenizer::TT_EOF;
@@ -156,7 +156,7 @@ StringTokenizer::peekNextToken()
     // It's either a Number or a Word, let's
     // see when it ends
 
-    pos = str.find_first_of("\n\r\t() ,", iter - str.begin());
+    pos = str.find_first_of("\n\r\t() ,", static_cast<string::size_type>(iter - str.begin()));
 
     if(pos == string::npos) {
         if(iter != str.end()) {
@@ -167,7 +167,7 @@ StringTokenizer::peekNextToken()
         }
     }
     else {
-        tok.assign(iter, str.begin() + pos); //str.end());
+        tok.assign(iter, str.begin() + static_cast<string::difference_type>(pos)); //str.end());
     }
 
     char* stopstring;
@@ -186,14 +186,14 @@ StringTokenizer::peekNextToken()
 
 /*public*/
 double
-StringTokenizer::getNVal()
+StringTokenizer::getNVal() const
 {
     return ntok;
 }
 
 /*public*/
 string
-StringTokenizer::getSVal()
+StringTokenizer::getSVal() const
 {
     return stok;
 }
diff --git a/src/triangulate/VoronoiDiagramBuilder.cpp b/src/triangulate/VoronoiDiagramBuilder.cpp
index 46aa9f0..b3a0db5 100644
--- a/src/triangulate/VoronoiDiagramBuilder.cpp
+++ b/src/triangulate/VoronoiDiagramBuilder.cpp
@@ -73,7 +73,7 @@ VoronoiDiagramBuilder::setTolerance(double nTolerance)
 void
 VoronoiDiagramBuilder::create()
 {
-    if(subdiv.get()) {
+    if(subdiv) {
         return;
     }
 

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

Summary of changes:
 include/geos/io/StringTokenizer.h         |  4 ++--
 src/index/quadtree/Node.cpp               | 18 +++++++++---------
 src/index/quadtree/Root.cpp               | 10 +++++-----
 src/index/strtree/STRtree.cpp             |  2 +-
 src/io/StringTokenizer.cpp                | 20 ++++++++++----------
 src/triangulate/VoronoiDiagramBuilder.cpp |  2 +-
 6 files changed, 28 insertions(+), 28 deletions(-)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list