summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVadim Dashevskiy <watcherhd@gmail.com>2013-03-13 08:00:41 +0000
committerVadim Dashevskiy <watcherhd@gmail.com>2013-03-13 08:00:41 +0000
commit11fcecff7c310c2cc10bda2ab2fa2daf525be571 (patch)
tree86fb20fc1ce5e243dd9a973f84b9f1ae6a85c1b4
parentcb68918922e0d297cc57c4b00fcc42ceaf141965 (diff)
- another portion of '#ifdef UNICODE' clean up
git-svn-id: http://svn.miranda-ng.org/main/trunk@3993 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--plugins/AvatarHistory/src/AvatarDlg.cpp4
-rw-r--r--plugins/AvatarHistory/src/AvatarHistory.cpp23
-rw-r--r--plugins/Clist_modern/src/hdr/modern_commonheaders.h6
-rw-r--r--plugins/Clist_modern/src/hdr/modern_tstring.h8
-rw-r--r--plugins/MirOTR/MirOTR/src/svcs_srmm.cpp4
-rw-r--r--plugins/MirOTR/MirOTR/src/utils.cpp12
-rw-r--r--plugins/SendScreenshotPlus/src/CSend.cpp4
-rw-r--r--plugins/SendScreenshotPlus/src/UMainForm.cpp7
-rw-r--r--plugins/SendScreenshotPlus/src/Utils.cpp11
-rw-r--r--plugins/SendScreenshotPlus/src/global.h8
-rw-r--r--plugins/SendScreenshotPlus/src/mir_string.h18
-rwxr-xr-xplugins/StopSpamMod/src/globals.h6
-rw-r--r--plugins/StopSpamPlus/src/headers.h10
-rw-r--r--plugins/TrafficCounter/src/statistics.cpp6
-rwxr-xr-xplugins/Watrack_MPD/src/m_music.h10
-rw-r--r--plugins/YAMN/src/browser/mailbrowser.cpp12
16 files changed, 30 insertions, 119 deletions
diff --git a/plugins/AvatarHistory/src/AvatarDlg.cpp b/plugins/AvatarHistory/src/AvatarDlg.cpp
index c79374a1ec..435b8fea6f 100644
--- a/plugins/AvatarHistory/src/AvatarDlg.cpp
+++ b/plugins/AvatarHistory/src/AvatarDlg.cpp
@@ -86,11 +86,7 @@ int OpenAvatarDialog(HANDLE hContact, char* fn)
}
else
{
-#ifdef _UNICODE
MultiByteToWideChar(CP_ACP, 0, fn, -1, avdlg->fn, MAX_REGS(avdlg->fn));
-#else
- lstrcpyn(avdlg->fn, fn, sizeof(avdlg->fn));
-#endif
}
CloseHandle(CreateThread(NULL, 0, AvatarDialogThread, (LPVOID)avdlg, 0, &dwId));
diff --git a/plugins/AvatarHistory/src/AvatarHistory.cpp b/plugins/AvatarHistory/src/AvatarHistory.cpp
index 4c33dfa38a..27b6c3b579 100644
--- a/plugins/AvatarHistory/src/AvatarHistory.cpp
+++ b/plugins/AvatarHistory/src/AvatarHistory.cpp
@@ -315,17 +315,8 @@ void ErrorExit(HANDLE hContact,LPTSTR lpszFunction)
LocalFree(lpDisplayBuf);
}
-#ifdef _UNICODE
-
#define CS "%S"
-#else
-
-#define CS "%s"
-
-#endif
-
-
TCHAR * GetExtension(TCHAR *file)
{
if(file == NULL) return _T("");
@@ -734,13 +725,9 @@ BOOL CreateShortcut(TCHAR *file, TCHAR *shortcut)
if (SUCCEEDED(hr))
{
-#ifdef _UNICODE
+
hr = ppf->Save(shortcut, TRUE);
-#else
- WCHAR tmp[MAX_PATH];
- MultiByteToWideChar(CP_ACP, 0, shortcut, -1, tmp, MAX_PATH);
- hr = ppf->Save(tmp, TRUE);
-#endif
+
ppf->Release();
}
@@ -768,13 +755,7 @@ BOOL ResolveShortcut(TCHAR *shortcut, TCHAR *file)
if (SUCCEEDED(hr))
{
-#ifdef _UNICODE
hr = ppf->Load(shortcut, STGM_READ);
-#else
- WCHAR tmp[MAX_PATH];
- MultiByteToWideChar(CP_ACP, 0, shortcut, -1, tmp, MAX_PATH);
- hr = ppf->Load(tmp, STGM_READ);
-#endif
if (SUCCEEDED(hr))
{
diff --git a/plugins/Clist_modern/src/hdr/modern_commonheaders.h b/plugins/Clist_modern/src/hdr/modern_commonheaders.h
index b8088cc8ff..83bbdbd1dd 100644
--- a/plugins/Clist_modern/src/hdr/modern_commonheaders.h
+++ b/plugins/Clist_modern/src/hdr/modern_commonheaders.h
@@ -182,11 +182,7 @@ int CLUI_ShowWindowMod(HWND hwnd, int cmd);
void MakeButtonSkinned(HWND hWnd);
-#ifdef UNICODE
- #define GSMDF_TCHAR_MY GSMDF_TCHAR|CNF_UNICODE
-#else
- #define GSMDF_TCHAR_MY 0
-#endif
+#define GSMDF_TCHAR_MY GSMDF_TCHAR|CNF_UNICODE
#ifndef LWA_COLORKEY
#define LWA_COLORKEY 0x00000001
diff --git a/plugins/Clist_modern/src/hdr/modern_tstring.h b/plugins/Clist_modern/src/hdr/modern_tstring.h
index 17fc9cf50c..00948179d8 100644
--- a/plugins/Clist_modern/src/hdr/modern_tstring.h
+++ b/plugins/Clist_modern/src/hdr/modern_tstring.h
@@ -4,7 +4,6 @@
#include "MString.h"
-#ifdef UNICODE
typedef CMStringA astring;
typedef CMStringW wstring;
@@ -49,10 +48,3 @@ public:
operator mbstring() { return mbstring( this->c_str()); }
};
-#else
-typedef CMStringA astring;
-typedef CMStringA wstring;
-typedef CMStringA tstring;
-typedef CMStringA mbstring;
-
-#endif
diff --git a/plugins/MirOTR/MirOTR/src/svcs_srmm.cpp b/plugins/MirOTR/MirOTR/src/svcs_srmm.cpp
index d07a47c627..ed17aa29ab 100644
--- a/plugins/MirOTR/MirOTR/src/svcs_srmm.cpp
+++ b/plugins/MirOTR/MirOTR/src/svcs_srmm.cpp
@@ -268,11 +268,7 @@ void InitSRMM() {
OTRButton.dwButtonID = 0;
OTRButton.pszModuleName = MODULENAME;
OTRButton.dwDefPos = 200;
-#ifdef _UNICODE
OTRButton.bbbFlags = BBBF_ISRSIDEBUTTON|BBBF_CANBEHIDDEN|BBBF_ISIMBUTTON;
-#else
- OTRButton.bbbFlags = BBBF_ISRSIDEBUTTON|BBBF_CANBEHIDDEN|BBBF_ISIMBUTTON|BBBF_ANSITOOLTIP;
-#endif
OTRButton.ptszTooltip = TranslateT(LANG_OTR_TOOLTIP);
OTRButton.hIcon = GetIconHandle(ICON_NOT_PRIVATE);
HookEvent(ME_MSG_TOOLBARLOADED, SVC_ButtonsBarLoaded);
diff --git a/plugins/MirOTR/MirOTR/src/utils.cpp b/plugins/MirOTR/MirOTR/src/utils.cpp
index af8d43673b..fcd18ba98e 100644
--- a/plugins/MirOTR/MirOTR/src/utils.cpp
+++ b/plugins/MirOTR/MirOTR/src/utils.cpp
@@ -230,11 +230,9 @@ void ShowWarning(TCHAR *msg) {
sn.szProto= MODULENAME;
sn.tszInfoTitle = buffer;
sn.tszInfo = msg;
-#ifdef _UNICODE
+
sn.dwInfoFlags = NIIF_WARNING | NIIF_INTERN_UNICODE;
-#else
- sn.dwInfoFlags = NIIF_WARNING;
-#endif
+
sn.uTimeout = 10;
CallService(MS_CLIST_SYSTRAY_NOTIFY, 0, (LPARAM)&sn);
@@ -276,11 +274,9 @@ void ShowError(TCHAR *msg) {
sn.szProto = MODULENAME;
sn.tszInfoTitle = buffer;
sn.tszInfo = msg;
-#ifdef _UNICODE
+
sn.dwInfoFlags = NIIF_ERROR | NIIF_INTERN_UNICODE;
-#else
- sn.dwInfoFlags = NIIF_ERROR;
-#endif
+
sn.uTimeout = 10;
CallService(MS_CLIST_SYSTRAY_NOTIFY, 0, (LPARAM)&sn);
diff --git a/plugins/SendScreenshotPlus/src/CSend.cpp b/plugins/SendScreenshotPlus/src/CSend.cpp
index cd874e152e..7251cde058 100644
--- a/plugins/SendScreenshotPlus/src/CSend.cpp
+++ b/plugins/SendScreenshotPlus/src/CSend.cpp
@@ -295,9 +295,7 @@ void CSend::DB_EventAdd(WORD EventType) {
dbei.eventType = EventType;
dbei.flags = DBEF_SENT;
dbei.timestamp = time(NULL);
- #if defined( _UNICODE )
- dbei.flags |= DBEF_UTF;
- #endif
+ dbei.flags |= DBEF_UTF;
dbei.cbBlob= m_cbEventMsg;
dbei.pBlob=(PBYTE)m_szEventMsg;
diff --git a/plugins/SendScreenshotPlus/src/UMainForm.cpp b/plugins/SendScreenshotPlus/src/UMainForm.cpp
index ecfb61b2e2..229f19ac37 100644
--- a/plugins/SendScreenshotPlus/src/UMainForm.cpp
+++ b/plugins/SendScreenshotPlus/src/UMainForm.cpp
@@ -1085,13 +1085,10 @@ INT_PTR TfrmMain::SaveScreenshot(FIBITMAP* dib) {
TCHAR pszFormat[6];
ComboBox_GetText(hwndCombo, pszFormat, 6);
if(ret && (_tcsicmp (pszFormat,_T("png")) != 0)) {
- #if defined(_UNICODE)
+
fif = FIP->FI_GetFIFFromFilenameU(ret);
dib_new = FIP->FI_LoadU(fif, ret,0);
- #else
- fif = FIP->FI_GetFIFFromFilenameU(ret);
- dib_new = FIP->FI_Load(fif, ret,0);
- #endif
+
if(dib_new) {
DeleteFile(ret);
diff --git a/plugins/SendScreenshotPlus/src/Utils.cpp b/plugins/SendScreenshotPlus/src/Utils.cpp
index ab74f569a1..3758c1e18e 100644
--- a/plugins/SendScreenshotPlus/src/Utils.cpp
+++ b/plugins/SendScreenshotPlus/src/Utils.cpp
@@ -338,21 +338,14 @@ LPTSTR SaveImage(FREE_IMAGE_FORMAT fif, FIBITMAP* dib, LPTSTR pszFilename, LPTST
}
if(fif==FIF_UNKNOWN) {
- #if defined(_UNICODE)
fif = FIP->FI_GetFIFFromFilenameU(pszFile);
- #else
- fif = FIP->FI_GetFIFFromFilename(pszFile);
- #endif
}
if(FIP->FI_FIFSupportsICCProfiles(fif)) {
bool bDummy = true;
}
- #if defined(_UNICODE)
- ret = FIP->FI_SaveU(fif, dib, pszFile, flag);
- #else
- ret = FIP->FI_Save(fif, dib, pszFile, flag);
- #endif
+ ret = FIP->FI_SaveU(fif, dib, pszFile, flag);
+
mir_free(FileExt);
diff --git a/plugins/SendScreenshotPlus/src/global.h b/plugins/SendScreenshotPlus/src/global.h
index 4d773e4258..b6301a8caf 100644
--- a/plugins/SendScreenshotPlus/src/global.h
+++ b/plugins/SendScreenshotPlus/src/global.h
@@ -153,11 +153,9 @@ std::basic_string<_Elem> replace(const std::basic_string<_Elem> & Origninal, con
#define MBS_DOWNARROW 0x00008000L // has arrow on the right
#define MBF_UNICODE 1
-#ifdef _UNICODE
- #define MBF_TCHAR MBF_UNICODE
-#else
- #define MBF_TCHAR 0
-#endif
+
+#define MBF_TCHAR MBF_UNICODE
+
// BUTTONADDTOOLTIP
// use lParam=MBF_UNICODE to set unicode tooltips
diff --git a/plugins/SendScreenshotPlus/src/mir_string.h b/plugins/SendScreenshotPlus/src/mir_string.h
index a9d485f3cc..00f4088056 100644
--- a/plugins/SendScreenshotPlus/src/mir_string.h
+++ b/plugins/SendScreenshotPlus/src/mir_string.h
@@ -29,7 +29,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define mir_wcsdup mir_wstrdup
-#ifdef _UNICODE
+
#define mir_tcslen mir_wcslen
#define mir_tcscpy mir_wcscpy
#define mir_tcsncpy mir_wcsncpy
@@ -43,21 +43,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define mir_tcsrchr mir_wcsrchr
#define mir_tcsncat_c mir_wcsncat_c
#define mir_tcsadd mir_wcsadd
-#else
- #define mir_tcslen mir_strlen
- #define mir_tcscpy mir_strcpy
- #define mir_tcsncpy mir_strncpy
- #define mir_tcsncat mir_strncat
- #define mir_tcsdup mir_strdup
- #define mir_tcscmp mir_strcmp
- #define mir_tcsncmp mir_strncmp
- #define mir_tcsicmp mir_stricmp
- #define mir_tcsnicmp mir_strnicmp
- #define mir_tcschr mir_strchr
- #define mir_tcsrchr mir_strrchr
- #define mir_tcsncat_c mir_strncat_c
- #define mir_tcsadd mir_stradd
-#endif
+
#define mir_strlen(s) (((s)!=0)?strlen(s):0)
diff --git a/plugins/StopSpamMod/src/globals.h b/plugins/StopSpamMod/src/globals.h
index 790458e6bc..8c5912c223 100755
--- a/plugins/StopSpamMod/src/globals.h
+++ b/plugins/StopSpamMod/src/globals.h
@@ -10,11 +10,7 @@ char const * questCountSetting = "QuestionCount";
TCHAR const * defAufrepl = _T("StopSpam: send a message and reply to a anti-spam bot question.");*/
-#ifdef _UNICODE
+
typedef std::wstring tstring;
#define PREF_TCHAR2 PREF_UTF
-#else
-typedef std::string tstring;
-#define PREF_TCHAR2 0
-#endif //_UNICODE
diff --git a/plugins/StopSpamPlus/src/headers.h b/plugins/StopSpamPlus/src/headers.h
index a9966fda87..3084a6d007 100644
--- a/plugins/StopSpamPlus/src/headers.h
+++ b/plugins/StopSpamPlus/src/headers.h
@@ -21,13 +21,9 @@
#include <m_stopspam.h>
#include <m_variables.h>
-#ifdef _UNICODE
- typedef std::wstring tstring;
- #define PREF_TCHAR2 PREF_UTF
-#else
- typedef std::string tstring;
- #define PREF_TCHAR2 0
-#endif //_UNICODE
+
+typedef std::wstring tstring;
+#define PREF_TCHAR2 PREF_UTF
#include "eventhooker.h"
#include "version.h"
diff --git a/plugins/TrafficCounter/src/statistics.cpp b/plugins/TrafficCounter/src/statistics.cpp
index a2f555cdd3..3e45fe5312 100644
--- a/plugins/TrafficCounter/src/statistics.cpp
+++ b/plugins/TrafficCounter/src/statistics.cpp
@@ -78,11 +78,9 @@ INT_PTR CALLBACK DlgProcOptStatistics(HWND hwndDlg, UINT msg, WPARAM wParam, LPA
LVCOLUMN lvc ={0};
SendDlgItemMessage(hwndDlg, IDC_LIST_DATA, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, LVS_EX_FULLROWSELECT);
-#ifdef UNICODE
+
SendDlgItemMessage(hwndDlg, IDC_LIST_DATA, LVM_SETUNICODEFORMAT, 1, 0);
-#else
- SendDlgItemMessage(hwndDlg, IDC_LIST_DATA, LVM_SETUNICODEFORMAT, 0, 0);
-#endif
+
lvc.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
lvc.fmt = LVCFMT_LEFT;
diff --git a/plugins/Watrack_MPD/src/m_music.h b/plugins/Watrack_MPD/src/m_music.h
index 4b33881f06..283910dfce 100755
--- a/plugins/Watrack_MPD/src/m_music.h
+++ b/plugins/Watrack_MPD/src/m_music.h
@@ -74,13 +74,9 @@ typedef struct tSongInfo {
wchar_t *url;
} SONGINFO, *LPSONGINFO;
-#if defined(_UNICODE)
- #define WAT_INF_TCHAR WAT_INF_UNICODE
- #define SongInfoT tSongInfo
-#else
- #define WAT_INF_TCHAR WAT_INF_ANSI
- #define SongInfoT tSongInfoA
-#endif
+#define WAT_INF_TCHAR WAT_INF_UNICODE
+#define SongInfoT tSongInfo
+
// result codes
#define WAT_RES_UNKNOWN -2
diff --git a/plugins/YAMN/src/browser/mailbrowser.cpp b/plugins/YAMN/src/browser/mailbrowser.cpp
index cdbb4e2d3c..0a79b2be62 100644
--- a/plugins/YAMN/src/browser/mailbrowser.cpp
+++ b/plugins/YAMN/src/browser/mailbrowser.cpp
@@ -1624,11 +1624,9 @@ INT_PTR CALLBACK DlgProcYAMNShowMessage(HWND hDlg,UINT msg,WPARAM wParam,LPARAM
else courPos += _stprintf( &buff[courPos], _T("\t%s\r\n"), headvalue);
}
GlobalUnlock(hData);
-#if defined( _UNICODE )
+
SetClipboardData(CF_UNICODETEXT,hData);
-#else
- SetClipboardData(CF_TEXT,hData);
-#endif
+
CloseClipboard();
}
}
@@ -2411,11 +2409,9 @@ INT_PTR CALLBACK DlgProcYAMNMailBrowser(HWND hDlg,UINT msg,WPARAM wParam,LPARAM
courPos += _stprintf(&buff[courPos], _T("%s\t%s\t%s\t%s\r\n"), from, subject, size, date);
}
GlobalUnlock(hData);
-#if defined( _UNICODE )
+
SetClipboardData(CF_UNICODETEXT,hData);
-#else
- SetClipboardData(CF_TEXT,hData);
-#endif
+
CloseClipboard();
}
}