Closed Manuel-K closed 8 years ago
Works for me, thanks.
this breaks compilation on my system, at least with clang (haven't tried gcc).
floor()
and log10()
return double, why would you change the other argument to float (2.0f
instead of 2.0
) then? Or, why does gcc 6.1.1 not like the original code? does it use some overloaded version of floor()
that also supports float or something like that?
Maybe floorf()
and log10f()
should be used?
Very strange.
They do return a float on my system which makes the template explode. Your right, it does seems strange. floor
and log10
should return doubles. I only looked at the error message when I made this fix.
I've just compiled it with clang and it does work without problems. If I revert the changes, it even breaks compilation with clang:
/somewhere/Serious-Engine/Sources/EntitiesMP/Player.es:5384:21: error: no matching function for call to 'ClampDn'
FLOAT fTimeDelta = ClampDn (floor (m_tmEstTime ) - floor (tmLevelTime ) , 0.0);
^~~~~~~
/somewhere/Serious-Engine/Sources/./Engine/Math/Functions.h:85:13: note: candidate template ignored: deduced conflicting types for parameter 'Type'
('float' vs. 'double')
inline Type ClampDn( const Type x, const Type dnlimit)
I needed to make these changes to compile the project with gcc 6.1.1 on Arch Linux.