diff options
Diffstat (limited to 'tools/source')
-rw-r--r-- | tools/source/datetime/ttime.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/source/datetime/ttime.cxx b/tools/source/datetime/ttime.cxx index c6c89c934886..ee9e427205ef 100644 --- a/tools/source/datetime/ttime.cxx +++ b/tools/source/datetime/ttime.cxx @@ -477,11 +477,12 @@ sal_uInt64 tools::Time::GetMonotonicTicks() #if defined(_POSIX_TIMERS) struct timespec currentTime; clock_gettime( CLOCK_MONOTONIC, ¤tTime ); - nMicroSeconds = currentTime.tv_sec * 1000 * 1000 + currentTime.tv_nsec / 1000; + nMicroSeconds + = static_cast<sal_uInt64>(currentTime.tv_sec) * 1000 * 1000 + currentTime.tv_nsec / 1000; #else struct timeval currentTime; gettimeofday( ¤tTime, nullptr ); - nMicroSeconds = currentTime.tv_sec * 1000 * 1000 + currentTime.tv_usec; + nMicroSeconds = static_cast<sal_uInt64>(currentTime.tv_sec) * 1000 * 1000 + currentTime.tv_usec; #endif #endif // __MACH__ return nMicroSeconds; |