Nullptr return types

This commit is contained in:
aothms
2020-04-03 12:01:58 +00:00
parent 33e092c8d5
commit 63b9b7baa7
2 changed files with 5 additions and 4 deletions
+1 -1
View File
@@ -23,7 +23,7 @@
} catch (const std::exception& e) { \ } catch (const std::exception& e) { \
Logger::Message(Logger::LOG_ERROR, std::string(e.what()) + "\nFailed to convert:", l); \ Logger::Message(Logger::LOG_ERROR, std::string(e.what()) + "\nFailed to convert:", l); \
} \ } \
return false; \ return nullptr; \
} }
#include "mapping.i" #include "mapping.i"
+4 -3
View File
@@ -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_) { if (x1 < precision_ || x2 < precision_ || y < precision_ || d1 < precision_ || dy1 < precision_ || dy2 < precision_) {
Logger::Message(Logger::LOG_NOTICE, "Skipping zero sized profile:", inst); Logger::Message(Logger::LOG_NOTICE, "Skipping zero sized profile:", inst);
return false;
return nullptr;
} }
return profile_helper(this, inst, { 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); // remove_duplicate_points_from_loop(polygon, closed_by_proximity, eps);
if (polygon.size() < 2) { if (polygon.size() < 2) {
return false; return nullptr;
} }
return polygon_from_points(polygon); return polygon_from_points(polygon);
@@ -1593,7 +1594,7 @@ taxonomy::item* mapping::map_impl(const IfcSchema::IfcTrimmedCurve* inst) {
if (trim_cartesian) { if (trim_cartesian) {
if ((pnts[0].components - pnts[1].components).norm() < (2 * precision_)) { if ((pnts[0].components - pnts[1].components).norm() < (2 * precision_)) {
Logger::Message(Logger::LOG_WARNING, "Skipping segment with length below tolerance level:", inst); Logger::Message(Logger::LOG_WARNING, "Skipping segment with length below tolerance level:", inst);
return false; return nullptr;
} }
tc->start = pnts[0]; tc->start = pnts[0];
tc->end = pnts[1]; tc->end = pnts[1];