[geos-commits] r4332 - in branches/3.6: . src/geom/util src/index/strtree src/linearref src/operation/union

Sandro Santilli strk at kbt.io
Wed Feb 1 09:30:58 PST 2017


Author: strk
Date: 2017-02-01 09:30:58 -0800 (Wed, 01 Feb 2017)
New Revision: 4332

Modified:
   branches/3.6/NEWS
   branches/3.6/src/geom/util/GeometryEditor.cpp
   branches/3.6/src/index/strtree/AbstractSTRtree.cpp
   branches/3.6/src/linearref/ExtractLineByLocation.cpp
   branches/3.6/src/operation/union/CascadedPolygonUnion.cpp
   branches/3.6/src/operation/union/CascadedUnion.cpp
Log:
Add static_assert<bool> to strings inside of assert calls

Allows compiling with -Wpointer-bool-conversion.

Patch by Kurt Schwehr <schwehr at google.com>
Closes #638

Modified: branches/3.6/NEWS
===================================================================
--- branches/3.6/NEWS	2017-02-01 17:29:04 UTC (rev 4331)
+++ branches/3.6/NEWS	2017-02-01 17:30:58 UTC (rev 4332)
@@ -4,6 +4,7 @@
 - Bug fixes / improvements
   - Allow building against python 3 (#774)
   - Fix build with android-ndk and other compilers (#799)
+  - Allows compiling with -Wpointer-bool-conversion (#638)
 
 Changes in 3.6.1
 2016-12-24

Modified: branches/3.6/src/geom/util/GeometryEditor.cpp
===================================================================
--- branches/3.6/src/geom/util/GeometryEditor.cpp	2017-02-01 17:29:04 UTC (rev 4331)
+++ branches/3.6/src/geom/util/GeometryEditor.cpp	2017-02-01 17:30:58 UTC (rev 4332)
@@ -99,7 +99,7 @@
   }
 
     // Unsupported Geometry classes should be caught in the GeometryEditorOperation.
-    assert(!"SHOULD NEVER GET HERE");
+    assert(!static_cast<bool>("SHOULD NEVER GET HERE"));
     return NULL;
 }
 

Modified: branches/3.6/src/index/strtree/AbstractSTRtree.cpp
===================================================================
--- branches/3.6/src/index/strtree/AbstractSTRtree.cpp	2017-02-01 17:29:04 UTC (rev 4331)
+++ branches/3.6/src/index/strtree/AbstractSTRtree.cpp	2017-02-01 17:30:58 UTC (rev 4332)
@@ -370,7 +370,7 @@
                 static_cast<ItemBoundable*>(childBoundable)->getItem());
         }
         else {
-            assert(!"should never be reached");
+            assert(!static_cast<bool>("should never be reached"));
         }
     }
     if (valuesTreeForNode->empty()) 
@@ -395,4 +395,3 @@
 } // namespace geos.index.strtree
 } // namespace geos.index
 } // namespace geos
-

Modified: branches/3.6/src/linearref/ExtractLineByLocation.cpp
===================================================================
--- branches/3.6/src/linearref/ExtractLineByLocation.cpp	2017-02-01 17:29:04 UTC (rev 4331)
+++ branches/3.6/src/linearref/ExtractLineByLocation.cpp	2017-02-01 17:30:58 UTC (rev 4332)
@@ -79,7 +79,7 @@
 		}
 		else
 		{
-			assert(!"non-linear geometry encountered");
+			assert(!static_cast<bool>("non-linear geometry encountered"));
             return 0;
 		}
 	}

Modified: branches/3.6/src/operation/union/CascadedPolygonUnion.cpp
===================================================================
--- branches/3.6/src/operation/union/CascadedPolygonUnion.cpp	2017-02-01 17:29:04 UTC (rev 4331)
+++ branches/3.6/src/operation/union/CascadedPolygonUnion.cpp	2017-02-01 17:30:58 UTC (rev 4332)
@@ -139,7 +139,7 @@
             geoms->push_back(reinterpret_cast<geom::Geometry*>((*i).get_geometry()));
         }
         else {
-            assert(!"should never be reached");
+            assert(!static_cast<bool>("should never be reached"));
         }
     }
 
@@ -247,4 +247,3 @@
 } // namespace geos.operation.union
 } // namespace geos.operation
 } // namespace geos
-

Modified: branches/3.6/src/operation/union/CascadedUnion.cpp
===================================================================
--- branches/3.6/src/operation/union/CascadedUnion.cpp	2017-02-01 17:29:04 UTC (rev 4331)
+++ branches/3.6/src/operation/union/CascadedUnion.cpp	2017-02-01 17:30:58 UTC (rev 4332)
@@ -116,7 +116,7 @@
             geoms->push_back(reinterpret_cast<geom::Geometry*>((*i).get_geometry()));
         }
         else {
-            assert(!"should never be reached");
+            assert(!static_cast<bool>("should never be reached"));
         }
     }
 
@@ -195,4 +195,3 @@
 } // namespace geos.operation.union
 } // namespace geos.operation
 } // namespace geos
-



More information about the geos-commits mailing list