diff options
author | Daniel Wilhelm <daniel@wili.li> | 2015-10-02 14:53:20 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2015-10-02 14:53:20 +0200 |
commit | 94db751716dd2851f99b5c4c2981da1d1f4780f8 (patch) | |
tree | e4ffc9f5ae2b2873f267a6e5d3d2092c8aad49a7 /zen/int64.h | |
parent | 6.10 (diff) | |
download | FreeFileSync-94db751716dd2851f99b5c4c2981da1d1f4780f8.tar.gz FreeFileSync-94db751716dd2851f99b5c4c2981da1d1f4780f8.tar.bz2 FreeFileSync-94db751716dd2851f99b5c4c2981da1d1f4780f8.zip |
6.11
Diffstat (limited to 'zen/int64.h')
-rw-r--r-- | zen/int64.h | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/zen/int64.h b/zen/int64.h index 4183c8da..671f3372 100644 --- a/zen/int64.h +++ b/zen/int64.h @@ -18,29 +18,29 @@ namespace zen { #ifdef ZEN_WIN inline - std::int64_t get64BitInt(DWORD low, LONG high) - { - static_assert(sizeof(low) + sizeof(high) == sizeof(std::int64_t), ""); +std::int64_t get64BitInt(DWORD low, LONG high) +{ + static_assert(sizeof(low) + sizeof(high) == sizeof(std::int64_t), ""); - LARGE_INTEGER cvt = {}; - cvt.LowPart = low; - cvt.HighPart = high; - return cvt.QuadPart; - } + LARGE_INTEGER cvt = {}; + cvt.LowPart = low; + cvt.HighPart = high; + return cvt.QuadPart; +} std::int64_t get64BitInt(std::uint64_t low, std::int64_t high) = delete; inline std::uint64_t get64BitUInt(DWORD low, DWORD high) - { - static_assert(sizeof(low) + sizeof(high) == sizeof(std::uint64_t), ""); +{ + static_assert(sizeof(low) + sizeof(high) == sizeof(std::uint64_t), ""); - ULARGE_INTEGER cvt = {}; - cvt.LowPart = low; - cvt.HighPart = high; - return cvt.QuadPart; - } + ULARGE_INTEGER cvt = {}; + cvt.LowPart = low; + cvt.HighPart = high; + return cvt.QuadPart; +} std::int64_t get64BitUInt(std::uint64_t low, std::uint64_t high) = delete; @@ -52,15 +52,15 @@ std::int64_t get64BitUInt(std::uint64_t low, std::uint64_t high) = delete; inline std::int64_t filetimeToTimeT(const FILETIME& ft) { - return static_cast<std::int64_t>(get64BitUInt(ft.dwLowDateTime, ft.dwHighDateTime) / 10000000U) - get64BitInt(3054539008UL, 2); //caveat: signed/unsigned arithmetics! + return static_cast<std::int64_t>(get64BitUInt(ft.dwLowDateTime, ft.dwHighDateTime) / 10000000U) - get64BitInt(3054539008UL, 2); //caveat: signed/unsigned arithmetics! //timeshift between ansi C time and FILETIME in seconds == 11644473600s } inline FILETIME timetToFileTime(std::int64_t utcTime) -{ - ULARGE_INTEGER cvt = {}; - cvt.QuadPart = (utcTime + get64BitInt(3054539008UL, 2)) * 10000000U; //caveat: signed/unsigned arithmetics! +{ + ULARGE_INTEGER cvt = {}; + cvt.QuadPart = (utcTime + get64BitInt(3054539008UL, 2)) * 10000000U; //caveat: signed/unsigned arithmetics! const FILETIME output = { cvt.LowPart, cvt.HighPart }; return output; |