[geos-commits] r4331 - in trunk/src: geom/util index/strtree linearref operation/union

Sandro Santilli strk at kbt.io
Wed Feb 1 09:29:04 PST 2017


Author: strk
Date: 2017-02-01 09:29:04 -0800 (Wed, 01 Feb 2017)
New Revision: 4331

Modified:
   trunk/src/geom/util/GeometryEditor.cpp
   trunk/src/index/strtree/AbstractSTRtree.cpp
   trunk/src/linearref/ExtractLineByLocation.cpp
   trunk/src/operation/union/CascadedPolygonUnion.cpp
   trunk/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: trunk/src/geom/util/GeometryEditor.cpp
===================================================================
--- trunk/src/geom/util/GeometryEditor.cpp	2017-01-31 20:01:40 UTC (rev 4330)
+++ trunk/src/geom/util/GeometryEditor.cpp	2017-02-01 17:29:04 UTC (rev 4331)
@@ -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: trunk/src/index/strtree/AbstractSTRtree.cpp
===================================================================
--- trunk/src/index/strtree/AbstractSTRtree.cpp	2017-01-31 20:01:40 UTC (rev 4330)
+++ trunk/src/index/strtree/AbstractSTRtree.cpp	2017-02-01 17:29:04 UTC (rev 4331)
@@ -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: trunk/src/linearref/ExtractLineByLocation.cpp
===================================================================
--- trunk/src/linearref/ExtractLineByLocation.cpp	2017-01-31 20:01:40 UTC (rev 4330)
+++ trunk/src/linearref/ExtractLineByLocation.cpp	2017-02-01 17:29:04 UTC (rev 4331)
@@ -79,7 +79,7 @@
 		}
 		else
 		{
-			assert(!"non-linear geometry encountered");
+			assert(!static_cast<bool>("non-linear geometry encountered"));
             return 0;
 		}
 	}

Modified: trunk/src/operation/union/CascadedPolygonUnion.cpp
===================================================================
--- trunk/src/operation/union/CascadedPolygonUnion.cpp	2017-01-31 20:01:40 UTC (rev 4330)
+++ trunk/src/operation/union/CascadedPolygonUnion.cpp	2017-02-01 17:29:04 UTC (rev 4331)
@@ -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: trunk/src/operation/union/CascadedUnion.cpp
===================================================================
--- trunk/src/operation/union/CascadedUnion.cpp	2017-01-31 20:01:40 UTC (rev 4330)
+++ trunk/src/operation/union/CascadedUnion.cpp	2017-02-01 17:29:04 UTC (rev 4331)
@@ -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