Skip to content

Commit

Permalink
Fix compilation from changes for GCC 6.1.1
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
DanielGibson committed May 29, 2016
1 parent 4b0e011 commit b30d3d8
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Sources/Entities/Bullet.es
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/Entities/Player.es
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion Sources/EntitiesMP/Common/Common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
2 changes: 1 addition & 1 deletion Sources/EntitiesMP/Player.es
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit b30d3d8

Please sign in to comment.