From 0157969ccc80b05b93d01dd0ea11b40e588437b2 Mon Sep 17 00:00:00 2001 From: Andreas Haas Date: Tue, 21 Feb 2017 23:28:52 +0100 Subject: Tween: Fix undefined behavior found by static code analyzer. Adresses the issue mentioned in https://software.intel.com/en-us/articles/the-ultimate-question-of-programming-refactoring-and-everything --- scene/animation/tween_interpolaters.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'scene') diff --git a/scene/animation/tween_interpolaters.cpp b/scene/animation/tween_interpolaters.cpp index 5ba9673014..25a27252f5 100644 --- a/scene/animation/tween_interpolaters.cpp +++ b/scene/animation/tween_interpolaters.cpp @@ -262,7 +262,8 @@ namespace cubic { static real_t out(real_t t, real_t b, real_t c, real_t d) { - return c * ((t = t / d - 1) * t * t + 1) + b; + t = t / d - 1; + return c * (t * t * t + 1) + b; } static real_t in_out(real_t t, real_t b, real_t c, real_t d) -- cgit v1.2.3