From 0769aa40dd28fd616de393c6f14b85f762e515c2 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 11 Feb 2014 19:30:58 +0000 Subject: shameful death of another 'HANDLE' git-svn-id: http://svn.miranda-ng.org/main/trunk@8103 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Clist_mw/src/clc.cpp | 8 ++++---- plugins/Clist_mw/src/clc.h | 2 +- plugins/Clist_mw/src/clcidents.cpp | 16 ++++++++-------- plugins/Clist_mw/src/clcitems.cpp | 6 +++--- 4 files changed, 16 insertions(+), 16 deletions(-) (limited to 'plugins/Clist_mw/src') diff --git a/plugins/Clist_mw/src/clc.cpp b/plugins/Clist_mw/src/clc.cpp index a4459348af..e0fe218ebb 100644 --- a/plugins/Clist_mw/src/clc.cpp +++ b/plugins/Clist_mw/src/clc.cpp @@ -162,14 +162,14 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L ClcContact *contact; ClcGroup *group; - if (!FindItem(hwnd, dat, (HANDLE)wParam, &contact, &group, NULL)) { + if (!FindItem(hwnd, dat, wParam, &contact, &group, NULL)) { if (shouldShow && CallService(MS_DB_CONTACT_IS, wParam, 0)) { if (dat->selection>=0 && GetRowByIndex(dat,dat->selection,&selcontact,NULL) != -1) hSelItem = (MCONTACT)pcli->pfnContactToHItem(selcontact); AddContactToTree(hwnd, dat, wParam, 0, 0); needsResort = 1; recalcScrollBar = 1; - FindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL); + FindItem(hwnd, dat, wParam, &contact, NULL, NULL); if (contact) { contact->iImage = (WORD)lParam; pcli->pfnNotifyNewContact(hwnd, wParam); @@ -201,7 +201,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L } } if (hSelItem) { ClcGroup *selgroup; - if ( FindItem(hwnd, dat, (HANDLE)hSelItem,&selcontact,&selgroup,NULL)) + if ( FindItem(hwnd, dat, hSelItem, &selcontact, &selgroup, NULL)) dat->selection = GetRowsPriorTo(&dat->list,selgroup,List_IndexOf((SortedList*)&selgroup->cl, selcontact)); else dat->selection = -1; @@ -220,7 +220,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L ClcContact *contact; ClcGroup *group; - if (FindItem(hwnd, dat, (HANDLE)wParam, &contact, &group, NULL) && contact != NULL) { + if (FindItem(hwnd, dat, wParam, &contact, &group, NULL) && contact != NULL) { contact->flags &= ~CONTACTF_STATUSMSG; if (!db_get_ts(wParam, "CList", "StatusMsg", &dbv)) { int j; diff --git a/plugins/Clist_mw/src/clc.h b/plugins/Clist_mw/src/clc.h index 841fb25576..efc13fd87d 100644 --- a/plugins/Clist_mw/src/clc.h +++ b/plugins/Clist_mw/src/clc.h @@ -81,7 +81,7 @@ struct ClcData : public ClcDataBase //clcidents.c int GetRowsPriorTo(ClcGroup *group,ClcGroup *subgroup,int contactIndex); -int FindItem(HWND hwnd, struct ClcData *dat, HANDLE hItem, struct ClcContact **contact, ClcGroup **subgroup, int *isVisible); +int FindItem(HWND hwnd, struct ClcData *dat, DWORD dwItem, struct ClcContact **contact, ClcGroup **subgroup, int *isVisible); int GetRowByIndex(struct ClcData *dat,int testindex,struct ClcContact **contact,ClcGroup **subgroup); void ClearRowByIndexCache(); diff --git a/plugins/Clist_mw/src/clcidents.cpp b/plugins/Clist_mw/src/clcidents.cpp index 967e13abd3..c74a2d8bfb 100644 --- a/plugins/Clist_mw/src/clcidents.cpp +++ b/plugins/Clist_mw/src/clcidents.cpp @@ -143,7 +143,7 @@ void SetClcContactCacheItem(struct ClcData *dat, MCONTACT hContact, void *contac } } -int FindItem(HWND hwnd, struct ClcData *dat, HANDLE hItem, struct ClcContact **contact, ClcGroup **subgroup, int *isVisible) +int FindItem(HWND hwnd, struct ClcData *dat, DWORD dwItem, struct ClcContact **contact, ClcGroup **subgroup, int *isVisible) { int index = 0, i; int nowVisible = 1; @@ -151,15 +151,15 @@ int FindItem(HWND hwnd, struct ClcData *dat, HANDLE hItem, struct ClcContact **c group->scanIndex = 0; - if (isVisible == NULL && hItem != NULL && subgroup == NULL && !IsHContactGroup(hItem) && !IsHContactInfo(hItem)) { + if (isVisible == NULL && dwItem != NULL && subgroup == NULL && !IsHContactGroup(dwItem) && !IsHContactInfo(dwItem)) { //try use cache - ClcCacheEntry *cacheEntry = GetCLCFullCacheEntry(dat, (MCONTACT)hItem); + ClcCacheEntry *cacheEntry = GetCLCFullCacheEntry(dat, dwItem); if (cacheEntry != NULL) { if (cacheEntry->ClcContact == NULL) { int *isv = {0}; void *z = {0}; int ret; - ret = FindItem(hwnd,dat,hItem,(struct ClcContact ** )&z,(struct ClcGroup** )&isv,NULL); + ret = FindItem(hwnd,dat,dwItem,(struct ClcContact ** )&z,(struct ClcGroup** )&isv,NULL); if (ret == 0) {return 0;} cacheEntry->ClcContact = (void *)z; } @@ -193,9 +193,9 @@ int FindItem(HWND hwnd, struct ClcData *dat, HANDLE hItem, struct ClcContact **c continue; } if (nowVisible) index++; - if ((IsHContactGroup(hItem) && group->cl.items[group->scanIndex]->type == CLCIT_GROUP && ((UINT_PTR)hItem & ~HCONTACT_ISGROUP) == group->cl.items[group->scanIndex]->groupId) || - (IsHContactContact(hItem) && group->cl.items[group->scanIndex]->type == CLCIT_CONTACT && (HANDLE)group->cl.items[group->scanIndex]->hContact == hItem) || - (IsHContactInfo(hItem) && group->cl.items[group->scanIndex]->type == CLCIT_INFO && (HANDLE)group->cl.items[group->scanIndex]->hContact == (HANDLE)((UINT_PTR)hItem & ~HCONTACT_ISINFO))) + if ((IsHContactGroup(dwItem) && group->cl.items[group->scanIndex]->type == CLCIT_GROUP && (dwItem & ~HCONTACT_ISGROUP) == group->cl.items[group->scanIndex]->groupId) || + (IsHContactContact(dwItem) && group->cl.items[group->scanIndex]->type == CLCIT_CONTACT && group->cl.items[group->scanIndex]->hContact == dwItem) || + (IsHContactInfo(dwItem) && group->cl.items[group->scanIndex]->type == CLCIT_INFO && group->cl.items[group->scanIndex]->hContact == (dwItem & ~HCONTACT_ISINFO))) { if (isVisible) { if ( !nowVisible) *isVisible = 0; @@ -216,7 +216,7 @@ int FindItem(HWND hwnd, struct ClcData *dat, HANDLE hItem, struct ClcContact **c if (group->cl.items[group->scanIndex]->type == CLCIT_CONTACT && group->cl.items[group->scanIndex]->SubAllocated>0) for (i = 1; i<=group->cl.items[group->scanIndex]->SubAllocated; i++) - if (IsHContactContact(hItem) && group->cl.items[group->scanIndex]->subcontacts[i-1].hContact == (MCONTACT)hItem) { + if (IsHContactContact(dwItem) && group->cl.items[group->scanIndex]->subcontacts[i-1].hContact == dwItem) { if (contact) *contact = &group->cl.items[group->scanIndex]->subcontacts[i-1]; if (subgroup) *subgroup = group; return 1; diff --git a/plugins/Clist_mw/src/clcitems.cpp b/plugins/Clist_mw/src/clcitems.cpp index 93359b6deb..5bccc89885 100644 --- a/plugins/Clist_mw/src/clcitems.cpp +++ b/plugins/Clist_mw/src/clcitems.cpp @@ -184,7 +184,7 @@ static struct ClcContact* AddContactToGroup(struct ClcData *dat,ClcGroup *group, void AddContactToTree(HWND hwnd, ClcData *dat, MCONTACT hContact, int updateTotalCount, int checkHideOffline) { - if ( FindItem(hwnd,dat,(HANDLE)hContact,NULL,NULL,NULL) == 1) + if (FindItem(hwnd, dat, hContact, NULL, NULL, NULL) == 1) return; ClcCacheEntry *cacheEntry = GetContactFullCacheEntry(hContact); @@ -283,7 +283,7 @@ void DeleteItemFromTree(HWND hwnd, MCONTACT hItem) ClearRowByIndexCache(); dat->needsResort = 1; - if ( !FindItem(hwnd,dat,(HANDLE)hItem,&contact,&group,NULL)) { + if (!FindItem(hwnd, dat, hItem, &contact, &group, NULL)) { DBVARIANT dbv; int i,nameOffset; if ( !IsHContactContact(hItem)) return; @@ -653,7 +653,7 @@ void SaveStateAndRebuildList(HWND hwnd,struct ClcData *dat) for (i = 0;ilist; else { - if (!FindItem(hwnd, dat, (HANDLE)(savedInfo[i].parentId | HCONTACT_ISGROUP), &contact, NULL, NULL)) + if (!FindItem(hwnd, dat, savedInfo[i].parentId | HCONTACT_ISGROUP, &contact, NULL, NULL)) continue; group = contact->group; } -- cgit v1.2.3