diff options
author | Dan Eble <nine.fierce.ballads@gmail.com> | 2015-08-10 08:08:04 -0400 |
---|---|---|
committer | Dan Eble <nine.fierce.ballads@gmail.com> | 2015-08-17 18:52:53 -0400 |
commit | 4b448c212466623191bc1781da092c7c8ddb6c53 (patch) | |
tree | 1124ab00223f2f74589880d14e87b957fb3aa544 /flower | |
parent | a2e1144104e4276901185a1d52dbfe61ddb12609 (diff) |
Issue 4548: eliminate flip(Direction*)
Use for (DOWN_and_UP (d)) {...} instead.
Also replace the few uses of other_dir() with unary minus.
Diffstat (limited to 'flower')
-rw-r--r-- | flower/include/direction.hh | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/flower/include/direction.hh b/flower/include/direction.hh index f3b31e3811..de13ef4ca8 100644 --- a/flower/include/direction.hh +++ b/flower/include/direction.hh @@ -49,26 +49,9 @@ enum Direction }; inline Direction -other_dir (Direction const d) +operator - (Direction d) { - return (Direction) (-d); -} - -inline Direction -operator - (Direction const d) -{ - return other_dir (d); -} - -// to be deleted soon (after coping with issues 2491 and 2493 -inline Direction -flip (Direction *i) -{ - if (*i == (Direction)1) - *i = (Direction) - 1; - else if (*i == (Direction) - 1) - *i = (Direction)1; - return *i; + return Direction (- static_cast<int> (d)); // cast avoids recursion } #define UP_and_DOWN(d) \ @@ -92,6 +75,4 @@ template<class T> T minmax (Direction d, T a, T b) return min (a, b); } -// String direction_string (Direction, Axis); - #endif // DIRECTION_HH |