From b30d3d86d885ee195b28adfce3570f2c415c4096 Mon Sep 17 00:00:00 2001 From: Daniel Gibson Date: Mon, 30 May 2016 01:06:10 +0200 Subject: [PATCH] Fix compilation from changes for GCC 6.1.1 At least on my system floor() and log10() return double, so the other arguments to Clamp() and ClampDn() didn't match anymore, now being float instead of double. I replaced the calls to log10f() and floorf() to avoid any ambiguities. --- Sources/Entities/Bullet.es | 2 +- Sources/Entities/Player.es | 2 +- Sources/EntitiesMP/Common/Common.cpp | 2 +- Sources/EntitiesMP/Player.es | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Sources/Entities/Bullet.es b/Sources/Entities/Bullet.es index 2c7c990..c245f8d 100644 --- a/Sources/Entities/Bullet.es +++ b/Sources/Entities/Bullet.es @@ -344,7 +344,7 @@ functions: GetNormalComponent( vDistance/fDistance, vHitNormal, ese.vDirection); FLOAT fLength = ese.vDirection.Length(); fLength = Clamp( fLength*3, 1.0f, 3.0f); - fDistance = Clamp( log10(fDistance), 0.5f, 2.0f); + fDistance = Clamp( log10f(fDistance), 0.5f, 2.0f); ese.vStretch = FLOAT3D( fDistance, fLength*fDistance, 1.0f); SpawnEffect(vHitPoint, ese); } diff --git a/Sources/Entities/Player.es b/Sources/Entities/Player.es index 2a09bff..e62c7f3 100644 --- a/Sources/Entities/Player.es +++ b/Sources/Entities/Player.es @@ -4588,7 +4588,7 @@ void TeleportPlayer(enum WorldLinkType EwltType) TIME tmLevelTime = _pTimer->CurrentTick()-m_tmLevelStarted; m_psLevelStats.ps_tmTime = tmLevelTime; m_psGameStats.ps_tmTime += tmLevelTime; - FLOAT fTimeDelta = ClampDn(floor(m_tmEstTime)-floor(tmLevelTime), 0.0f); + FLOAT fTimeDelta = ClampDn(floorf(m_tmEstTime)-floorf(tmLevelTime), 0.0f); m_iTimeScore = floor(fTimeDelta*100.0f); m_psLevelStats.ps_iScore+=m_iTimeScore; m_psGameStats.ps_iScore+=m_iTimeScore; diff --git a/Sources/EntitiesMP/Common/Common.cpp b/Sources/EntitiesMP/Common/Common.cpp index 75dd98e..14d23db 100755 --- a/Sources/EntitiesMP/Common/Common.cpp +++ b/Sources/EntitiesMP/Common/Common.cpp @@ -386,7 +386,7 @@ void SpawnHitTypeEffect(CEntity *pen, enum BulletHitType bhtType, BOOL bSound, F GetNormalComponent( vDistance/fDistance, vHitNormal, ese.vDirection); FLOAT fLength = ese.vDirection.Length(); fLength = Clamp( fLength*3, 1.0f, 3.0f); - fDistance = Clamp( log10(fDistance), 0.5f, 2.0f); + fDistance = Clamp( log10f(fDistance), 0.5f, 2.0f); ese.vStretch = FLOAT3D( fDistance, fLength*fDistance, 1.0f); try { diff --git a/Sources/EntitiesMP/Player.es b/Sources/EntitiesMP/Player.es index 02067a9..505a270 100755 --- a/Sources/EntitiesMP/Player.es +++ b/Sources/EntitiesMP/Player.es @@ -5381,7 +5381,7 @@ functions: TIME tmLevelTime = _pTimer->CurrentTick()-m_tmLevelStarted; m_psLevelStats.ps_tmTime = tmLevelTime; m_psGameStats.ps_tmTime += tmLevelTime; - FLOAT fTimeDelta = ClampDn(floor(m_tmEstTime)-floor(tmLevelTime), 0.0f); + FLOAT fTimeDelta = ClampDn(floorf(m_tmEstTime)-floorf(tmLevelTime), 0.0f); m_iTimeScore = (INDEX) floor(fTimeDelta*100.0f); m_psLevelStats.ps_iScore+=m_iTimeScore; m_psGameStats.ps_iScore+=m_iTimeScore;