Commit d0cfa44c authored by Max Kellermann's avatar Max Kellermann

time/FileTime: use ToUint64() in DeltaFileTimeS()

parent 5bae6946
...@@ -61,16 +61,10 @@ FileTimeToChrono(FILETIME ft) noexcept ...@@ -61,16 +61,10 @@ FileTimeToChrono(FILETIME ft) noexcept
return std::chrono::system_clock::from_time_t(FileTimeToTimeT(ft)); return std::chrono::system_clock::from_time_t(FileTimeToTimeT(ft));
} }
gcc_const constexpr std::chrono::seconds
inline std::chrono::seconds
DeltaFileTimeS(FILETIME a, FILETIME b) noexcept DeltaFileTimeS(FILETIME a, FILETIME b) noexcept
{ {
ULARGE_INTEGER a2, b2; return std::chrono::seconds((ToUint64(a) - ToUint64(b)) / 10000000);
b2.LowPart = b.dwLowDateTime;
b2.HighPart = b.dwHighDateTime;
a2.LowPart = a.dwLowDateTime;
a2.HighPart = a.dwHighDateTime;
return std::chrono::seconds((a2.QuadPart - b2.QuadPart) / 10000000);
} }
#endif #endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment