diff --git a/OgreMain/src/Android/OgreTimer.cpp b/OgreMain/src/Android/OgreTimer.cpp index 0fd92ee1535..add813c9e85 100644 --- a/OgreMain/src/Android/OgreTimer.cpp +++ b/OgreMain/src/Android/OgreTimer.cpp @@ -53,8 +53,8 @@ uint64 Timer::getMilliseconds() { struct timeval now; gettimeofday( &now, NULL ); - return static_cast( now.tv_sec - start.tv_sec ) * 1000 + - static_cast( now.tv_usec - start.tv_usec ) / 1000; + return static_cast( now.tv_sec - start.tv_sec ) * 1000ul + + static_cast( ( now.tv_usec - start.tv_usec ) / 1000l ); } //--------------------------------------------------------------------------------// @@ -62,7 +62,7 @@ uint64 Timer::getMicroseconds() { struct timeval now; gettimeofday( &now, NULL ); - return static_cast( now.tv_sec - start.tv_sec ) * 1000000 + + return static_cast( now.tv_sec - start.tv_sec ) * 1000000ul + static_cast( now.tv_usec - start.tv_usec ); } diff --git a/OgreMain/src/iOS/OgreTimer.cpp b/OgreMain/src/iOS/OgreTimer.cpp index 6de2641abc1..add813c9e85 100644 --- a/OgreMain/src/iOS/OgreTimer.cpp +++ b/OgreMain/src/iOS/OgreTimer.cpp @@ -53,8 +53,8 @@ uint64 Timer::getMilliseconds() { struct timeval now; gettimeofday( &now, NULL ); - return static_cast( now.tv_sec - start.tv_sec ) * 1000 + - static_cast( ( now.tv_usec - start.tv_usec ) / 1000 ); + return static_cast( now.tv_sec - start.tv_sec ) * 1000ul + + static_cast( ( now.tv_usec - start.tv_usec ) / 1000l ); } //--------------------------------------------------------------------------------// @@ -62,7 +62,7 @@ uint64 Timer::getMicroseconds() { struct timeval now; gettimeofday( &now, NULL ); - return static_cast( now.tv_sec - start.tv_sec ) * 1000000 + + return static_cast( now.tv_sec - start.tv_sec ) * 1000000ul + static_cast( now.tv_usec - start.tv_usec ); }