summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-08-03 20:23:56 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-08-03 20:23:56 +0000
commit04cd8c25a959010db3f8e8c079bdcc0dcdd81a57 (patch)
tree8d14f806cf1150a6b4a377604882a14dc546bcc3 /plugins
parentc78a9a7552554b65bcd3d27605da2e470b39342d (diff)
rest of those unicode core checks
git-svn-id: http://svn.miranda-ng.org/main/trunk@1346 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins')
-rw-r--r--plugins/ListeningTo/src/listeningto.cpp77
-rw-r--r--plugins/MyDetails/src/data.cpp24
-rw-r--r--plugins/SendScreenshotPlus/src/CSend.cpp56
-rw-r--r--plugins/SendScreenshotPlus/src/Utils.cpp6
-rw-r--r--plugins/SendScreenshotPlus/src/Utils.h3
-rw-r--r--plugins/TipperYM/src/mir_smileys.cpp110
-rw-r--r--plugins/Utils/mir_memory.h36
-rw-r--r--plugins/Utils/mir_smileys.cpp30
-rw-r--r--plugins/helpers/gen_helpers.cpp8
9 files changed, 135 insertions, 215 deletions
diff --git a/plugins/ListeningTo/src/listeningto.cpp b/plugins/ListeningTo/src/listeningto.cpp
index 747574b40c..de237acb06 100644
--- a/plugins/ListeningTo/src/listeningto.cpp
+++ b/plugins/ListeningTo/src/listeningto.cpp
@@ -1,4 +1,4 @@
-/*
+/*
Copyright (C) 2006-2009 Ricardo Pescuma Domenecci
This is free software; you can redistribute it and/or
@@ -14,7 +14,7 @@ Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this file; see the file license.txt. If
not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA.
+Boston, MA 02111-1307, USA.
*/
@@ -34,7 +34,7 @@ Boston, MA 02111-1307, USA.
#define MS_LISTENINGTO_HOTKEYS_DISABLE "ListeningTo/HotkeysDisable"
#define MS_LISTENINGTO_HOTKEYS_TOGGLE "ListeningTo/HotkeysToggle"
-int hLangpack;
+int hLangpack;
PLUGININFOEX pluginInfo={
sizeof(PLUGININFOEX),
@@ -108,7 +108,7 @@ TCHAR* VariablesParsePlayer(ARGUMENTSINFO *ai);
// Functions ////////////////////////////////////////////////////////////////////////////
-extern "C" BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
+extern "C" BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
hInst = hinstDLL;
return TRUE;
@@ -122,13 +122,10 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_LISTENINGTO, MIID_LAST };
-extern "C" int __declspec(dllexport) Load(void)
+extern "C" int __declspec(dllexport) Load(void)
{
-
mir_getLP(&pluginInfo);
- CHECK_VERSION("Listening To")
-
CoInitialize(NULL);
// Services
@@ -143,7 +140,7 @@ extern "C" int __declspec(dllexport) Load(void)
CreateServiceFunction(MS_LISTENINGTO_HOTKEYS_ENABLE, HotkeysEnable);
CreateServiceFunction(MS_LISTENINGTO_HOTKEYS_DISABLE, HotkeysDisable);
CreateServiceFunction(MS_LISTENINGTO_HOTKEYS_TOGGLE, HotkeysToggle);
-
+
// Hooks
HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded);
HookEvent(ME_SYSTEM_PRESHUTDOWN, PreShutdown);
@@ -158,7 +155,7 @@ extern "C" int __declspec(dllexport) Load(void)
return 0;
}
-extern "C" int __declspec(dllexport) Unload(void)
+extern "C" int __declspec(dllexport) Unload(void)
{
CoUninitialize();
@@ -180,7 +177,7 @@ void UpdateGlobalStatusMenus()
CLISTMENUITEM clmi = {0};
clmi.cbSize = sizeof(clmi);
- clmi.flags = CMIM_FLAGS
+ clmi.flags = CMIM_FLAGS
| (enabled ? CMIF_CHECKED : 0)
| (opts.enable_sending ? 0 : CMIF_GRAYED);
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM) proto_itens[0].hMenu, (LPARAM) &clmi);
@@ -231,7 +228,7 @@ void RebuildMenu()
}
void RegisterProtocol(char *proto, TCHAR *account)
-{
+{
if (!ProtoServiceExists(proto, PS_SET_LISTENINGTO) &&
!ProtoServiceExists(proto, PS_ICQ_SETCUSTOMSTATUSEX))
return;
@@ -251,7 +248,7 @@ void RegisterProtocol(char *proto, TCHAR *account)
}
-int AccListChanged(WPARAM wParam, LPARAM lParam)
+int AccListChanged(WPARAM wParam, LPARAM lParam)
{
PROTOACCOUNT *proto = (PROTOACCOUNT *) lParam;
if (proto == NULL || proto->type != PROTOTYPE_PROTOCOL)
@@ -272,7 +269,7 @@ int AccListChanged(WPARAM wParam, LPARAM lParam)
clmi.flags = CMIM_NAME | CMIF_TCHAR;
clmi.ptszName = text;
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM) info->hMenu, (LPARAM) &clmi);
- }
+ }
else if (wParam == PRAC_REMOVED || (wParam == PRAC_CHECKED && !proto->bIsEnabled))
{
CallService(MS_CLIST_REMOVEMAINMENUITEM, (WPARAM) info->hMenu, 0);
@@ -303,7 +300,7 @@ int AccListChanged(WPARAM wParam, LPARAM lParam)
// Called when all the modules are loaded
-int ModulesLoaded(WPARAM wParam, LPARAM lParam)
+int ModulesLoaded(WPARAM wParam, LPARAM lParam)
{
EnableDisablePlayers();
@@ -331,7 +328,7 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam)
{
if (dbv.ptszVal != NULL && dbv.ptszVal[0] != 0)
SetExtraIcon(hContact, TRUE);
-
+
DBFreeVariant(&dbv);
}
}
@@ -515,7 +512,7 @@ static INT_PTR TopToolBarClick(WPARAM wParam, LPARAM lParam)
}
// Toptoolbar hook to put an icon in the toolbar
-int TopToolBarLoaded(WPARAM wParam, LPARAM lParam)
+int TopToolBarLoaded(WPARAM wParam, LPARAM lParam)
{
BOOL enabled = ListeningToEnabled(NULL, TRUE);
@@ -549,7 +546,7 @@ INT_PTR MainMenuClicked(WPARAM wParam, LPARAM lParam)
return 0;
}
-BOOL ListeningToEnabled(char *proto, BOOL ignoreGlobal)
+BOOL ListeningToEnabled(char *proto, BOOL ignoreGlobal)
{
if (!ignoreGlobal && !opts.enable_sending)
return FALSE;
@@ -578,7 +575,7 @@ BOOL ListeningToEnabled(char *proto, BOOL ignoreGlobal)
}
}
-INT_PTR ListeningToEnabled(WPARAM wParam, LPARAM lParam)
+INT_PTR ListeningToEnabled(WPARAM wParam, LPARAM lParam)
{
if (!loaded)
return -1;
@@ -625,7 +622,7 @@ void SetListeningInfo(char *proto, LISTENINGTOINFO *lti)
if (opts.xstatus_set == SET_XSTATUS)
{
ProtocolInfo *pi = GetProtoInfo(proto);
- if (pi != NULL)
+ if (pi != NULL)
{
pi->old_xstatus = 0;
pi->old_xstatus_name[0] = _T('\0');
@@ -638,7 +635,7 @@ void SetListeningInfo(char *proto, LISTENINGTOINFO *lti)
if (opts.xstatus_set == CHECK_XSTATUS_MUSIC)
{
// Set text to nothing
- TCHAR *fr[] = {
+ TCHAR *fr[] = {
_T("listening"), opts.nothing
};
@@ -664,7 +661,7 @@ void SetListeningInfo(char *proto, LISTENINGTOINFO *lti)
{
// Set to old text
ProtocolInfo *pi = GetProtoInfo(proto);
- if (pi != NULL)
+ if (pi != NULL)
{
ics.flags = CSSF_TCHAR | CSSF_MASK_STATUS | CSSF_MASK_NAME | CSSF_MASK_MESSAGE;
ics.status = &pi->old_xstatus;
@@ -679,7 +676,7 @@ void SetListeningInfo(char *proto, LISTENINGTOINFO *lti)
CallProtoService(proto, PS_ICQ_SETCUSTOMSTATUSEX, 0, (LPARAM) &ics);
- if (pi != NULL)
+ if (pi != NULL)
{
pi->old_xstatus = 0;
pi->old_xstatus_name[0] = _T('\0');
@@ -721,7 +718,7 @@ void SetListeningInfo(char *proto, LISTENINGTOINFO *lti)
}
}
- TCHAR *fr[] = {
+ TCHAR *fr[] = {
_T("listening"), (TCHAR *) GetParsedFormat(0, (WPARAM) lti),
_T("artist"), UNKNOWN(lti->ptszArtist),
_T("album"), UNKNOWN(lti->ptszAlbum),
@@ -749,15 +746,15 @@ void SetListeningInfo(char *proto, LISTENINGTOINFO *lti)
mir_free(fr[1]);
}
- }
- else if (ProtoServiceExists(proto, PS_SETAWAYMSG))
+ }
+ else if (ProtoServiceExists(proto, PS_SETAWAYMSG))
{
if (lti == NULL)
{
int status = CallProtoService(proto, PS_GETSTATUS, 0, 0);
CallProtoService(proto, PS_SETAWAYMSG, (WPARAM) status, 0);
}
- else
+ else
{
TCHAR *fr = (TCHAR *)GetParsedFormat(0, (WPARAM) lti);
char *info = mir_t2a(fr);
@@ -770,7 +767,7 @@ void SetListeningInfo(char *proto, LISTENINGTOINFO *lti)
}
}
-INT_PTR EnableListeningTo(WPARAM wParam,LPARAM lParam)
+INT_PTR EnableListeningTo(WPARAM wParam,LPARAM lParam)
{
if (!loaded)
return -1;
@@ -802,7 +799,7 @@ INT_PTR EnableListeningTo(WPARAM wParam,LPARAM lParam)
{
CLISTMENUITEM clmi = {0};
clmi.cbSize = sizeof(clmi);
- clmi.flags = CMIM_FLAGS
+ clmi.flags = CMIM_FLAGS
| (lParam ? CMIF_CHECKED : 0)
| (opts.enable_sending ? 0 : CMIF_GRAYED);
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM) info->hMenu, (LPARAM) &clmi);
@@ -824,22 +821,22 @@ INT_PTR EnableListeningTo(WPARAM wParam,LPARAM lParam)
return 0;
}
-INT_PTR HotkeysEnable(WPARAM wParam,LPARAM lParam)
+INT_PTR HotkeysEnable(WPARAM wParam,LPARAM lParam)
{
return EnableListeningTo(lParam, TRUE);
}
-INT_PTR HotkeysDisable(WPARAM wParam,LPARAM lParam)
+INT_PTR HotkeysDisable(WPARAM wParam,LPARAM lParam)
{
return EnableListeningTo(lParam, FALSE);
}
-INT_PTR HotkeysToggle(WPARAM wParam,LPARAM lParam)
+INT_PTR HotkeysToggle(WPARAM wParam,LPARAM lParam)
{
return EnableListeningTo(lParam, !ListeningToEnabled((char *)lParam, TRUE));
}
-INT_PTR GetTextFormat(WPARAM wParam,LPARAM lParam)
+INT_PTR GetTextFormat(WPARAM wParam,LPARAM lParam)
{
if (!loaded)
return NULL;
@@ -847,7 +844,7 @@ INT_PTR GetTextFormat(WPARAM wParam,LPARAM lParam)
return ( INT_PTR )mir_tstrdup(opts.templ);
}
-INT_PTR GetParsedFormat(WPARAM wParam,LPARAM lParam)
+INT_PTR GetParsedFormat(WPARAM wParam,LPARAM lParam)
{
if (!loaded)
return NULL;
@@ -857,7 +854,7 @@ INT_PTR GetParsedFormat(WPARAM wParam,LPARAM lParam)
if (lti == NULL)
return NULL;
- TCHAR *fr[] = {
+ TCHAR *fr[] = {
_T("artist"), UNKNOWN(lti->ptszArtist),
_T("album"), UNKNOWN(lti->ptszAlbum),
_T("title"), UNKNOWN(lti->ptszTitle),
@@ -874,13 +871,13 @@ INT_PTR GetParsedFormat(WPARAM wParam,LPARAM lParam)
return (int) ret.detach();
}
-INT_PTR GetOverrideContactOption(WPARAM wParam,LPARAM lParam)
+INT_PTR GetOverrideContactOption(WPARAM wParam,LPARAM lParam)
{
return ( INT_PTR )opts.override_contact_template;
}
-INT_PTR GetUnknownText(WPARAM wParam,LPARAM lParam)
+INT_PTR GetUnknownText(WPARAM wParam,LPARAM lParam)
{
return ( INT_PTR )opts.unknown;
}
@@ -890,7 +887,7 @@ void SetListeningInfos(LISTENINGTOINFO *lti)
for (unsigned int i = 1; i < proto_itens.size(); ++i)
SetListeningInfo(proto_itens[i].proto, lti);
- TCHAR *fr = NULL;
+ TCHAR *fr = NULL;
char *info = NULL;
if (lti) {
@@ -1029,7 +1026,7 @@ void SetExtraIcon(HANDLE hContact, BOOL set)
{
iec.ColumnType = opts.adv_icon_slot + EXTRA_ICON_ADV1;
}
- else
+ else
{
int first = CallService(MS_CLUI_GETCAPS, 0, CLUIF2_USEREXTRASTART);
iec.ColumnType = opts.adv_icon_slot - 2 + first;
@@ -1093,7 +1090,7 @@ TCHAR* VariablesParseInfo(ARGUMENTSINFO *ai)
return mir_tstrdup(_T(""));
}
- TCHAR *fr[] = {
+ TCHAR *fr[] = {
_T("artist"), UNKNOWN(lti->ptszArtist),
_T("album"), UNKNOWN(lti->ptszAlbum),
_T("title"), UNKNOWN(lti->ptszTitle),
diff --git a/plugins/MyDetails/src/data.cpp b/plugins/MyDetails/src/data.cpp
index 2067277cd0..7dc3831348 100644
--- a/plugins/MyDetails/src/data.cpp
+++ b/plugins/MyDetails/src/data.cpp
@@ -1,4 +1,4 @@
-/*
+/*
Copyright (C) 2005 Ricardo Pescuma Domenecci
This is free software; you can redistribute it and/or
@@ -14,7 +14,7 @@ Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this file; see the file license.txt. If
not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA.
+Boston, MA 02111-1307, USA.
*/
@@ -112,7 +112,7 @@ void Protocol::lcopystr(TCHAR *dest, TCHAR *src, size_t maxlen)
}
}
-bool Protocol::IsValid()
+bool Protocol::IsValid()
{
return valid;
}
@@ -132,7 +132,7 @@ int Protocol::GetStatus()
custom_status = CallProtoService(name, PS_ICQ_GETCUSTOMSTATUS, (WPARAM) &custom_status_name, (LPARAM) &custom_status_message);
else
custom_status = 0;
-
+
// if protocol supports custom status, but it is not set (custom_status will be -1), show normal status
if (custom_status < 0) custom_status = 0;
@@ -198,10 +198,10 @@ void Protocol::SetStatus(int aStatus)
// END From commomstatus.cpp (KeepStatus)
- PROTOCOLSETTINGEX **pse = (PROTOCOLSETTINGEX **) mir_alloc0(pCount * sizeof(PROTOCOLSETTINGEX *));
+ PROTOCOLSETTINGEX **pse = (PROTOCOLSETTINGEX **) mir_calloc(pCount * sizeof(PROTOCOLSETTINGEX *));
for (i = 0; i < pCount; i++) {
- pse[i] = (PROTOCOLSETTINGEX *) mir_alloc0(sizeof(PROTOCOLSETTINGEX));
+ pse[i] = (PROTOCOLSETTINGEX *) mir_calloc(sizeof(PROTOCOLSETTINGEX));
pse[i]->szName = "";
}
@@ -238,7 +238,7 @@ bool Protocol::CanGetStatusMsg()
bool Protocol::CanGetStatusMsg(int aStatus)
{
- return (CallProtoService(name, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND) != 0
+ return (CallProtoService(name, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND) != 0
&& (PF3 & Proto_Status2Flag(aStatus));
}
@@ -265,7 +265,7 @@ void Protocol::GetStatusMsg(int aStatus, TCHAR *msg, size_t msg_size)
{
TCHAR *tmp = (TCHAR*) CallProtoService(name, PS_GETMYAWAYMSG, 0, SGMA_TCHAR);
lcopystr(msg, tmp == NULL ? _T("") : tmp, msg_size);
- }
+ }
else if (ServiceExists(MS_AWAYMSG_GETSTATUSMSG))
{
@@ -370,7 +370,7 @@ TCHAR* Protocol::GetNick()
ci.dwFlag |= CNF_UNICODE;
#endif
- if ( !CallService(MS_CONTACT_GETCONTACTINFO, 0, (LPARAM) & ci))
+ if ( !CallService(MS_CONTACT_GETCONTACTINFO, 0, (LPARAM) & ci))
{
// CNF_DISPLAY always returns a string type
lcopystr(nickname, ci.pszVal, SIZEOF(nickname));
@@ -404,7 +404,7 @@ void Protocol::SetNick(const TCHAR *nick)
bool Protocol::CanSetAvatar()
{
- return ServiceExists(MS_AV_SETMYAVATAR) != FALSE && ServiceExists(MS_AV_CANSETMYAVATAR) != FALSE &&
+ return ServiceExists(MS_AV_SETMYAVATAR) != FALSE && ServiceExists(MS_AV_CANSETMYAVATAR) != FALSE &&
CallService(MS_AV_CANSETMYAVATAR, (WPARAM) name, 0);
}
@@ -566,7 +566,7 @@ void ProtocolArray::SetNicks(const TCHAR *nick)
lstrcpyn(default_nick, nick, SIZEOF(default_nick));
DBWriteContactSettingTString(0, MODULE_NAME, SETTING_DEFAULT_NICK, nick);
-
+
for ( int i = 0 ; i < buffer_len ; i++ )
buffer[i]->SetNick(default_nick);
}
@@ -675,5 +675,3 @@ static char *StatusModeToDbSetting(int status,const char *suffix)
lstrcpyA(str,prefix); lstrcatA(str,suffix);
return str;
}
-
-
diff --git a/plugins/SendScreenshotPlus/src/CSend.cpp b/plugins/SendScreenshotPlus/src/CSend.cpp
index 4e48ecb2b4..eae8ecad55 100644
--- a/plugins/SendScreenshotPlus/src/CSend.cpp
+++ b/plugins/SendScreenshotPlus/src/CSend.cpp
@@ -1,7 +1,7 @@
/*
Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2009 Miranda ICQ/IM project,
+Copyright 2000-2009 Miranda ICQ/IM project,
This file is part of Send Screenshot Plus, a Miranda IM plugin.
Copyright (c) 2010 Ing.U.Horn
@@ -83,7 +83,7 @@ void CSend::svcSendMsg(const char* szMessage) {
m_cbEventMsg=lstrlenA(szMessage)+1;
m_szEventMsg=(char*)mir_realloc(m_szEventMsg, sizeof(char)*m_cbEventMsg);
ZeroMemory(m_szEventMsg, m_cbEventMsg);
- lstrcpyA(m_szEventMsg,szMessage);
+ lstrcpyA(m_szEventMsg,szMessage);
if (m_pszFileDesc && m_pszFileDesc[0] != NULL) {
char *temp = mir_t2a(m_pszFileDesc);
mir_stradd(m_szEventMsg, "\r\n");
@@ -115,7 +115,7 @@ void CSend::svcSendUrl(const char* url) {
m_cbEventMsg=lstrlenA(url)+2;
m_szEventMsg=(char*)mir_realloc(m_szEventMsg, m_cbEventMsg);
ZeroMemory(m_szEventMsg, m_cbEventMsg);
- lstrcpyA(m_szEventMsg,url);
+ lstrcpyA(m_szEventMsg,url);
if (m_pszFileDesc && m_pszFileDesc[0] != NULL) {
char *temp = mir_t2a(m_pszFileDesc);
m_cbEventMsg += lstrlenA(temp);
@@ -161,12 +161,7 @@ void CSend::svcSendChat() {
gcd.ptszID = gci.pszID;
#else //dirty fix coz MS_GC_GETINFO dont know if caller is ansi or unicode.
//result from MS_GC_GETINFO only depend on type of chat.dll and not of caller type
- if (mir_is_unicode()) {
- dirtyFix = mir_u2t((wchar_t*)gci.pszID);
- }
- else {
- dirtyFix = mir_tstrdup(gci.pszID);
- }
+ dirtyFix = mir_u2t((wchar_t*)gci.pszID);
gcd.ptszID = dirtyFix; //fixed gci.pszID;
#endif
gce.cbSize = sizeof(GCEVENT);
@@ -213,7 +208,7 @@ void CSend::svcSendFile() {
char* temp = mir_t2a(m_pszFileDesc);
m_cbEventMsg += lstrlenA(temp);
m_szEventMsg=(char*)mir_realloc(m_szEventMsg, sizeof(char)*m_cbEventMsg);
- lstrcpyA(m_szEventMsg+lstrlenA(szFile)+1,temp);
+ lstrcpyA(m_szEventMsg+lstrlenA(szFile)+1,temp);
m_szEventMsg[m_cbEventMsg-1] = 0;
mir_freeAndNil(temp);
}
@@ -225,34 +220,16 @@ void CSend::svcSendFile() {
hookProc = &CSend::OnSend;
m_hOnSend = HookEventObj(ME_PROTO_ACK, (MIRANDAHOOKOBJ)*(void **)&hookProc, this);
}
+
// Start miranda PSS_FILE based on mir ver (T)
- if ((CallService(MS_SYSTEM_GETVERSION,0,0) >= 0x090000) && mir_is_unicode()) {
- TCHAR *ppFile[2]={0,0};
- TCHAR *pDesc = mir_tstrdup(m_pszFileDesc);
- ppFile[0] = mir_tstrdup (m_pszFile);
-/* #if defined( _UNICODE )
- TCHAR *ppFile[2]={0,0};
- TCHAR *pDesc = mir_tstrdup(m_pszFileDesc);
- ppFile[0] = mir_tstrdup (m_pszFile);
- #else
- wchar_t *ppFile[2]={0,0};
- wchar_t *pDesc = mir_t2u (m_pszFileDesc);
- ppFile[0] = mir_t2u (m_pszFile);
- #endif */
- ppFile[1] = NULL;
- m_hSend = (HANDLE)CallContactService(m_hContact, PSS_FILET, (WPARAM)pDesc, (LPARAM)ppFile);
- mir_free(pDesc);
- mir_free(ppFile[0]);
- }
- else {
- char *pDesc = mir_t2a(m_pszFileDesc);
- char *ppFile[2]={0};
- ppFile[0] = mir_t2a(m_pszFile);
- ppFile[1] = NULL;
- m_hSend = (HANDLE)CallContactService(m_hContact, PSS_FILE, (WPARAM)pDesc, (LPARAM)ppFile);
- mir_free(pDesc);
- mir_free(ppFile[0]);
- }
+ TCHAR *ppFile[2]={0,0};
+ TCHAR *pDesc = mir_tstrdup(m_pszFileDesc);
+ ppFile[0] = mir_tstrdup (m_pszFile);
+ ppFile[1] = NULL;
+ m_hSend = (HANDLE)CallContactService(m_hContact, PSS_FILET, (WPARAM)pDesc, (LPARAM)ppFile);
+ mir_free(pDesc);
+ mir_free(ppFile[0]);
+
// check we actually got an ft handle back from the protocol
if (!m_hSend) {
Unhook();
@@ -270,7 +247,7 @@ int __cdecl CSend::OnSend(WPARAM wParam, LPARAM lParam){
dat->waitingForAcceptance=0;
}
*/
-
+
switch(ack->result) {
case ACKRESULT_INITIALISING: //SetFtStatus(hwndDlg, LPGENT("Initialising..."), FTS_TEXT); break;
case ACKRESULT_CONNECTING: //SetFtStatus(hwndDlg, LPGENT("Connecting..."), FTS_TEXT); break;
@@ -390,7 +367,7 @@ void CSend::Exit(unsigned int Result) {
void CSend::Error(LPCTSTR pszFormat, ...) {
if(!pszFormat) return;
-
+
TCHAR tszTemp[MAX_SECONDLINE];
va_list vl;
@@ -413,4 +390,3 @@ void CSend::Error(LPCTSTR pszFormat, ...) {
m_box.ptszMsg = m_ErrorMsg;
m_box.uType = MB_OK|MB_ICON_ERROR;
}
-
diff --git a/plugins/SendScreenshotPlus/src/Utils.cpp b/plugins/SendScreenshotPlus/src/Utils.cpp
index 12fa58d369..2352eb8c14 100644
--- a/plugins/SendScreenshotPlus/src/Utils.cpp
+++ b/plugins/SendScreenshotPlus/src/Utils.cpp
@@ -408,12 +408,6 @@ BOOL GetLmouse() {
}
//---------------------------------------------------------------------------
-//is miranda unicode
-BOOL mir_is_unicode() {
- return TRUE;
-}
-
-//---------------------------------------------------------------------------
INT_PTR GetFileName(LPTSTR pszPath, UINT typ) {
/*DBVT_ASCIIZ, DBVT_WCHAR, DBVT_TCHAR*/
LPTSTR slash = _tcsrchr(pszPath,_T('\\'));
diff --git a/plugins/SendScreenshotPlus/src/Utils.h b/plugins/SendScreenshotPlus/src/Utils.h
index 2934391a8b..ab49fcda89 100644
--- a/plugins/SendScreenshotPlus/src/Utils.h
+++ b/plugins/SendScreenshotPlus/src/Utils.h
@@ -1,7 +1,7 @@
/*
Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2009 Miranda ICQ/IM project,
+Copyright 2000-2009 Miranda ICQ/IM project,
This file is part of Send Screenshot Plus, a Miranda IM plugin.
Copyright (c) 2010 Ing.U.Horn
@@ -64,7 +64,6 @@ LPTSTR SaveImage(FREE_IMAGE_FORMAT fif, FIBITMAP* dib, LPTSTR pszFilename, LPT
void DrawBorderInverted(HWND hWindow);
BOOL GetLmouse();
-BOOL mir_is_unicode();
INT_PTR GetFileName(LPTSTR pszPath, UINT typ);
INT_PTR GetFileExt (LPTSTR pszPath, UINT typ);
diff --git a/plugins/TipperYM/src/mir_smileys.cpp b/plugins/TipperYM/src/mir_smileys.cpp
index 5af05c4b22..9ba815eac3 100644
--- a/plugins/TipperYM/src/mir_smileys.cpp
+++ b/plugins/TipperYM/src/mir_smileys.cpp
@@ -15,7 +15,7 @@ Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this file; see the file license.txt. If
not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA.
+Boston, MA 02111-1307, USA.
*/
#include "common.h"
@@ -24,7 +24,7 @@ Boston, MA 02111-1307, USA.
-void *mir_alloc0(size_t size)
+void *mir_calloc(size_t size)
{
void *ptr = mir_alloc(size);
if (ptr) memset(ptr, 0, size);
@@ -32,10 +32,10 @@ void *mir_alloc0(size_t size)
return ptr;
}
-int InitTipperSmileys()
+int InitTipperSmileys()
{
// Register smiley category
- if (ServiceExists(MS_SMILEYADD_REGISTERCATEGORY))
+ if (ServiceExists(MS_SMILEYADD_REGISTERCATEGORY))
{
SMADD_REGCAT rc;
rc.cbSize = sizeof(rc);
@@ -49,13 +49,13 @@ int InitTipperSmileys()
SMILEYPARSEINFO Smileys_PreParse(LPCTSTR lpString, int nCount, const char *protocol)
{
- if (!(opt.iSmileyAddFlags & SMILEYADD_ENABLE))
+ if (!(opt.iSmileyAddFlags & SMILEYADD_ENABLE))
return NULL;
if (nCount == -1)
nCount = (int)lstrlen(lpString);
- SMILEYPARSEINFO info = (SMILEYPARSEINFO) mir_alloc0(sizeof(tagSMILEYPARSEINFO));
+ SMILEYPARSEINFO info = (SMILEYPARSEINFO) mir_calloc(sizeof(tagSMILEYPARSEINFO));
info->pieces = ReplaceSmileys(lpString, nCount, protocol, &info->max_height);
if (!info->pieces)
@@ -69,7 +69,7 @@ SMILEYPARSEINFO Smileys_PreParse(LPCTSTR lpString, int nCount, const char *proto
void Smileys_FreeParse(SMILEYPARSEINFO parseInfo)
{
- if (parseInfo != NULL)
+ if (parseInfo != NULL)
{
if (parseInfo->pieces != NULL)
DestroySmileyList(parseInfo->pieces);
@@ -88,12 +88,12 @@ int Smileys_DrawText(HDC hDC, LPCTSTR lpString, int nCount, LPRECT lpRect, UINT
if (nCount == -1)
nCount = (int)lstrlen(lpString);
- if (uFormat & DT_CALCRECT)
+ if (uFormat & DT_CALCRECT)
{
SIZE text_size = GetTextSize(hDC, lpString, parseInfo, uFormat, parseInfo->max_height, (lpRect->right - lpRect->left));
lpRect->bottom = text_size.cy;
- if (text_size.cx < lpRect->right - lpRect->left)
+ if (text_size.cx < lpRect->right - lpRect->left)
{
if (uFormat & DT_RIGHT)
lpRect->left = lpRect->right - text_size.cx;
@@ -102,7 +102,7 @@ int Smileys_DrawText(HDC hDC, LPCTSTR lpString, int nCount, LPRECT lpRect, UINT
}
result = text_size.cy;
- }
+ }
else
{
// Draw
@@ -110,12 +110,12 @@ int Smileys_DrawText(HDC hDC, LPCTSTR lpString, int nCount, LPRECT lpRect, UINT
{
result = DrawText(hDC, lpString, nCount, lpRect, uFormat);
}
- else
+ else
{
RECT rc = *lpRect;
SIZE text_size = GetTextSize(hDC, lpString, parseInfo, uFormat, parseInfo->max_height, (lpRect->right - lpRect->left));
- if (text_size.cx < rc.right - rc.left)
+ if (text_size.cx < rc.right - rc.left)
{
if (uFormat & DT_RIGHT)
rc.left = rc.right - text_size.cx;
@@ -137,29 +137,29 @@ SIZE GetTextSize(HDC hdcMem, const TCHAR *szText, SMILEYPARSEINFO info, UINT uTe
int text_height;
int row_count = 0, pos_x = 0;
- if (szText == NULL || _tcsclen(szText) == 0)
+ if (szText == NULL || _tcsclen(szText) == 0)
{
text_size.cy = 0;
text_size.cx = 0;
}
- else
+ else
{
RECT text_rc = {0, 0, 2048, 2048};
- if (info->pieces == NULL)
+ if (info->pieces == NULL)
{
DrawText(hdcMem, szText, -1, &text_rc, DT_CALCRECT | uTextFormat);
text_size.cx = text_rc.right - text_rc.left;
text_size.cy = text_rc.bottom - text_rc.top;
- }
- else
+ }
+ else
{
// Get real height of the line
text_height = DrawText(hdcMem, _T("A"), 1, &text_rc, DT_CALCRECT | uTextFormat);
// See each item of list
int i;
- for (i = 0; i < info->pieces->realCount; i++)
+ for (i = 0; i < info->pieces->realCount; i++)
{
TEXTPIECE *piece = (TEXTPIECE *) info->pieces->items[i];
info->row_height[row_count] = max(info->row_height[row_count], text_height);
@@ -170,7 +170,7 @@ SIZE GetTextSize(HDC hdcMem, const TCHAR *szText, SMILEYPARSEINFO info, UINT uTe
DrawText(hdcMem, szText + piece->start_pos, piece->len, &text_rc, DT_CALCRECT | uTextFormat);
pos_x += (text_rc.right - text_rc.left);
- if (pos_x > max_width)
+ if (pos_x > max_width)
{
text_size.cx = max(text_size.cx, pos_x - (text_rc.right - text_rc.left));
pos_x = text_rc.right - text_rc.left;
@@ -184,8 +184,8 @@ SIZE GetTextSize(HDC hdcMem, const TCHAR *szText, SMILEYPARSEINFO info, UINT uTe
info->row_height[++row_count] = 0;
}
- }
- else
+ }
+ else
{
double factor;
@@ -202,7 +202,7 @@ SIZE GetTextSize(HDC hdcMem, const TCHAR *szText, SMILEYPARSEINFO info, UINT uTe
text_size.cx = max(text_size.cx, pos_x - (piece->smiley_width * factor));
pos_x = piece->smiley_width * factor;
info->row_height[++row_count] = piece->smiley_height * factor;
- }
+ }
}
}
@@ -219,13 +219,13 @@ void DrawTextSmiley(HDC hdcMem, RECT free_rc, const TCHAR *szText, int len, SMIL
{
if (szText == NULL)
return;
-
+
uTextFormat &= ~DT_RIGHT;
// Draw list
int text_height, i, shift;
int row_count = 0, pos_x = 0;
-
+
RECT tmp_rc = free_rc;
if (uTextFormat & DT_RTLREADING)
@@ -244,7 +244,7 @@ void DrawTextSmiley(HDC hdcMem, RECT free_rc, const TCHAR *szText, int len, SMIL
{
DrawText(hdcMem, _T("..."), 3, &free_rc, uTextFormat & ~DT_END_ELLIPSIS);
}
- else
+ else
{
// Draw text and smileys
RECT text_rc = free_rc;
@@ -257,15 +257,15 @@ void DrawTextSmiley(HDC hdcMem, RECT free_rc, const TCHAR *szText, int len, SMIL
else
text_rc.left = free_rc.left + pos_x;
- if (piece->type == TEXT_PIECE_TYPE_TEXT)
+ if (piece->type == TEXT_PIECE_TYPE_TEXT)
{
tmp_rc = text_rc;
tmp_rc.right = 2048;
- DrawText(hdcMem, szText + piece->start_pos, min(len, piece->len), &tmp_rc, DT_CALCRECT | (uTextFormat & ~DT_END_ELLIPSIS));
+ DrawText(hdcMem, szText + piece->start_pos, min(len, piece->len), &tmp_rc, DT_CALCRECT | (uTextFormat & ~DT_END_ELLIPSIS));
pos_x += (tmp_rc.right - tmp_rc.left);
- if (pos_x > (free_rc.right - free_rc.left))
+ if (pos_x > (free_rc.right - free_rc.left))
{
pos_x = tmp_rc.right - tmp_rc.left;
text_rc.left = free_rc.left;
@@ -273,7 +273,7 @@ void DrawTextSmiley(HDC hdcMem, RECT free_rc, const TCHAR *szText, int len, SMIL
text_rc.top += info->row_height[row_count];
row_count++;
}
-
+
shift = (info->row_height[row_count] - text_height) >> 1;
text_rc.top += shift;
@@ -284,7 +284,7 @@ void DrawTextSmiley(HDC hdcMem, RECT free_rc, const TCHAR *szText, int len, SMIL
len -= piece->len;
text_rc.top -= shift;
- if (szText[piece->start_pos + piece->len - 1] == '\n')
+ if (szText[piece->start_pos + piece->len - 1] == '\n')
{
text_rc.left = free_rc.left;
text_rc.right = free_rc.right;
@@ -292,8 +292,8 @@ void DrawTextSmiley(HDC hdcMem, RECT free_rc, const TCHAR *szText, int len, SMIL
pos_x = 0;
row_count++;
}
- }
- else
+ }
+ else
{
double factor;
@@ -301,7 +301,7 @@ void DrawTextSmiley(HDC hdcMem, RECT free_rc, const TCHAR *szText, int len, SMIL
{
len = 0;
}
- else
+ else
{
len -= piece->len;
@@ -314,7 +314,7 @@ void DrawTextSmiley(HDC hdcMem, RECT free_rc, const TCHAR *szText, int len, SMIL
text_rc.left = max(text_rc.right - (int)(piece->smiley_width * factor), text_rc.left);
pos_x += piece->smiley_width * factor;
- if (pos_x > (free_rc.right - free_rc.left))
+ if (pos_x > (free_rc.right - free_rc.left))
{
pos_x = piece->smiley_width * factor;
text_rc.left = free_rc.left;
@@ -322,9 +322,9 @@ void DrawTextSmiley(HDC hdcMem, RECT free_rc, const TCHAR *szText, int len, SMIL
text_rc.top += info->row_height[row_count];
row_count++;
}
-
+
shift = (info->row_height[row_count] - (LONG)(piece->smiley_height * factor)) >> 1;
- DrawIconExAlpha(hdcMem, text_rc.left, text_rc.top + shift, piece->smiley, piece->smiley_width * factor, piece->smiley_height * factor, 0, NULL, DI_NORMAL, true);
+ DrawIconExAlpha(hdcMem, text_rc.left, text_rc.top + shift, piece->smiley, piece->smiley_width * factor, piece->smiley_height * factor, 0, NULL, DI_NORMAL, true);
}
}
}
@@ -339,13 +339,13 @@ void DestroySmileyList(SortedList* p_list)
if (p_list == NULL)
return;
- if (p_list->items != NULL)
+ if (p_list->items != NULL)
{
int i;
- for (i = 0 ; i < p_list->realCount ; i++)
+ for (i = 0 ; i < p_list->realCount ; i++)
{
TEXTPIECE *piece = (TEXTPIECE *)p_list->items[i];
- if (piece != NULL)
+ if (piece != NULL)
{
if (piece->type == TEXT_PIECE_TYPE_SMILEY)
DestroyIcon(piece->smiley);
@@ -396,17 +396,17 @@ SortedList *ReplaceSmileys(const TCHAR *text, int text_size, const char *protoco
word_start = word_end = (TCHAR *)text;
- for (unsigned i = 0; i < sp.numSmileys; i++)
+ for (unsigned i = 0; i < sp.numSmileys; i++)
{
// Get smile position
smiley_start = _tcsninc(text, spres[i].startChar);
smiley_end = _tcsninc(smiley_start, spres[i].size);
-
- if (spres[i].hIcon) // For deffective smileypacks
- {
- if (opt.iSmileyAddFlags & SMILEYADD_ONLYISOLATED)
+
+ if (spres[i].hIcon) // For deffective smileypacks
+ {
+ if (opt.iSmileyAddFlags & SMILEYADD_ONLYISOLATED)
{
- if ((smiley_start > text && *(smiley_start - 1) != ' ' && *(smiley_start - 1) != '\n' && *smiley_end != '\r') ||
+ if ((smiley_start > text && *(smiley_start - 1) != ' ' && *(smiley_start - 1) != '\n' && *smiley_end != '\r') ||
(*smiley_end != '\0' && *smiley_end != ' ' && *smiley_end != '\n' && *smiley_end != '\r'))
continue;
}
@@ -422,9 +422,9 @@ SortedList *ReplaceSmileys(const TCHAR *text, int text_size, const char *protoco
else
word_end++;
- if (word_end > word_start)
+ if (word_end > word_start)
{
- TEXTPIECE *piece = (TEXTPIECE *)mir_alloc0(sizeof(TEXTPIECE));
+ TEXTPIECE *piece = (TEXTPIECE *)mir_calloc(sizeof(TEXTPIECE));
piece->type = TEXT_PIECE_TYPE_TEXT;
piece->start_pos = word_start - text;
piece->len = word_end - word_start;
@@ -437,7 +437,7 @@ SortedList *ReplaceSmileys(const TCHAR *text, int text_size, const char *protoco
{
BITMAP bm;
ICONINFO icon;
- TEXTPIECE *piece = (TEXTPIECE *) mir_alloc0(sizeof(TEXTPIECE));
+ TEXTPIECE *piece = (TEXTPIECE *) mir_calloc(sizeof(TEXTPIECE));
piece->type = TEXT_PIECE_TYPE_SMILEY;
piece->len = spres[i].size;
@@ -445,9 +445,9 @@ SortedList *ReplaceSmileys(const TCHAR *text, int text_size, const char *protoco
piece->smiley_width = 16;
piece->smiley_height = 16;
- if (GetIconInfo(piece->smiley, &icon))
+ if (GetIconInfo(piece->smiley, &icon))
{
- if (GetObject(icon.hbmColor, sizeof(BITMAP), &bm))
+ if (GetObject(icon.hbmColor, sizeof(BITMAP), &bm))
{
piece->smiley_width = bm.bmWidth;
piece->smiley_height = bm.bmHeight;
@@ -466,7 +466,7 @@ SortedList *ReplaceSmileys(const TCHAR *text, int text_size, const char *protoco
}
// Add rest of the text
- while (word_end != last_text_pos)
+ while (word_end != last_text_pos)
{
while (word_end[0] && word_end[0] != ' ' && word_end[0] != '\n')
word_end++;
@@ -474,9 +474,9 @@ SortedList *ReplaceSmileys(const TCHAR *text, int text_size, const char *protoco
if (word_end[0])
word_end++;
- if (word_end > word_start)
+ if (word_end > word_start)
{
- TEXTPIECE *piece = (TEXTPIECE *)mir_alloc0(sizeof(TEXTPIECE));
+ TEXTPIECE *piece = (TEXTPIECE *)mir_calloc(sizeof(TEXTPIECE));
piece->type = TEXT_PIECE_TYPE_TEXT;
piece->start_pos = word_start - text;
piece->len = word_end - word_start;
@@ -493,13 +493,13 @@ SortedList *ReplaceSmileys(const TCHAR *text, int text_size, const char *protoco
int DrawTextExt(HDC hdc, LPCTSTR lpString, int nCount, LPRECT lpRect, UINT uFormat, LPCSTR lpProto, SMILEYPARSEINFO spi)
{
- if ((opt.iSmileyAddFlags & SMILEYADD_ENABLE) && spi != NULL)
+ if ((opt.iSmileyAddFlags & SMILEYADD_ENABLE) && spi != NULL)
{
if (opt.iSmileyAddFlags & SMILEYADD_RESIZE)
uFormat |= DT_RESIZE_SMILEYS;
return Smileys_DrawText(hdc, lpString, nCount, lpRect, uFormat, lpProto, spi);
- }
+ }
else
{
if (uFormat & DT_CALCRECT)
diff --git a/plugins/Utils/mir_memory.h b/plugins/Utils/mir_memory.h
index d62f4833f3..56ee80d2ac 100644
--- a/plugins/Utils/mir_memory.h
+++ b/plugins/Utils/mir_memory.h
@@ -20,27 +20,8 @@ Boston, MA 02111-1307, USA.
#ifndef __MIR_MEMORY_H__
# define __MIR_MEMORY_H__
-
#include <windows.h>
-
-
-static BOOL mir_is_unicode()
-{
- return TRUE;
-}
-
-
-static void * mir_alloc0(size_t size)
-{
- void * ptr = mir_alloc(size);
-
- if (ptr != NULL)
- memset(ptr, 0, size);
-
- return ptr;
-}
-
static int strcmpnull(char *str1, char *str2)
{
if ( str1 == NULL && str2 == NULL )
@@ -65,31 +46,14 @@ static int strcmpnullW(WCHAR *str1, WCHAR *str2)
return lstrcmpW(str1, str2);
}
-
-
-#define CHECK_VERSION(_NAME_) \
- if ( !mir_is_unicode()) \
- { \
- MessageBox(NULL, _T("Your Miranda is ansi. You have to install ansi ") _T(_NAME_), \
- _T(_NAME_), MB_OK | MB_ICONERROR); \
- return -1; \
- }
-
# define lstrcmpnull strcmpnullW
#define INPLACE_CHAR_TO_TCHAR(_new_var_, _size_, _old_var_) \
TCHAR _new_var_[_size_]; \
MultiByteToWideChar(CP_ACP, 0, _old_var_, -1, _new_var_, _size_)
-
#define INPLACE_TCHAR_TO_CHAR(_new_var_, _size_, _old_var_) \
char _new_var_[_size_]; \
WideCharToMultiByte(CP_ACP, 0, _old_var_, -1, _new_var_, _size_, NULL, NULL);
-
-// Free memory and set to NULL
-//#define MIR_FREE(_x_) if (_x_ != NULL) { mir_free(_x_); _x_ = NULL; }
-
-
-
#endif // __MIR_MEMORY_H__
diff --git a/plugins/Utils/mir_smileys.cpp b/plugins/Utils/mir_smileys.cpp
index d8dbf154db..de0844950a 100644
--- a/plugins/Utils/mir_smileys.cpp
+++ b/plugins/Utils/mir_smileys.cpp
@@ -14,7 +14,7 @@ Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this file; see the file license.txt. If
not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA.
+Boston, MA 02111-1307, USA.
*/
@@ -37,7 +37,7 @@ Boston, MA 02111-1307, USA.
#define TEXT_PIECE_TYPE_TEXT 0
#define TEXT_PIECE_TYPE_SMILEY 1
-typedef struct
+typedef struct
{
int type;
int len;
@@ -54,7 +54,7 @@ typedef struct
int smiley_height;
};
};
-}
+}
TextPiece;
SortedList * ReplaceSmileys(const TCHAR *text, int text_size, const char *protocol, int *max_smiley_height);
@@ -64,7 +64,7 @@ SIZE GetTextSize(HDC hdcMem, const TCHAR *szText, SortedList *plText, UINT uText
// Functions
-int InitContactListSmileys()
+int InitContactListSmileys()
{
// Register smiley category
if (ServiceExists(MS_SMILEYADD_REGISTERCATEGORY))
@@ -83,7 +83,7 @@ int InitContactListSmileys()
SmileysParseInfo Smileys_PreParse(const TCHAR* lpString, int nCount, const char *protocol)
{
- SmileysParseInfo info = (SmileysParseInfo) mir_alloc0(sizeof(_SmileysParseInfo));
+ SmileysParseInfo info = (SmileysParseInfo) mir_calloc(sizeof(_SmileysParseInfo));
info->pieces = ReplaceSmileys(lpString, nCount, protocol, &info->max_height);
@@ -191,7 +191,7 @@ int Smileys_DrawText(HDC hDC, LPCTSTR lpString, int nCount, LPRECT lpRect, UINT
}
ret = text_size.cy;
-
+
DrawTextSmiley(hDC, rc, lpString, nCount, info->pieces, uFormat, info->max_height);
}
@@ -228,7 +228,7 @@ SIZE GetTextSize(HDC hdcMem, const TCHAR *szText, SortedList *plText, UINT uText
DrawText(hdcMem,szText,lstrlen(szText), &text_rc, DT_CALCRECT | uTextFormat);
text_size.cy = text_rc.bottom - text_rc.top;
- if (plText == NULL)
+ if (plText == NULL)
{
text_size.cx = text_rc.right - text_rc.left;
}
@@ -254,7 +254,7 @@ SIZE GetTextSize(HDC hdcMem, const TCHAR *szText, SortedList *plText, UINT uText
else
{
double factor;
-
+
if ((uTextFormat & DT_RESIZE_SMILEYS) && piece->smiley_height > text_size.cy)
{
factor = text_size.cy / (double) piece->smiley_height;
@@ -277,7 +277,7 @@ void DrawTextSmiley(HDC hdcMem, RECT free_rc, const TCHAR *szText, int len, Sort
{
if (szText == NULL)
return;
-
+
uTextFormat &= ~DT_RIGHT;
// Draw list
@@ -359,8 +359,8 @@ void DrawTextSmiley(HDC hdcMem, RECT free_rc, const TCHAR *szText, int len, Sort
{
text_rc.top += (row_height - (LONG)(piece->smiley_height * factor)) >> 1;
- skin_DrawIconEx(hdcMem, text_rc.left, text_rc.top, piece->smiley,
- (LONG)(piece->smiley_width * factor), (LONG)(piece->smiley_height * factor), 0, NULL, DI_NORMAL);
+ skin_DrawIconEx(hdcMem, text_rc.left, text_rc.top, piece->smiley,
+ (LONG)(piece->smiley_width * factor), (LONG)(piece->smiley_height * factor), 0, NULL, DI_NORMAL);
}
else
{
@@ -439,13 +439,13 @@ SortedList * ReplaceSmileys(const TCHAR *text, int text_size, const char *protoc
{
TCHAR* start = _tcsninc(text, spres[i].startChar);
TCHAR* end = _tcsninc(start, spres[i].size);
-
+
if (spres[i].hIcon != NULL) // For deffective smileypacks
{
// Add text
if (start > next_text_pos)
{
- TextPiece *piece = (TextPiece *) mir_alloc0(sizeof(TextPiece));
+ TextPiece *piece = (TextPiece *) mir_calloc(sizeof(TextPiece));
piece->type = TEXT_PIECE_TYPE_TEXT;
piece->start_pos = next_text_pos - text;
@@ -458,7 +458,7 @@ SortedList * ReplaceSmileys(const TCHAR *text, int text_size, const char *protoc
{
BITMAP bm;
ICONINFO icon;
- TextPiece *piece = (TextPiece *) mir_alloc0(sizeof(TextPiece));
+ TextPiece *piece = (TextPiece *) mir_calloc(sizeof(TextPiece));
piece->type = TEXT_PIECE_TYPE_SMILEY;
piece->len = end - start;
@@ -490,7 +490,7 @@ SortedList * ReplaceSmileys(const TCHAR *text, int text_size, const char *protoc
// Add rest of text
if (last_text_pos > next_text_pos)
{
- TextPiece *piece = (TextPiece *) mir_alloc0(sizeof(TextPiece));
+ TextPiece *piece = (TextPiece *) mir_calloc(sizeof(TextPiece));
piece->type = TEXT_PIECE_TYPE_TEXT;
piece->start_pos = next_text_pos - text;
diff --git a/plugins/helpers/gen_helpers.cpp b/plugins/helpers/gen_helpers.cpp
index 30b012f785..d17de17fbd 100644
--- a/plugins/helpers/gen_helpers.cpp
+++ b/plugins/helpers/gen_helpers.cpp
@@ -224,11 +224,3 @@ TCHAR *itot(int num) {
return mir_a2t(tRes);
}
-
-// Helper functions that need MODULENAME
-#define SETTING_NOENCODINGCHECK "NoEncodingCheck"
-
-int Hlp_UnicodeCheck(char *szPluginName, BOOL bForce, const char *szModule)
-{
- return 0;
-}