From c74fa69bf682c13b02e4abbd455af7d3bbe47a7e Mon Sep 17 00:00:00 2001 From: Daniel Gibson Date: Thu, 21 Apr 2016 20:30:17 +0200 Subject: [PATCH] gcc told me copysignf() in FloatToInt() didn't do anything. oops. sometimes using GCC *does* find problems clang didn't :) --- Sources/Engine/Math/Functions.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Sources/Engine/Math/Functions.h b/Sources/Engine/Math/Functions.h index d18b962..d164c0c 100755 --- a/Sources/Engine/Math/Functions.h +++ b/Sources/Engine/Math/Functions.h @@ -314,8 +314,7 @@ inline SLONG FloatToInt( FLOAT f) { #if defined(__arm__) || defined(USE_PORTABLE_C) // round to nearest by adding/subtracting 0.5 (depending on f pos/neg) before converting to SLONG - float addToRound = 0.5f; - copysignf(addToRound, f); // copy f's signbit to addToRound => if f<0 then addToRound = -addToRound + float addToRound = copysignf(0.5f, f); // copy f's signbit to 0.5 => if f<0 then addToRound = -0.5, else 0.5 return((SLONG) (f + addToRound)); #elif (defined __MSVC_INLINE__)