address windows compiler warnings
This commit is contained in:
@@ -170,16 +170,16 @@ auto download_type_to_string(const download_type &type) -> std::string {
|
||||
// https://www.frenk.com/2009/12/convert-filetime-to-unix-timestamp/
|
||||
auto filetime_to_unix_time(const FILETIME &ft) -> remote::file_time {
|
||||
LARGE_INTEGER date{};
|
||||
date.HighPart = ft.dwHighDateTime;
|
||||
date.HighPart = static_cast<LONG>(ft.dwHighDateTime);
|
||||
date.LowPart = ft.dwLowDateTime;
|
||||
date.QuadPart -= 116444736000000000ULL;
|
||||
date.QuadPart -= 116444736000000000LL;
|
||||
|
||||
return date.QuadPart * 100ULL;
|
||||
return static_cast<remote::file_time>(date.QuadPart) * 100ULL;
|
||||
}
|
||||
|
||||
void unix_time_to_filetime(const remote::file_time &ts, FILETIME &ft) {
|
||||
const auto win_time = (ts / 100ULL) + 116444736000000000ULL;
|
||||
ft.dwHighDateTime = win_time >> 32U;
|
||||
ft.dwHighDateTime = static_cast<DWORD>(win_time >> 32U);
|
||||
ft.dwLowDateTime = win_time & 0xFFFFFFFF;
|
||||
}
|
||||
#endif
|
||||
@@ -216,7 +216,8 @@ auto get_file_time_now() -> std::uint64_t {
|
||||
::GetSystemTime(&st);
|
||||
FILETIME ft{};
|
||||
::SystemTimeToFileTime(&st, &ft);
|
||||
return static_cast<std::uint64_t>(((LARGE_INTEGER *)&ft)->QuadPart);
|
||||
return static_cast<std::uint64_t>(
|
||||
(reinterpret_cast<LARGE_INTEGER *>(&ft))->QuadPart);
|
||||
#else
|
||||
return get_time_now();
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user