summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-09-10 15:04:48 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-09-10 15:04:48 +0000
commit4f30986e0b8c25983eb43276295eea9f8f527f7e (patch)
tree0bba6b727b211bf9d4d76fc00f41f5754326b364 /src
parent1d8d61cc0a86fbd1294ddc5b07649cd477fd1de5 (diff)
atavism removed
git-svn-id: http://svn.miranda-ng.org/main/trunk@15321 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src')
-rw-r--r--src/mir_app/src/genmenu.h1
-rw-r--r--src/mir_app/src/menu_clist.cpp10
-rw-r--r--src/mir_app/src/menu_utils.cpp46
3 files changed, 23 insertions, 34 deletions
diff --git a/src/mir_app/src/genmenu.h b/src/mir_app/src/genmenu.h
index 1c29b4c6e0..1924fd8ec8 100644
--- a/src/mir_app/src/genmenu.h
+++ b/src/mir_app/src/genmenu.h
@@ -131,5 +131,4 @@ TIntMenuObject* GetMenuObjbyId(const int id);
int ProtocolOrderOptInit(WPARAM wParam, LPARAM);
-void FreeAndNil(void **p);
#endif
diff --git a/src/mir_app/src/menu_clist.cpp b/src/mir_app/src/menu_clist.cpp
index 4f103a9d07..092b735f3d 100644
--- a/src/mir_app/src/menu_clist.cpp
+++ b/src/mir_app/src/menu_clist.cpp
@@ -219,8 +219,8 @@ INT_PTR FreeOwnerDataMainMenu(WPARAM, LPARAM lParam)
{
MainMenuExecParam *mmep = (MainMenuExecParam*)lParam;
if (mmep != NULL) {
- FreeAndNil((void**)&mmep->szServiceName);
- FreeAndNil((void**)&mmep);
+ mir_free(mmep->szServiceName);
+ mir_free(mmep);
}
return 0;
}
@@ -338,9 +338,9 @@ static INT_PTR FreeOwnerDataContactMenu(WPARAM, LPARAM lParam)
{
ContactMenuExecParam *cmep = (ContactMenuExecParam*)lParam;
if (cmep != NULL) {
- FreeAndNil((void**)&cmep->szServiceName);
- FreeAndNil((void**)&cmep->pszContactOwner);
- FreeAndNil((void**)&cmep);
+ mir_free(cmep->szServiceName);
+ mir_free(cmep->pszContactOwner);
+ mir_free(cmep);
}
return 0;
}
diff --git a/src/mir_app/src/menu_utils.cpp b/src/mir_app/src/menu_utils.cpp
index d1851d2976..28d0934878 100644
--- a/src/mir_app/src/menu_utils.cpp
+++ b/src/mir_app/src/menu_utils.cpp
@@ -34,39 +34,28 @@ static int NextObjectId = 0x100, NextObjectMenuItemId = CLISTMENUIDMIN;
#if defined(_DEBUG)
static void DumpMenuItem(TMO_IntMenuItem* pParent, int level = 0)
{
- char temp[ 30 ];
+ char temp[30];
memset(temp, '\t', level);
- temp[ level ] = 0;
+ temp[level] = 0;
for (TMO_IntMenuItem *pimi = pParent; pimi != NULL; pimi = pimi->next) {
Netlib_Logf(NULL, "%sMenu item %08p [%08p]: %S", temp, pimi, pimi->mi.root, pimi->mi.name.t);
TMO_IntMenuItem *submenu = pimi->submenu.first;
if (submenu)
- DumpMenuItem(submenu, level+1);
+ DumpMenuItem(submenu, level + 1);
}
}
#endif
-static int CompareMenus(const TIntMenuObject* p1, const TIntMenuObject* p2)
+static int CompareMenus(const TIntMenuObject *p1, const TIntMenuObject *p2)
{
return mir_strcmp(p1->pszName, p2->pszName);
}
LIST<TIntMenuObject> g_menus(10, NumericKeySortT);
-void FreeAndNil(void **p)
-{
- if (p == NULL)
- return;
-
- if (*p != NULL) {
- mir_free(*p);
- *p = NULL;
- }
-}
-
TIntMenuObject* GetMenuObjbyId(int id)
{
switch (id) {
@@ -611,7 +600,8 @@ struct KillMenuItemsParam
KillMenuItemsParam(int _hLangpack) :
hLangpack(_hLangpack),
arItems(10)
- {}
+ {
+ }
int hLangpack;
LIST<TMO_IntMenuItem> arItems;
@@ -996,9 +986,9 @@ EXTERN_C MIR_APP_DLL(HMENU) Menu_Build(HMENU parent, int hMenuObject, WPARAM wPa
if (pmo == NULL)
return NULL;
- #if defined(_DEBUG)
- // DumpMenuItem(pmo->m_items.first);
- #endif
+#if defined(_DEBUG)
+ // DumpMenuItem(pmo->m_items.first);
+#endif
return BuildRecursiveMenu(parent, pmo->m_items.first, wParam, lParam);
}
@@ -1161,12 +1151,12 @@ TIntMenuObject::~TIntMenuObject()
{
MO_RecursiveWalkMenu(m_items.first, FreeMenuItem, NULL);
- FreeAndNil((void**)&FreeService);
- FreeAndNil((void**)&onAddService);
- FreeAndNil((void**)&CheckService);
- FreeAndNil((void**)&ExecService);
- FreeAndNil((void**)&ptszDisplayName);
- FreeAndNil((void**)&pszName);
+ mir_free(FreeService);
+ mir_free(onAddService);
+ mir_free(CheckService);
+ mir_free(ExecService);
+ mir_free(ptszDisplayName);
+ mir_free(pszName);
ImageList_Destroy(m_hMenuIcons);
}
@@ -1177,9 +1167,9 @@ void TIntMenuObject::freeItem(TMO_IntMenuItem *p)
CallService(FreeService, (WPARAM)p, (LPARAM)p->pUserData);
p->signature = 0;
- FreeAndNil((void**)&p->mi.name.t);
- FreeAndNil((void**)&p->UniqName);
- FreeAndNil((void**)&p->CustomName);
+ mir_free(p->mi.name.t);
+ mir_free(p->UniqName);
+ mir_free(p->CustomName);
if (p->hBmp) DeleteObject(p->hBmp);
mir_free(p);
}