summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorVadim Dashevskiy <watcherhd@gmail.com>2012-06-16 14:51:46 +0000
committerVadim Dashevskiy <watcherhd@gmail.com>2012-06-16 14:51:46 +0000
commit8617d7e00546f892c9084f7c382648b23d8bbb63 (patch)
tree2be51254236644b678418c1147f223a30e030bda /plugins
parent05c989e58aeffcfb59cebaca6797cb69dd25cb1e (diff)
another portion of "#ifdef Unicode" removal
git-svn-id: http://svn.miranda-ng.org/main/trunk@447 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins')
-rw-r--r--plugins/Variables/parse_external.cpp6
-rw-r--r--plugins/Variables/parse_inet.cpp6
-rw-r--r--plugins/W7UI/headers.h3
-rw-r--r--plugins/WhenWasIt/dlg_handlers.cpp18
-rw-r--r--plugins/WhenWasIt/hooked_events.cpp8
-rw-r--r--plugins/WhenWasIt/notifiers.h7
-rw-r--r--plugins/WhenWasIt/services.cpp6
-rw-r--r--plugins/WhenWasIt/services.h8
-rw-r--r--plugins/WhenWasIt/utils.cpp8
-rw-r--r--plugins/YAPP/common.h8
-rw-r--r--plugins/YAPP/popup_history_dlg.cpp13
-rw-r--r--plugins/YAPP/popups2.cpp8
-rw-r--r--plugins/YAPP/popwin.cpp6
13 files changed, 34 insertions, 71 deletions
diff --git a/plugins/Variables/parse_external.cpp b/plugins/Variables/parse_external.cpp
index 32f42ea1d3..a93f6ba44f 100644
--- a/plugins/Variables/parse_external.cpp
+++ b/plugins/Variables/parse_external.cpp
@@ -153,11 +153,9 @@ static TCHAR *parseAMIPEval(ARGUMENTSINFO *ai) {
if (ai->argc != 2) {
return NULL;
}
-#ifdef UNICODE
+
cmd = u2a(ai->targv[1]);
-#else
- cmd = _strdup(ai->targv[1]);
-#endif
+
if (checkAMIP() != 0) {
log_debugA("checkAMIP failed");
diff --git a/plugins/Variables/parse_inet.cpp b/plugins/Variables/parse_inet.cpp
index 9d97b5d1f7..21938b21ad 100644
--- a/plugins/Variables/parse_inet.cpp
+++ b/plugins/Variables/parse_inet.cpp
@@ -29,11 +29,9 @@ static TCHAR *parseUrlEnc(ARGUMENTSINFO *ai) {
if (ai->argc != 2) {
return NULL;
}
-#ifdef UNICODE
+
res = u2a(ai->targv[1]);
-#else
- res = _strdup(ai->argv[1]);
-#endif
+
if (res == NULL) {
return NULL;
}
diff --git a/plugins/W7UI/headers.h b/plugins/W7UI/headers.h
index 723be59ac7..7d28902466 100644
--- a/plugins/W7UI/headers.h
+++ b/plugins/W7UI/headers.h
@@ -23,9 +23,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define _CRT_SECURE_NO_DEPRECATE
-#if defined(UNICODE) && !defined(_UNICODE)
- #define _UNICODE
-#endif
#include <tchar.h>
#define _WIN32_WINNT 0x0501
diff --git a/plugins/WhenWasIt/dlg_handlers.cpp b/plugins/WhenWasIt/dlg_handlers.cpp
index 86b64effcc..e789b29d32 100644
--- a/plugins/WhenWasIt/dlg_handlers.cpp
+++ b/plugins/WhenWasIt/dlg_handlers.cpp
@@ -524,11 +524,9 @@ INT_PTR CALLBACK DlgProcAddBirthday(HWND hWnd, UINT msg, WPARAM wParam, LPARAM l
case DOB_PROTOCOL:
{
DateTime_SetMonthCalColor(hDate, MCSC_TITLEBK, COLOR_PROTOCOL);
-#ifdef _UNICODE
+
_stprintf(buffer, TranslateT("%S protocol"), protocol);
-#else
- _stprintf(buffer, TranslateT("%s protocol"), protocol);
-#endif
+
szCurrentModuleTooltip = buffer;
@@ -652,11 +650,9 @@ TCHAR *GetBirthdayModule(int module, HANDLE hContact, TCHAR *birthdayModule, int
{
char protocol[512];
GetContactProtocol(hContact, protocol, sizeof(protocol));
-#ifdef _UNICODE
+
_sntprintf(birthdayModule, size, TranslateT("%S protocol"), protocol);
-#else
- _sntprintf(birthdayModule, size, TranslateT("%s protocol"), protocol);
-#endif
+
break;
}
@@ -793,11 +789,9 @@ int UpdateBirthdayEntry(HWND hList, HANDLE hContact, int entry, int bShowAll, in
item.lParam = (LPARAM) hContact;
GetContactProtocol(hContact, protocol, sizeof(protocol));
-#ifdef _UNICODE
+
MultiByteToWideChar(CP_ACP, MB_USEGLYPHCHARS, protocol, -1, buffer, maxSize);
-#else
- strcpy(buffer, protocol);
-#endif
+
item.pszText = buffer;
if (bAdd)
diff --git a/plugins/WhenWasIt/hooked_events.cpp b/plugins/WhenWasIt/hooked_events.cpp
index 41a956f1b1..4e3d1b4723 100644
--- a/plugins/WhenWasIt/hooked_events.cpp
+++ b/plugins/WhenWasIt/hooked_events.cpp
@@ -28,11 +28,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define HOST "http://eblis.tla.ro/projects"
-#ifdef _UNICODE
- #define WHENWASIT_DATA "WhenWasIt%20unicode"
-#else
- #define WHENWASIT_DATA "WhenWasIt"
-#endif
+
+#define WHENWASIT_DATA "WhenWasIt%20unicode"
+
#if defined(WIN64) || defined(_WIN64)
#define WHENWASIT_VERSION_URL HOST "/miranda/WhenWasIt/updater/x64/WhenWasIt.html"
diff --git a/plugins/WhenWasIt/notifiers.h b/plugins/WhenWasIt/notifiers.h
index ff9f9fe229..db43ca55e1 100644
--- a/plugins/WhenWasIt/notifiers.h
+++ b/plugins/WhenWasIt/notifiers.h
@@ -21,13 +21,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#ifndef M_WWI_NOTIFIERS_H
#define M_WWI_NOTIFIERS_H
-#ifdef _UNICODE
+
#define POPUPDATAT POPUPDATAW
#define PUAddPopUpT PUAddPopUpW
-#else
-#define POPUPDATAT POPUPDATAEX
-#define PUAddPopUpT PUAddPopUpEx
-#endif
+
#define BIRTHDAY_TODAY_SOUND "WWIBirthdayToday"
#define BIRTHDAY_NEAR_SOUND "WWIBirthdayNear"
diff --git a/plugins/WhenWasIt/services.cpp b/plugins/WhenWasIt/services.cpp
index 09edb81c80..adc06de7b5 100644
--- a/plugins/WhenWasIt/services.cpp
+++ b/plugins/WhenWasIt/services.cpp
@@ -388,11 +388,9 @@ int DoExport(TCHAR *fileName)
}
_ftprintf(fout, _T("%c%s"), _T(COMMENT_CHAR), _T("Please do not edit this file by hand. Use the export function of WhenWasIt plugin.\n"));
_ftprintf(fout, _T("%c%s"), _T(COMMENT_CHAR), _T("Warning! Please do not mix Unicode and Ansi exported birthday files. You should use the same version (Ansi/Unicode) of WhenWasIt that was used to export the info.\n"));
-#ifdef _UNICODE
+
_ftprintf(fout, _T("%c%s"), _T(COMMENT_CHAR), _T("This file was exported with a Unicode version of WhenWasIt. Please only use a Unicode version of the plugin to import the birthdays.\n"));
-#else
- _ftprintf(fout, _T("%c%s"), _T(COMMENT_CHAR), _T("This file was exported with an Ansi version of WhenWasIt. Please only use an Ansi version of the plugin to import the birthdays.\n"));
-#endif
+
HANDLE hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
int year, month, day;
TCHAR *szHandle;
diff --git a/plugins/WhenWasIt/services.h b/plugins/WhenWasIt/services.h
index 47619acc26..4348077a54 100644
--- a/plugins/WhenWasIt/services.h
+++ b/plugins/WhenWasIt/services.h
@@ -30,15 +30,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define REFRESH_DETAILS_DELAY 3000
-#ifdef _UNICODE
+
#define BIRTHDAY_EXTENSION ".bdaysW"
#define BIRTHDAYS_EXPORT_FORMAT "%s@%S : %02d/%02d/%04d\n"
#define NOTFOUND_FORMAT "Could not find UID '%s [%S]' in current database, skipping"
-#else
-#define BIRTHDAY_EXTENSION ".bdays"
-#define BIRTHDAYS_EXPORT_FORMAT "%s@%s : %02d/%02d/%04d\n"
-#define NOTFOUND_FORMAT "Could not find UID '%s [%s]' in current database, skipping"
-#endif
+
extern int bShouldCheckBirthdays;
extern int bBirthdayFound;
diff --git a/plugins/WhenWasIt/utils.cpp b/plugins/WhenWasIt/utils.cpp
index 86dfc05c44..6bfbcd326e 100644
--- a/plugins/WhenWasIt/utils.cpp
+++ b/plugins/WhenWasIt/utils.cpp
@@ -174,9 +174,9 @@ TCHAR *GetContactName(HANDLE hContact, char *szProto)
ctInfo.szProto = proto;
}
ctInfo.dwFlag = CNF_DISPLAY;
-#ifdef _UNICODE
+
ctInfo.dwFlag += CNF_UNICODE;
-#endif
+
ctInfo.hContact = hContact;
//_debug_message("retrieving contact name for %d", hContact);
ret = CallService(MS_CONTACT_GETCONTACTINFO, 0, (LPARAM) &ctInfo);
@@ -221,9 +221,9 @@ TCHAR *GetContactID(HANDLE hContact, char *szProto)
ctInfo.cbSize = sizeof(ctInfo);
ctInfo.szProto = szProto;
ctInfo.dwFlag = CNF_UNIQUEID;
-#ifdef _UNICODE
+
ctInfo.dwFlag |= CNF_UNICODE;
-#endif
+
ctInfo.hContact = hContact;
ret = CallService(MS_CONTACT_GETCONTACTINFO, 0, (LPARAM) &ctInfo);
TCHAR *buffer;
diff --git a/plugins/YAPP/common.h b/plugins/YAPP/common.h
index 8b11eca6f0..51d5b1cd41 100644
--- a/plugins/YAPP/common.h
+++ b/plugins/YAPP/common.h
@@ -25,9 +25,6 @@
#define _WIN32_IE 0x0600 // Change this to the appropriate value to target other versions of IE.
#endif
-#if defined( UNICODE ) && !defined( _UNICODE )
-#define _UNICODE
-#endif
#include <m_stdhdr.h>
@@ -108,11 +105,8 @@ typedef struct {
} PopupData;
#define PDF_UNICODE 0x0001
-#ifdef _UNICODE
+
#define PDF_TCHAR PDF_UNICODE
-#else
-#define PDF_TCHAR 0
-#endif
// windowProc messages
#define PM_INIT (WM_USER + 0x0202) // message sent to your windowProc after the window has been initialized
diff --git a/plugins/YAPP/popup_history_dlg.cpp b/plugins/YAPP/popup_history_dlg.cpp
index fda95893d9..e192139c8a 100644
--- a/plugins/YAPP/popup_history_dlg.cpp
+++ b/plugins/YAPP/popup_history_dlg.cpp
@@ -336,14 +336,11 @@ IEVIEWEVENTDATA *CreateAndFillEventData(PopupHistoryData *popupItem)
{
eventData->cbSize = sizeof(IEVIEWEVENTDATA);
eventData->iType = IEED_EVENT_MESSAGE;
-#ifdef UNICODE
+
eventData->dwFlags = IEEDF_UNICODE_NICK | IEEDF_UNICODE_TEXT | IEEDF_UNICODE_TEXT2;
eventData->pszNickW = popupItem->titleT;
eventData->pszTextW = popupItem->messageT;
-#else
- eventData->pszNick = popupItem->titleT;
- eventData->pszText = popupItem->messageT;
-#endif
+
eventData->time = (DWORD) popupItem->timestamp;
eventData->next = NULL;
}
@@ -479,11 +476,9 @@ void CopyPopupDataToClipboard(HWND hList, int selection)
int found = 0;
int count = ListView_GetItemCount(hList);
int textType;
-#ifdef _UNICODE
+
textType = CF_UNICODETEXT;
-#else
- textType = CF_TEXT;
-#endif
+
for (i = 0; i < count; i++)
{
diff --git a/plugins/YAPP/popups2.cpp b/plugins/YAPP/popups2.cpp
index 9ebee50070..c90196336f 100644
--- a/plugins/YAPP/popups2.cpp
+++ b/plugins/YAPP/popups2.cpp
@@ -69,7 +69,7 @@ extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
int ReloadFont(WPARAM wParam, LPARAM lParam)
{
-#ifdef _UNICODE
+
if(ServiceExists(MS_FONT_GETW)) {
LOGFONTW log_font;
if(hFontFirstLine) DeleteObject(hFontFirstLine);
@@ -87,7 +87,7 @@ int ReloadFont(WPARAM wParam, LPARAM lParam)
colSidebar = CallService(MS_COLOUR_GETW, (WPARAM)&colour_id_sidebarw, 0);
colTitleUnderline = CallService(MS_COLOUR_GETW, (WPARAM)&colour_id_titleunderlinew, 0);
} else
-#endif
+
{
LOGFONTA log_font;
if(hFontFirstLine) DeleteObject(hFontFirstLine);
@@ -148,7 +148,7 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam) {
CallService(MS_UPDATE_REGISTER, 0, (WPARAM)&update);
}
-#ifdef _UNICODE
+
if(ServiceExists(MS_FONT_REGISTERW))
{
font_id_firstlinew.cbSize = sizeof(FontIDW);
@@ -221,7 +221,7 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam) {
hEventReloadFont = HookEvent(ME_FONT_RELOAD, ReloadFont);
}
else
-#endif
+
if(ServiceExists(MS_FONT_REGISTER))
{
font_id_firstline.cbSize = sizeof(FontID);
diff --git a/plugins/YAPP/popwin.cpp b/plugins/YAPP/popwin.cpp
index 789464d94c..585f8f34bf 100644
--- a/plugins/YAPP/popwin.cpp
+++ b/plugins/YAPP/popwin.cpp
@@ -767,11 +767,9 @@ void InitWindowStack() {
MySetLayeredWindowAttributes = (BOOL (WINAPI *)(HWND,COLORREF,BYTE,DWORD))GetProcAddress(hUserDll, "SetLayeredWindowAttributes");
MyAnimateWindow=(BOOL (WINAPI*)(HWND,DWORD,DWORD))GetProcAddress(hUserDll,"AnimateWindow");
MyMonitorFromRect=(HMONITOR (WINAPI*)(LPCRECT,DWORD))GetProcAddress(hUserDll, "MonitorFromRect");
- #if defined( _UNICODE )
+
MyGetMonitorInfo=(BOOL (WINAPI*)(HMONITOR,LPMONITORINFO))GetProcAddress(hUserDll, "GetMonitorInfoW");
- #else
- MyGetMonitorInfo=(BOOL (WINAPI*)(HMONITOR,LPMONITORINFO))GetProcAddress(hUserDll, "GetMonitorInfoA");
- #endif
+
}
}