X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=flower%2Finclude%2Fdirection.hh;h=0d36c0f7c7cca5ff25fb0a41f6917f52e1d01a83;hb=4091a5dfb41072b0a8b95500582febe15e0cdae9;hp=6c6b9a7d0221ef8d0ae7cd21b58ec636634cad61;hpb=99b6f3aa3558b01c9d4158b19a1f1794c534f89c;p=lilypond.git diff --git a/flower/include/direction.hh b/flower/include/direction.hh index 6c6b9a7d02..0d36c0f7c7 100644 --- a/flower/include/direction.hh +++ b/flower/include/direction.hh @@ -1,7 +1,7 @@ /* This file is part of LilyPond, the GNU music typesetter. - Copyright (C) 1997--2014 Han-Wen Nienhuys + Copyright (C) 1997--2015 Han-Wen Nienhuys LilyPond is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -20,6 +20,7 @@ #ifndef DIRECTION_HH #define DIRECTION_HH +#include #include "axis.hh" enum Direction @@ -49,26 +50,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 (d)); // cast avoids recursion } #define UP_and_DOWN(d) \ @@ -92,6 +76,4 @@ template T minmax (Direction d, T a, T b) return min (a, b); } -// String direction_string (Direction, Axis); - #endif // DIRECTION_HH