From e2b75b6bf7dd80a58b041f925c133c214ff6424a Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Tue, 8 May 2018 14:01:29 +0200 Subject: [PATCH] Fixed GTX_easying clang warnings --- glm/gtx/easing.hpp | 3 +++ glm/gtx/easing.inl | 24 ++++++++++-------------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/glm/gtx/easing.hpp b/glm/gtx/easing.hpp index b1cd326c..6fdb775b 100644 --- a/glm/gtx/easing.hpp +++ b/glm/gtx/easing.hpp @@ -185,16 +185,19 @@ namespace glm{ template GLM_FUNC_DECL genType backEaseInOut(genType const& a); + /// @param a parameter /// @param o Optional overshoot modifier /// @see gtx_easing template GLM_FUNC_DECL genType backEaseIn(genType const& a, genType const& o); + /// @param a parameter /// @param o Optional overshoot modifier /// @see gtx_easing template GLM_FUNC_DECL genType backEaseOut(genType const& a, genType const& o); + /// @param a parameter /// @param o Optional overshoot modifier /// @see gtx_easing template diff --git a/glm/gtx/easing.inl b/glm/gtx/easing.inl index d7e6ec1e..d650eb23 100644 --- a/glm/gtx/easing.inl +++ b/glm/gtx/easing.inl @@ -119,7 +119,7 @@ namespace glm{ assert(a >= zero()); assert(a <= one()); - if (a < static_cast(0.5)) + if(a < static_cast(0.5)) { return static_cast(8) * a * a * a * a; } @@ -158,7 +158,7 @@ namespace glm{ assert(a >= zero()); assert(a <= one()); - if (a < static_cast(0.5)) + if(a < static_cast(0.5)) { return static_cast(16) * a * a * a * a * a; } @@ -243,7 +243,10 @@ namespace glm{ assert(a >= zero()); assert(a <= one()); - return (a == zero()) ? a : pow(static_cast(2), static_cast(10) * (a - one())); + if(a <= zero()) + return a; + else + return pow(static_cast(2), static_cast(10) * (a - one())); } template @@ -253,7 +256,10 @@ namespace glm{ assert(a >= zero()); assert(a <= one()); - return (a == one()) ? a : one() - pow(static_cast(2), -static_cast(10) * a); + if(a >= one()) + return a; + else + return one() - pow(static_cast(2), -static_cast(10) * a); } template @@ -263,16 +269,10 @@ namespace glm{ assert(a >= zero()); assert(a <= one()); - if(a == zero() || a == one()) return a; - if(a < static_cast(0.5)) - { return static_cast(0.5) * pow(static_cast(2), (static_cast(20) * a) - static_cast(10)); - } else - { return -static_cast(0.5) * pow(static_cast(2), (-static_cast(20) * a) + static_cast(10)) + one(); - } } template @@ -303,13 +303,9 @@ namespace glm{ assert(a <= one()); if(a < static_cast(0.5)) - { return static_cast(0.5) * sin(static_cast(13) * half_pi() * (static_cast(2) * a)) * pow(static_cast(2), static_cast(10) * ((static_cast(2) * a) - one())); - } else - { return static_cast(0.5) * (sin(-static_cast(13) * half_pi() * ((static_cast(2) * a - one()) + one())) * pow(static_cast(2), -static_cast(10) * (static_cast(2) * a - one())) + static_cast(2)); - } } template