diff options
| author | Stanislaw Halik <sthalik@misaki.pl> | 2024-03-24 14:12:06 +0100 |
|---|---|---|
| committer | Stanislaw Halik <sthalik@misaki.pl> | 2024-03-24 14:18:55 +0100 |
| commit | 6979582bef906b433ecf63e80bb5ed51b596d8c0 (patch) | |
| tree | e189e3e1c934b78bff5184aee1fc93cc7b0aa777 /src/wall-atlas.cpp | |
| parent | 75146a4e6c3d5e239e62f9016801c757b21eb075 (diff) | |
fix -Wswitch-default
Diffstat (limited to 'src/wall-atlas.cpp')
| -rw-r--r-- | src/wall-atlas.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/wall-atlas.cpp b/src/wall-atlas.cpp index 1d043db0..49b00311 100644 --- a/src/wall-atlas.cpp +++ b/src/wall-atlas.cpp @@ -214,19 +214,16 @@ auto wall_atlas::calc_direction(Direction_ dir) const -> const Direction& if (auto dai = _direction_map[(size_t)dir]) [[likely]] return _dir_array[dai.val]; CORRADE_ASSUME(dir < Direction_::COUNT); + Direction_ other; switch (dir) { - case Direction_::N: - if (auto dai = _direction_map[(size_t)Direction_::W]) - return _dir_array[dai.val]; - break; - case Direction_::W: + case Direction_::N: other = Direction_::W; break; + case Direction_::W: other = Direction_::N; break; + default: other = Direction_::COUNT; + } + if (other != Direction_::COUNT) if (auto dai = _direction_map[(size_t)Direction_::N]) return _dir_array[dai.val]; - break; - case Direction_::COUNT: - std::unreachable(); - } fm_abort("wall_atlas: can't find direction '%d'", (int)dir); } |
