diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-04-09 14:27:30 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-04-09 18:57:00 +0000 |
commit | 91b914882948c6acbb2dd6442083b8c6ccd9cf17 (patch) | |
tree | f0fd12aff18c9918b0fcd6adce52caf4ba9091a7 /tools | |
parent | d6398719abecfca60db37637490e602222992dc2 (diff) |
Change tools::Time::GetSystemTicks to sal_uInt64
...as follow-up clean-up after 71fefe1dc2bcda3a4cc18d71e1acaf161cc059f2 "Change
'blink times' to be of type sal_uInt64 and thus consistent with
Timer::Get/SetTimeout since 9c7016b5b530ca212b1275f44f9e2fc0527109ee 'Scheduler:
Changed uLong to uInt32/uInt64.'"
Transitively meant to change quite a number of further time-related places from
sal_uLong/sal_uIntPtr to consistently use sal_uInt64.
Change-Id: I38eb493943906356138bf58eb098d2f54a3dee34
Reviewed-on: https://gerrit.libreoffice.org/15214
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/source/datetime/ttime.cxx | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/tools/source/datetime/ttime.cxx b/tools/source/datetime/ttime.cxx index 6f764569d490..455c4a90ae19 100644 --- a/tools/source/datetime/ttime.cxx +++ b/tools/source/datetime/ttime.cxx @@ -363,9 +363,9 @@ Time tools::Time::GetUTCOffset() aTime = -aTime; return aTime; #else - static sal_uIntPtr nCacheTicks = 0; + static sal_uInt64 nCacheTicks = 0; static sal_Int32 nCacheSecOffset = -1; - sal_uIntPtr nTicks = tools::Time::GetSystemTicks(); + sal_uInt64 nTicks = tools::Time::GetSystemTicks(); time_t nTime; tm aTM; sal_Int32 nLocalTime; @@ -404,7 +404,7 @@ Time tools::Time::GetUTCOffset() #endif } -sal_uIntPtr tools::Time::GetSystemTicks() +sal_uInt64 tools::Time::GetSystemTicks() { #if defined WNT static LARGE_INTEGER nTicksPerSecond; @@ -418,7 +418,8 @@ sal_uIntPtr tools::Time::GetSystemTicks() LARGE_INTEGER nPerformanceCount; QueryPerformanceCounter(&nPerformanceCount); - return (sal_uIntPtr)((nPerformanceCount.QuadPart*1000)/nTicksPerSecond.QuadPart); + return static_cast<sal_uInt64>( + (nPerformanceCount.QuadPart*1000)/nTicksPerSecond.QuadPart); #else timeval tv; gettimeofday (&tv, 0); @@ -427,8 +428,8 @@ sal_uIntPtr tools::Time::GetSystemTicks() fTicks *= 1000; fTicks += ((tv.tv_usec + 500) / 1000); - fTicks = fmod (fTicks, double(ULONG_MAX)); - return sal_uIntPtr(fTicks); + fTicks = fmod (fTicks, double(SAL_MAX_UINT64)); + return static_cast<sal_uInt64>(fTicks); #endif } |