From 4aa6229698b946e52ce19018aaf13f8b92fb168e Mon Sep 17 00:00:00 2001 From: Vadim Dashevskiy Date: Fri, 15 Jun 2012 14:13:45 +0000 Subject: another portion of "#ifsef Unicode" removal git-svn-id: http://svn.miranda-ng.org/main/trunk@426 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/modules/utils/timezones.cpp | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) (limited to 'src/modules/utils/timezones.cpp') diff --git a/src/modules/utils/timezones.cpp b/src/modules/utils/timezones.cpp index 1fe186d633..c562ce6460 100644 --- a/src/modules/utils/timezones.cpp +++ b/src/modules/utils/timezones.cpp @@ -97,13 +97,7 @@ void FormatTime (const SYSTEMTIME *st, const TCHAR *szFormat, TCHAR *szDest, int void UnixTimeToFileTime(time_t ts, LPFILETIME pft); time_t FileTimeToUnixTime(LPFILETIME pft); -#ifdef _UNICODE #define fnSystemTimeToTzSpecificLocalTime SystemTimeToTzSpecificLocalTime -#else -BOOL MySystemTimeToTzSpecificLocalTime(LPTIME_ZONE_INFORMATION ptzi, LPSYSTEMTIME pstUtc, LPSYSTEMTIME pstLoc); -#define fnSystemTimeToTzSpecificLocalTime MySystemTimeToTzSpecificLocalTime -#endif - static int timeapiGetTimeZoneTime(HANDLE hTZ, SYSTEMTIME *st) { @@ -490,7 +484,6 @@ static INT_PTR TimestampToStringT(WPARAM wParam, LPARAM lParam) return 0; } -#ifdef _UNICODE static INT_PTR TimestampToStringA(WPARAM wParam, LPARAM lParam) { DBTIMETOSTRING *tts = (DBTIMETOSTRING*)lParam; @@ -501,7 +494,6 @@ static INT_PTR TimestampToStringA(WPARAM wParam, LPARAM lParam) WideCharToMultiByte(CP_ACP, 0, szDest, -1, tts->szDest, tts->cbDest, NULL, NULL); return 0; } -#endif void GetLocalizedString(HKEY hSubKey, const TCHAR *szName, wchar_t *szBuf, DWORD cbLen) { @@ -522,15 +514,9 @@ void GetLocalizedString(HKEY hSubKey, const TCHAR *szName, wchar_t *szBuf, DWORD { DWORD dwLength = cbLen * sizeof(wchar_t); -#ifdef _UNICODE + RegQueryValueEx(hSubKey, szName, NULL, NULL, (unsigned char *)szBuf, &dwLength); szBuf[min(dwLength / sizeof(TCHAR), cbLen - 1)] = 0; -#else - char* szBufP = (char*)alloca(dwLength); - RegQueryValueEx(hSubKey, szName, NULL, NULL, (unsigned char *)szBufP, &dwLength); - szBufP[min(dwLength, cbLen * sizeof(wchar_t) - 1)] = 0; - MultiByteToWideChar(CP_ACP, 0, szBufP, -1, szBuf, cbLen); -#endif } } @@ -644,11 +630,9 @@ void InitTimeZones(void) CreateServiceFunction(MS_DB_TIME_TIMESTAMPTOLOCAL, TimestampToLocal); CreateServiceFunction(MS_DB_TIME_TIMESTAMPTOSTRINGT, TimestampToStringT); -#ifdef _UNICODE + CreateServiceFunction(MS_DB_TIME_TIMESTAMPTOSTRING, TimestampToStringA); -#else - CreateServiceFunction(MS_DB_TIME_TIMESTAMPTOSTRING, TimestampToStringT); -#endif + tmi.cbSize = sizeof(tmi); -- cgit v1.2.3