From 63b9b7baa7636f1f7ee737936914c848784bf1ec Mon Sep 17 00:00:00 2001 From: aothms Date: Fri, 3 Apr 2020 12:01:58 +0000 Subject: [PATCH] Nullptr return types --- src/ifcgeom/schema/bind_convert_impl.i | 2 +- src/ifcgeom/schema/mapping.cpp | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/ifcgeom/schema/bind_convert_impl.i b/src/ifcgeom/schema/bind_convert_impl.i index 32ebf485b6..8bf303533a 100644 --- a/src/ifcgeom/schema/bind_convert_impl.i +++ b/src/ifcgeom/schema/bind_convert_impl.i @@ -23,7 +23,7 @@ } catch (const std::exception& e) { \ Logger::Message(Logger::LOG_ERROR, std::string(e.what()) + "\nFailed to convert:", l); \ } \ - return false; \ + return nullptr; \ } #include "mapping.i" diff --git a/src/ifcgeom/schema/mapping.cpp b/src/ifcgeom/schema/mapping.cpp index 6d5d72afbd..ee7fb7adb1 100644 --- a/src/ifcgeom/schema/mapping.cpp +++ b/src/ifcgeom/schema/mapping.cpp @@ -1410,7 +1410,8 @@ taxonomy::item* mapping::map_impl(const IfcSchema::IfcIShapeProfileDef* inst) { if (x1 < precision_ || x2 < precision_ || y < precision_ || d1 < precision_ || dy1 < precision_ || dy2 < precision_) { Logger::Message(Logger::LOG_NOTICE, "Skipping zero sized profile:", inst); - return false; + + return nullptr; } return profile_helper(this, inst, { @@ -1500,7 +1501,7 @@ taxonomy::item* mapping::map_impl(const IfcSchema::IfcPolyline* inst) { // remove_duplicate_points_from_loop(polygon, closed_by_proximity, eps); if (polygon.size() < 2) { - return false; + return nullptr; } return polygon_from_points(polygon); @@ -1593,7 +1594,7 @@ taxonomy::item* mapping::map_impl(const IfcSchema::IfcTrimmedCurve* inst) { if (trim_cartesian) { if ((pnts[0].components - pnts[1].components).norm() < (2 * precision_)) { Logger::Message(Logger::LOG_WARNING, "Skipping segment with length below tolerance level:", inst); - return false; + return nullptr; } tc->start = pnts[0]; tc->end = pnts[1];