From 6ae43831004b08c8eef7499acd7f0dcd9496c423 Mon Sep 17 00:00:00 2001 From: thomaslepoix Date: Tue, 19 Jul 2022 00:20:35 +0200 Subject: [PATCH] fix : enum unsafety -> abort() --- src/domain/conflicts/conflict_colinear_edges.cpp | 2 ++ src/domain/geometrics/relation.cpp | 2 +- src/domain/mesh/meshline_policy.cpp | 1 + src/domain/meshline_policy_manager.cpp | 1 + 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/domain/conflicts/conflict_colinear_edges.cpp b/src/domain/conflicts/conflict_colinear_edges.cpp index 55a50f5..64350a0 100644 --- a/src/domain/conflicts/conflict_colinear_edges.cpp +++ b/src/domain/conflicts/conflict_colinear_edges.cpp @@ -62,6 +62,7 @@ void ConflictColinearEdges::auto_solve(MeshlinePolicyManager& line_policy_manage switch(axis.value()) { case MeshlinePolicy::Axis::H: return Normal::YMIN; case MeshlinePolicy::Axis::V: return Normal::XMIN; + default: abort(); } } (); meshline_policy = line_policy_manager.add_meshline_policy( @@ -77,6 +78,7 @@ void ConflictColinearEdges::auto_solve(MeshlinePolicyManager& line_policy_manage switch(axis.value()) { case MeshlinePolicy::Axis::H: return Normal::YMAX; case MeshlinePolicy::Axis::V: return Normal::XMAX; + default: abort(); } } (); meshline_policy = line_policy_manager.add_meshline_policy( diff --git a/src/domain/geometrics/relation.cpp b/src/domain/geometrics/relation.cpp index 420453a..b76d285 100644 --- a/src/domain/geometrics/relation.cpp +++ b/src/domain/geometrics/relation.cpp @@ -13,10 +13,10 @@ namespace relation { //****************************************************************************** PolygonPoint cast(PolygonSegment const a) { switch(a) { - default: [[fallthrough]]; case PolygonSegment::IN: return PolygonPoint::IN; case PolygonSegment::ON: return PolygonPoint::ON; case PolygonSegment::OUT: return PolygonPoint::OUT; + default: abort(); } } diff --git a/src/domain/mesh/meshline_policy.cpp b/src/domain/mesh/meshline_policy.cpp index 7e057c6..4c83104 100644 --- a/src/domain/mesh/meshline_policy.cpp +++ b/src/domain/mesh/meshline_policy.cpp @@ -48,5 +48,6 @@ Coord coord(Point const& point, MeshlinePolicy::Axis const axis) noexcept { switch(axis) { case MeshlinePolicy::Axis::H: return point.y; case MeshlinePolicy::Axis::V: return point.x; + default: abort(); } } diff --git a/src/domain/meshline_policy_manager.cpp b/src/domain/meshline_policy_manager.cpp index 732c069..f44c8f7 100644 --- a/src/domain/meshline_policy_manager.cpp +++ b/src/domain/meshline_policy_manager.cpp @@ -105,5 +105,6 @@ GridAxis cast(MeshlinePolicy::Axis const a) noexcept { switch(a) { case MeshlinePolicy::Axis::H: return H; case MeshlinePolicy::Axis::V: return V; + default: abort(); } }