From e4677c9f8b12bfc4c2242cb711cbe07afc37aa2a Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Sat, 23 Jul 2005 00:33:17 +0000 Subject: [PATCH] better fix for VC6 "can't cast u64 to double" --- stepmania/src/RageTimer.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/stepmania/src/RageTimer.cpp b/stepmania/src/RageTimer.cpp index e08bcda66c..f493e59bb5 100644 --- a/stepmania/src/RageTimer.cpp +++ b/stepmania/src/RageTimer.cpp @@ -45,8 +45,10 @@ float RageTimer::GetTimeSinceStart( bool bAccurate ) { uint64_t usecs = GetTime( bAccurate ); usecs -= g_iStartTime; - uint32_t ret = usecs / 1000000; - return (float)ret; + // 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; } void RageTimer::Touch()