From da1b2d505219ea89a575b78fb50f3aea11fd4ba2 Mon Sep 17 00:00:00 2001 From: Steve Checkoway Date: Sat, 10 May 2008 06:50:57 +0000 Subject: [PATCH] Fix warnings about shortening 64 bits to 32 bits. --- stepmania/src/RageTimer.cpp | 4 ++-- stepmania/src/RageTypes.cpp | 8 ++++---- stepmania/src/arch/Sound/RageSoundDriver.h | 2 +- stepmania/src/arch/Sound/RageSoundDriver_AU.cpp | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/stepmania/src/RageTimer.cpp b/stepmania/src/RageTimer.cpp index 5347cef9a8..1e06fc5380 100644 --- a/stepmania/src/RageTimer.cpp +++ b/stepmania/src/RageTimer.cpp @@ -49,12 +49,12 @@ static uint64_t GetTime( bool bAccurate ) float RageTimer::GetTimeSinceStart( bool bAccurate ) { - uint64_t usecs = GetTime( bAccurate ); + int64_t usecs = GetTime( bAccurate ); usecs -= g_iStartTime; // HACK: VC6 can't cast u64 to a double, but it can cast a i64 to a double. // We can afford to lose one bit of precision since these numbers will // never overflow a 64 int. - return (int64_t)usecs / 1000000.f; + return float( double(usecs) / 1000000. ); } void RageTimer::Touch() diff --git a/stepmania/src/RageTypes.cpp b/stepmania/src/RageTypes.cpp index 14b28e2f7e..446fa7864b 100644 --- a/stepmania/src/RageTypes.cpp +++ b/stepmania/src/RageTypes.cpp @@ -26,13 +26,13 @@ void RageColor::FromStack( lua_State *L, int iPos ) int iFrom = lua_gettop( L ); lua_rawgeti( L, iFrom, 1 ); - r = lua_tonumber( L, -1 ); + r = (float)lua_tonumber( L, -1 ); lua_rawgeti( L, iFrom, 2 ); - g = lua_tonumber( L, -1 ); + g = (float)lua_tonumber( L, -1 ); lua_rawgeti( L, iFrom, 3 ); - b = lua_tonumber( L, -1 ); + b = (float)lua_tonumber( L, -1 ); lua_rawgeti( L, iFrom, 4 ); - a = lua_tonumber( L, -1 ); + a = (float)lua_tonumber( L, -1 ); lua_pop( L, 5 ); } diff --git a/stepmania/src/arch/Sound/RageSoundDriver.h b/stepmania/src/arch/Sound/RageSoundDriver.h index 3f1467b0ac..2c8696d4a8 100644 --- a/stepmania/src/arch/Sound/RageSoundDriver.h +++ b/stepmania/src/arch/Sound/RageSoundDriver.h @@ -150,7 +150,7 @@ private: float *m_BufferNext; // beginning of the unread data int m_FramesInBuffer; // total number of frames at m_BufferNext int64_t m_iPosition; // stream frame of m_BufferNext - sound_block() { m_FramesInBuffer = m_iPosition = 0; m_BufferNext = m_Buffer; } + sound_block() { m_FramesInBuffer = 0; m_iPosition = 0; m_BufferNext = m_Buffer; } }; struct Sound diff --git a/stepmania/src/arch/Sound/RageSoundDriver_AU.cpp b/stepmania/src/arch/Sound/RageSoundDriver_AU.cpp index 569a988229..f4fe4317a0 100644 --- a/stepmania/src/arch/Sound/RageSoundDriver_AU.cpp +++ b/stepmania/src/arch/Sound/RageSoundDriver_AU.cpp @@ -326,7 +326,7 @@ float RageSoundDriver_AU::GetPlayLatency() const bufferSize += frames; } while( false ); - return bufferSize / sampleRate; + return float( bufferSize / sampleRate ); }