diff options
author | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:24:59 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:24:59 +0200 |
commit | a1c91f4695e208d5a8f80dc37b1818169b7829ff (patch) | |
tree | 52f5134376d17c99b6c9e53133a2eb5cf171377c /zen/dst_hack.cpp | |
parent | 5.16 (diff) | |
download | FreeFileSync-a1c91f4695e208d5a8f80dc37b1818169b7829ff.tar.gz FreeFileSync-a1c91f4695e208d5a8f80dc37b1818169b7829ff.tar.bz2 FreeFileSync-a1c91f4695e208d5a8f80dc37b1818169b7829ff.zip |
5.17
Diffstat (limited to 'zen/dst_hack.cpp')
-rw-r--r-- | zen/dst_hack.cpp | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/zen/dst_hack.cpp b/zen/dst_hack.cpp index a70ef13b..887b9b63 100644 --- a/zen/dst_hack.cpp +++ b/zen/dst_hack.cpp @@ -166,10 +166,10 @@ FILETIME utcToLocal(const FILETIME& utcTime) //throw std::runtime_error &utcTime, //__in const FILETIME *lpFileTime, &localTime)) //__out LPFILETIME lpLocalFileTime { - const std::wstring errorMessage = _("Conversion error:") + L" FILETIME -> local FILETIME: " + L"(" + - L"High: " + numberTo<std::wstring>(utcTime.dwHighDateTime) + L" " + - L"Low: " + numberTo<std::wstring>(utcTime.dwLowDateTime) + L") " + L"\n\n" + getLastErrorFormatted(); - throw std::runtime_error(utfCvrtTo<std::string>(errorMessage)); + const std::wstring errorMsg = _("Conversion error:") + L" FILETIME -> local FILETIME: " + L"(" + + L"High: " + numberTo<std::wstring>(utcTime.dwHighDateTime) + L" " + + L"Low: " + numberTo<std::wstring>(utcTime.dwLowDateTime) + L") " + L"\n\n" + formatSystemError(L"FileTimeToLocalFileTime", getLastError()); + throw std::runtime_error(utfCvrtTo<std::string>(errorMsg)); } return localTime; } @@ -184,10 +184,10 @@ FILETIME localToUtc(const FILETIME& localTime) //throw std::runtime_error &localTime, //__in const FILETIME *lpLocalFileTime, &utcTime)) //__out LPFILETIME lpFileTime { - const std::wstring errorMessage = _("Conversion error:") + L" local FILETIME -> FILETIME: " + L"(" + - L"High: " + numberTo<std::wstring>(localTime.dwHighDateTime) + L" " + - L"Low: " + numberTo<std::wstring>(localTime.dwLowDateTime) + L") " + L"\n\n" + getLastErrorFormatted(); - throw std::runtime_error(utfCvrtTo<std::string>(errorMessage)); + const std::wstring errorMsg = _("Conversion error:") + L" local FILETIME -> FILETIME: " + L"(" + + L"High: " + numberTo<std::wstring>(localTime.dwHighDateTime) + L" " + + L"Low: " + numberTo<std::wstring>(localTime.dwLowDateTime) + L") " + L"\n\n" + formatSystemError(L"LocalFileTimeToFileTime", getLastError()); + throw std::runtime_error(utfCvrtTo<std::string>(errorMsg)); } return utcTime; } @@ -286,9 +286,8 @@ std::bitset<UTC_LOCAL_OFFSET_BITS> getUtcLocalShift() if (std::bitset < UTC_LOCAL_OFFSET_BITS - 1 > (absValue).to_ulong() != static_cast<unsigned long>(absValue) || //time shifts that big shouldn't be possible! timeShiftSec % (60 * 15) != 0) //all known time shift have at least 15 minute granularity! { - const std::wstring errorMessage = _("Conversion error:") + L" Unexpected UTC <-> local time shift: " + - L"(" + numberTo<std::wstring>(timeShiftSec) + L") " + L"\n\n" + getLastErrorFormatted(); - throw std::runtime_error(utfCvrtTo<std::string>(errorMessage)); + const std::wstring errorMsg = _("Conversion error:") + L" Unexpected UTC <-> local time shift: " + L"(" + numberTo<std::wstring>(timeShiftSec) + L")"; + throw std::runtime_error(utfCvrtTo<std::string>(errorMsg)); } std::bitset<UTC_LOCAL_OFFSET_BITS> output(absValue); |