X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=simgear%2Fsg_inlines.h;h=399c4bc1ebd86d17a8172f183db639782f19af79;hb=423eba373389684061fc0a8c7b78292f10011ed7;hp=89a8b9b885db790e11b9be0f680cc8c8b7e89361;hpb=15399bfe95b1b6e3f60371c514da5a42200de223;p=simgear.git diff --git a/simgear/sg_inlines.h b/simgear/sg_inlines.h index 89a8b9b8..399c4bc1 100644 --- a/simgear/sg_inlines.h +++ b/simgear/sg_inlines.h @@ -17,10 +17,9 @@ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Library General Public License for more details. // -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the -// Free Software Foundation, Inc., 59 Temple Place - Suite 330, -// Boston, MA 02111-1307, USA. +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // $Id$ @@ -30,31 +29,31 @@ // return the sign of a value template -inline const int SG_SIGN(const T x) { +inline int SG_SIGN(const T x) { return x < T(0) ? -1 : 1; } // return the minimum of two values template -inline const T SG_MIN2(const T a, const T b) { +inline T SG_MIN2(const T a, const T b) { return a < b ? a : b; } // return the minimum of three values template -inline const T SG_MIN3( const T a, const T b, const T c) { +inline T SG_MIN3( const T a, const T b, const T c) { return (a < b ? SG_MIN2 (a, c) : SG_MIN2 (b, c)); } // return the maximum of two values template -inline const T SG_MAX2(const T a, const T b) { +inline T SG_MAX2(const T a, const T b) { return a > b ? a : b; } // return the maximum of three values template -inline const T SG_MAX3 (const T a, const T b, const T c) { +inline T SG_MAX3 (const T a, const T b, const T c) { return (a > b ? SG_MAX2 (a, c) : SG_MAX2 (b, c)); } @@ -99,6 +98,6 @@ inline void SG_NORMALIZE_RANGE( T &val, const T min, const T max ) { T step = max - min; while( val >= max ) val -= step; while( val < min ) val += step; -}; +} #endif // _SG_INLINES_H