summaryrefslogtreecommitdiff
path: root/src/modules/utils/timezones.cpp
diff options
context:
space:
mode:
authorVadim Dashevskiy <watcherhd@gmail.com>2012-06-15 14:13:45 +0000
committerVadim Dashevskiy <watcherhd@gmail.com>2012-06-15 14:13:45 +0000
commit4aa6229698b946e52ce19018aaf13f8b92fb168e (patch)
tree29334e8c5ee492a80f11a97fedab2373b8fbb392 /src/modules/utils/timezones.cpp
parent5e8e561a80d1ac9ca1c2f1c3d388105733ed4e4e (diff)
another portion of "#ifsef Unicode" removal
git-svn-id: http://svn.miranda-ng.org/main/trunk@426 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/utils/timezones.cpp')
-rw-r--r--src/modules/utils/timezones.cpp22
1 files changed, 3 insertions, 19 deletions
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);