From ac8d88cb5207d900a69771f928aa16e9b695526b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20=E2=80=98Touky=E2=80=99=20Huet?= Date: Fri, 28 Feb 2014 00:01:26 +0000 Subject: [PATCH] Hack-fix of degrees/radians in functions.h Warnings --- src/lol/math/functions.h | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/lol/math/functions.h b/src/lol/math/functions.h index fe1a9688..f1ef47fc 100644 --- a/src/lol/math/functions.h +++ b/src/lol/math/functions.h @@ -100,14 +100,14 @@ static inline ldouble degrees(ldouble radians) return radians * (180.0L / LD_PI); } -static inline int8_t degrees(int8_t x) { return degrees((float)x); } -static inline uint8_t degrees(uint8_t x) { return degrees((float)x); } -static inline int16_t degrees(int16_t x) { return degrees((float)x); } -static inline uint16_t degrees(uint16_t x) { return degrees((float)x); } -static inline int32_t degrees(int32_t x) { return degrees((double)x); } -static inline uint32_t degrees(uint32_t x) { return degrees((double)x); } -static inline int64_t degrees(int64_t x) { return degrees((ldouble)x); } -static inline uint64_t degrees(uint64_t x) { return degrees((ldouble)x); } +static inline int8_t degrees(int8_t x) { return (int8_t) degrees((float)x); } +static inline uint8_t degrees(uint8_t x) { return (uint8_t) degrees((float)x); } +static inline int16_t degrees(int16_t x) { return (int16_t) degrees((float)x); } +static inline uint16_t degrees(uint16_t x) { return (uint16_t)degrees((float)x); } +static inline int32_t degrees(int32_t x) { return (int32_t) degrees((double)x); } +static inline uint32_t degrees(uint32_t x) { return (uint32_t)degrees((double)x); } +static inline int64_t degrees(int64_t x) { return (int64_t) degrees((ldouble)x); } +static inline uint64_t degrees(uint64_t x) { return (uint64_t)degrees((ldouble)x); } static inline float radians(float degrees) { @@ -124,14 +124,14 @@ static inline ldouble radians(ldouble degrees) return degrees * (LD_PI / 180.0L); } -static inline int8_t radians(int8_t x) { return radians((float)x); } -static inline uint8_t radians(uint8_t x) { return radians((float)x); } -static inline int16_t radians(int16_t x) { return radians((float)x); } -static inline uint16_t radians(uint16_t x) { return radians((float)x); } -static inline int32_t radians(int32_t x) { return radians((double)x); } -static inline uint32_t radians(uint32_t x) { return radians((double)x); } -static inline int64_t radians(int64_t x) { return radians((ldouble)x); } -static inline uint64_t radians(uint64_t x) { return radians((ldouble)x); } +static inline int8_t radians(int8_t x) { return (int8_t) radians((float)x); } +static inline uint8_t radians(uint8_t x) { return (uint8_t) radians((float)x); } +static inline int16_t radians(int16_t x) { return (int16_t) radians((float)x); } +static inline uint16_t radians(uint16_t x) { return (uint16_t)radians((float)x); } +static inline int32_t radians(int32_t x) { return (int32_t) radians((double)x); } +static inline uint32_t radians(uint32_t x) { return (uint32_t)radians((double)x); } +static inline int64_t radians(int64_t x) { return (int64_t) radians((ldouble)x); } +static inline uint64_t radians(uint64_t x) { return (uint64_t)radians((ldouble)x); } static inline float lerp(float const &a, float const &b, float const &x) {