summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/AVS/src/commonheaders.h5
-rw-r--r--plugins/CryptoPP/src/mmi.cpp67
-rw-r--r--plugins/FlashAvatars/src/cflash.cpp6
-rw-r--r--plugins/ModernOpt/src/modernopt.cpp31
-rw-r--r--plugins/NewAwaySysMod/Properties.cpp36
-rw-r--r--plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.h9
-rw-r--r--plugins/StatusPlugins/StartupStatus/startupstatus.h9
-rw-r--r--plugins/TopToolBar/common.h8
8 files changed, 23 insertions, 148 deletions
diff --git a/plugins/AVS/src/commonheaders.h b/plugins/AVS/src/commonheaders.h
index 26986e89a6..c4b459d8dc 100644
--- a/plugins/AVS/src/commonheaders.h
+++ b/plugins/AVS/src/commonheaders.h
@@ -88,11 +88,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// The same fields as avatarCacheEntry + proto name
-struct protoPicCacheEntry : public avatarCacheEntry
+struct protoPicCacheEntry : public avatarCacheEntry, public MZeroedObject
{
- __inline void* operator new( size_t size ) { return mir_alloc( size ); }
- __inline void operator delete( void* p ) { mir_free( p ); }
-
protoPicCacheEntry() { memset(this, 0, sizeof(*this)); };
~protoPicCacheEntry();
diff --git a/plugins/CryptoPP/src/mmi.cpp b/plugins/CryptoPP/src/mmi.cpp
index 68026578bb..b7c047a9e5 100644
--- a/plugins/CryptoPP/src/mmi.cpp
+++ b/plugins/CryptoPP/src/mmi.cpp
@@ -1,72 +1,5 @@
#include "commonheaders.h"
-/*
-void m_check(void *ptr, const char *module) {
- if (ptr==NULL) {
- char buffer[128];
- strcpy(buffer,module); strcat(buffer,": NULL pointer detected !");
- MessageBoxA(0,buffer,szModuleName,MB_OK|MB_ICONSTOP);
- __asm{ int 3 };
- exit(1);
- }
-}
-
-
-void *m_alloc(size_t size) {
- void *ptr;
- ptr = malloc(size);
- m_check(ptr,"m_alloc");
- ZeroMemory(ptr,size);
- return ptr;
-}
-
-
-void m_free(void *ptr) {
-// m_check(ptr,"m_free");
- if (ptr) {
- free(ptr);
- }
-}
-
-
-void *m_realloc(void *ptr,size_t size) {
- r = realloc(ptr,size);
- m_check(ptr,"m_realloc");
- return ptr;
-}
-
-
-#ifndef _DEBUG
-void *operator new(size_t size) {
- return malloc(size);
-}
-#endif
-
-
-void operator delete(void *p) {
- free(p);
-}
-
-
-void *operator new[](size_t size) {
- return operator new(size);
-}
-
-
-void operator delete[](void *p) {
- operator delete(p);
-}
-
-
-char *m_strdup(const char *str) {
- if (str==NULL) return NULL;
- int len = (int)strlen(str)+1;
- char *dup = (char*) m_alloc(len);
- MoveMemory((void*)dup,(void*)str,len);
- return dup;
-}
-*/
-
void __fastcall safe_free(void** p)
{
if (*p) {
diff --git a/plugins/FlashAvatars/src/cflash.cpp b/plugins/FlashAvatars/src/cflash.cpp
index 2d101cbbe6..9a2a1511ac 100644
--- a/plugins/FlashAvatars/src/cflash.cpp
+++ b/plugins/FlashAvatars/src/cflash.cpp
@@ -60,16 +60,14 @@ int __fastcall strcmpnull(const char *str1, const char *str2) {
}
-struct flash_avatar_item {
+struct flash_avatar_item : public MZeroedObject
+{
HANDLE hContact;
FLASHAVATAR hFA;
IShockwaveFlash* pFlash;
char* getProto() { return (hFA.cProto) ? hFA.cProto : (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hFA.hContact, 0); }
- __inline void* operator new(size_t size) { return mir_calloc(size); }
- __inline void operator delete( void* p ) { mir_free(p); }
-
flash_avatar_item(HANDLE contact, FLASHAVATAR& fa, IShockwaveFlash *flash) { hContact = contact; hFA = fa; pFlash = flash; }
};
diff --git a/plugins/ModernOpt/src/modernopt.cpp b/plugins/ModernOpt/src/modernopt.cpp
index 1345631268..16ed0738ff 100644
--- a/plugins/ModernOpt/src/modernopt.cpp
+++ b/plugins/ModernOpt/src/modernopt.cpp
@@ -52,15 +52,8 @@ static int g_iSectionRestore = 0;
static int ModernOptionsObject_Comparator(const ModernOptionsObject *ptr1, const ModernOptionsObject *ptr2);
-struct ModernOptionsData
+struct ModernOptionsData : public MZeroedObject
{
- __inline void* operator new( size_t size )
- { return calloc( 1, size );
- }
- __inline void operator delete( void* p )
- { free( p );
- }
-
ModernOptionsData(): pObjectList(1, ModernOptionsObject_Comparator) {}
LIST<ModernOptionsObject> pObjectList;
@@ -149,9 +142,9 @@ static int ModernOptionsObject_Comparator(const ModernOptionsObject *ptr1, const
}
void li_List_Destruct(LIST<ModernOptionsObject> &pList, ItemDestuctor pItemDestructor)
-{
+{
int i=0;
- for (i=0; i<pList.getCount(); i++) pItemDestructor(pList[i]);
+ for (i=0; i<pList.getCount(); i++) pItemDestructor(pList[i]);
pList.destroy();
}
@@ -196,7 +189,7 @@ static INT_PTR CALLBACK ModernOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam,
switch (msg) {
case WM_INITDIALOG:
{
- TranslateDialogDefault(hwndDlg);
+ TranslateDialogDefault(hwndDlg);
HIMAGELIST himl = 0;
dat = (struct ModernOptionsData *)lParam;
@@ -350,7 +343,7 @@ static INT_PTR CALLBACK ModernOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam,
// UI utilities
static HWND ModernOptUI_ShowPage_Impl(HWND hwndDlg, struct ModernOptionsData *dat, int iPage, int dx, HWND hwndInsertAfter)
{
- if ((iPage < 0) || (iPage >= dat->pObjectList.getCount()))
+ if ((iPage < 0) || (iPage >= dat->pObjectList.getCount()))
return NULL;
dat->iPage = iPage;
@@ -389,7 +382,7 @@ static HWND ModernOptUI_ShowPage_Impl(HWND hwndDlg, struct ModernOptionsData *da
if (ignoreObj->optObject.iType == MODERNOPT_TYPE_IGNOREOBJECT)
ModernOptIgnore_AddItem(&ignoreObj->optObject);
} } }
- }
+ }
else ShowWindow(obj->hwnd, SW_SHOW);
ShowWindow(GetDlgItem(hwndDlg, IDC_BTN_EXPERT), (obj->optObject.lpzClassicGroup || obj->optObject.lpzClassicPage) ? SW_SHOW : SW_HIDE);
@@ -422,7 +415,7 @@ static void ModernOptUI_ShowPage(HWND hwndDlg, struct ModernOptionsData *dat, in
RECT rcWnd; GetWindowRect(dat->pObjectList[i]->hwnd, &rcWnd);
dx += rcWnd.bottom - rcWnd.top;// + 30;
}
- }
+ }
else if (dat->pObjectList[i]->hwnd)
{
ShowWindow(dat->pObjectList[i]->hwnd, SW_HIDE);
@@ -436,7 +429,7 @@ static void ModernOptUI_SelectSection(HWND hwndDlg, struct ModernOptionsData *da
HWND hwndTree = GetDlgItem(hwndDlg, IDC_TV_SUBSECTIONS);
dat->iSection = iSection;
-
+
SendMessage(hwndTree, WM_SETREDRAW, FALSE, 0);
TreeView_DeleteAllItems(hwndTree);
for (i = 0; i < dat->pObjectList.getCount(); ++i) {
@@ -449,8 +442,8 @@ static void ModernOptUI_SelectSection(HWND hwndDlg, struct ModernOptionsData *da
if (obj->optObject.iType == MODERNOPT_TYPE_SECTIONPAGE) {
ModernOptUI_ShowPage(hwndDlg, dat, i);
break;
- }
-
+ }
+
if (obj->optObject.iType == MODERNOPT_TYPE_SUBSECTIONPAGE) {
TVINSERTSTRUCT tvis = {0};
tvis.hParent = TVI_ROOT;
@@ -472,7 +465,7 @@ static void ModernOptUI_SelectSection(HWND hwndDlg, struct ModernOptionsData *da
ShowWindow(hwndTree, SW_SHOW);
RedrawWindow(hwndTree, NULL, NULL, RDW_INVALIDATE);
TreeView_Select(hwndTree, TreeView_GetRoot(hwndTree), TVGN_CARET);
- }
+ }
else ShowWindow(hwndTree, SW_HIDE);
}
@@ -486,7 +479,7 @@ static INT_PTR svcModernOpt_Impl(WPARAM wParam, LPARAM lParam)
NotifyEventHooks(hevtModernOpt_Initialize, (WPARAM)dat, 0);
hwndModernOpt = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_MODERNOPT), NULL, ModernOptDlgProc, (LPARAM)dat);
ShowWindow(hwndModernOpt, SW_SHOW);
- }
+ }
else SetForegroundWindow(hwndModernOpt);
return 0;
diff --git a/plugins/NewAwaySysMod/Properties.cpp b/plugins/NewAwaySysMod/Properties.cpp
index eb14d79950..c9dc3c1c9c 100644
--- a/plugins/NewAwaySysMod/Properties.cpp
+++ b/plugins/NewAwaySysMod/Properties.cpp
@@ -22,42 +22,6 @@
CProtoStates g_ProtoStates;
-
-/*char *mystrdup(const char *szStr)
-{
- char *szNew = (char *)malloc(lstrlen(szStr) + 1);
- lstrcpy(szNew, szStr);
- return szNew;
-}
-
-
-void *mymalloc(size_t size)
-{
- return HeapAlloc(GetProcessHeap(), 0, size);//GlobalAlloc(GPTR, size);
-}
-
-
-void myfree(void *p)
-{
- //GlobalFree(p);
- HeapFree(GetProcessHeap(), 0, p);
-}
-
-
-void *__cdecl operator new(unsigned int size)
-{
- return (void *)HeapAlloc(GetProcessHeap(), 0, size);//GlobalAlloc(GPTR, size);
-}
-
-
-void __cdecl operator delete(void *p)
-{
-// GlobalFree((HGLOBAL)p);
- HeapFree(GetProcessHeap(), 0, p);
-}
-*/
-
-
void ResetContactSettingsOnStatusChange(HANDLE hContact)
{
DBDeleteContactSetting(hContact, MOD_NAME, DB_REQUESTCOUNT);
diff --git a/plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.h b/plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.h
index 93fc3ba8c7..5820a5f85c 100644
--- a/plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.h
+++ b/plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.h
@@ -53,17 +53,14 @@
#define FLAG_MONITORMIRANDA 64 // db: monitor miranda activity only
#define FLAG_ONLOCK 128 // db: on work station lock
-struct TAAAProtoSetting : public PROTOCOLSETTINGEX
+struct TAAAProtoSetting : public PROTOCOLSETTINGEX, public MZeroedObject
{
TAAAProtoSetting( PROTOACCOUNT* pa );
~TAAAProtoSetting();
- __inline void* operator new( size_t size ) { return calloc( 1, size ); }
- __inline void operator delete( void* p ) { free( p ); }
-
int originalStatusMode;
- STATES
- oldState,
+ STATES
+ oldState,
curState;
BOOL statusChanged; // AAA changed the status, don't update mStatus
BOOL mStatus; // status changed manually or not ?
diff --git a/plugins/StatusPlugins/StartupStatus/startupstatus.h b/plugins/StatusPlugins/StartupStatus/startupstatus.h
index 640638f788..69cd54b392 100644
--- a/plugins/StatusPlugins/StartupStatus/startupstatus.h
+++ b/plugins/StatusPlugins/StartupStatus/startupstatus.h
@@ -29,14 +29,11 @@
#define MODULENAME "StartupStatus"
-struct TSSSetting : public PROTOCOLSETTINGEX
+struct TSSSetting : public PROTOCOLSETTINGEX, public MZeroedObject
{
TSSSetting( PROTOACCOUNT* pa );
TSSSetting( int profile, PROTOACCOUNT* pa );
~TSSSetting();
-
- __inline void* operator new( size_t size ) { return calloc( 1, size ); }
- __inline void operator delete( void* p ) { free( p ); }
};
typedef OBJLIST<TSSSetting> TSettingsList;
@@ -48,10 +45,8 @@ struct PROFILECE
TCHAR *msg;
};
-struct PROFILEOPTIONS
+struct PROFILEOPTIONS : public MZeroedObject
{
- __inline void* operator new( size_t size ) { return mir_calloc(size); }
- __inline void operator delete( void* p ) { mir_free(p); }
__inline ~PROFILEOPTIONS()
{
delete ps;
diff --git a/plugins/TopToolBar/common.h b/plugins/TopToolBar/common.h
index 996c3bf50f..0840111f2f 100644
--- a/plugins/TopToolBar/common.h
+++ b/plugins/TopToolBar/common.h
@@ -50,10 +50,8 @@
///////////////////////////////////////////////////////////////////////////////
// TopButtonInt class
-struct TopButtonInt
+struct TopButtonInt : public MZeroedObject
{
- __inline void* operator new(size_t size) { return calloc( 1, size ); }
- __inline void operator delete(void* p) { free( p ); }
~TopButtonInt();
DWORD CheckFlags(DWORD Flags);
@@ -77,12 +75,12 @@ struct TopButtonInt
int x, y, arrangedpos;
HICON hIconUp, hIconDn;
HANDLE hIconHandleUp, hIconHandleDn;
-
+
char *pszService;
TCHAR *ptszProgram;
char *pszName;
TCHAR *ptszTooltip;
-
+
LPARAM lParamUp;
WPARAM wParamUp;
LPARAM lParamDown;