diff options
author | Vadim Dashevskiy <watcherhd@gmail.com> | 2012-06-15 20:04:13 +0000 |
---|---|---|
committer | Vadim Dashevskiy <watcherhd@gmail.com> | 2012-06-15 20:04:13 +0000 |
commit | e521b812384a0e93f48e078c6cb248913dcc893a (patch) | |
tree | 13b1de3e9bef13a48af0318f1fd338915dd69e9a /plugins/helpers | |
parent | ae481600939fb5420b80a8a7ef84f0ce9d6b3356 (diff) |
another portion of "#ifsef Unicode" removal
git-svn-id: http://svn.miranda-ng.org/main/trunk@437 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/helpers')
-rw-r--r-- | plugins/helpers/gen_helpers.cpp | 41 |
1 files changed, 9 insertions, 32 deletions
diff --git a/plugins/helpers/gen_helpers.cpp b/plugins/helpers/gen_helpers.cpp index b2e8ff3380..817f1d9f48 100644 --- a/plugins/helpers/gen_helpers.cpp +++ b/plugins/helpers/gen_helpers.cpp @@ -45,11 +45,9 @@ TCHAR *Hlp_GetProtocolName(const char *proto) { if ( (!ProtoServiceExists(proto, PS_GETNAME)) || (CallProtoService(proto, PS_GETNAME, (WPARAM)sizeof(protoname), (LPARAM)protoname)) ) {
return NULL;
}
-#ifdef UNICODE
+
return a2u(protoname);
-#else
- return _strdup(protoname);
-#endif
+
}
char *Hlp_GetDlgItemTextA(HWND hwndDlg, int nIDDlgItem) {
@@ -195,11 +193,9 @@ int AddDebugLogMessage(const TCHAR* fmt, ...) { _tcsncpy(tszFinal, tszText, sizeof(tszFinal));
#endif
-#ifdef UNICODE
+
szFinal = u2a(tszFinal);
-#else
- szFinal = _strdup(tszFinal);
-#endif
+
res = WriteToDebugLogA(szFinal);
free(szFinal);
@@ -242,11 +238,9 @@ int AddErrorLogMessage(const TCHAR* fmt, ...) { _tcsncpy(tszFinal, tszText, sizeof(tszFinal));
#endif
-#ifdef UNICODE
+
szFinal = u2a(tszFinal);
-#else
- szFinal = _strdup(tszFinal);
-#endif
+
res = WriteToDebugLogA(szFinal);
MessageBoxA(NULL, szFinal, "Error", MB_OK|MB_ICONERROR);
free(szFinal);
@@ -268,11 +262,9 @@ TCHAR *itot(int num) { // check this
_itoa(num, tRes, 10);
-#ifdef UNICODE
+
return a2u(tRes);
-#else
- return _strdup(tRes);
-#endif
+
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -427,7 +419,7 @@ int Hlp_UnicodeCheck(char *szPluginName, BOOL bForce, const char *szModule) { if (!CallService(MS_SYSTEM_GETVERSIONTEXT, (WPARAM)sizeof(szVersionText), (LPARAM)szVersionText)) {
ptr = strstr(szVersionText, "Unicode");
-#ifdef UNICODE
+
if ( (ptr == NULL) && (!DBGetContactSettingByte(NULL, szModule, SETTING_NOENCODINGCHECK, 0)) ) {
if (bForce) {
MessageBoxA(NULL, "You are running the ANSI version Miranda. Please use the ANSI build of this plugin.", szPluginName, MB_OK);
@@ -441,21 +433,6 @@ int Hlp_UnicodeCheck(char *szPluginName, BOOL bForce, const char *szModule) { return 0;
}
}
-#else
- if ( (ptr != NULL) && (!DBGetContactSettingByte(NULL, szModule, SETTING_NOENCODINGCHECK, 0)) ) {
- if (bForce) {
- MessageBoxA(NULL, "You are running the UNICODE version Miranda. Please use the UNICODE build of this plugin.", szPluginName, MB_OK);
-
- return -1;
- }
- else {
- MessageBoxA(NULL, "You are running the UNICODE version Miranda. It's recommened to use the UNICODE build of this plugin.", szPluginName, MB_OK);
- DBWriteContactSettingByte(NULL, szModule, SETTING_NOENCODINGCHECK, 1);
-
- return 0;
- }
- }
-#endif
}
#endif
|