From 82a3bbaf034bc286665465d8904e6d1db52e5eb4 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 8 Jan 2017 20:59:11 +0300 Subject: code cleaning --- plugins/AVS/src/acc.cpp | 6 +++--- plugins/AVS/src/cache.cpp | 6 +++--- plugins/AVS/src/options.cpp | 2 +- plugins/AVS/src/stdafx.h | 10 +++++----- plugins/AVS/src/utils.cpp | 6 +++--- plugins/Clist_modern/src/modern_cachefuncs.cpp | 6 +++--- plugins/Clist_modern/src/modern_clc.h | 2 +- plugins/Clist_nicer/src/clc.cpp | 2 +- plugins/Clist_nicer/src/clc.h | 26 +++++++++++++------------- plugins/Clist_nicer/src/clcitems.cpp | 4 ++-- plugins/Clist_nicer/src/clcpaint.cpp | 8 ++++---- plugins/IEView/src/TemplateHTMLBuilder.cpp | 8 ++++---- plugins/MyDetails/src/data.cpp | 6 +++--- plugins/Popup/src/avatars.cpp | 2 +- plugins/Popup/src/avatars_gif.cpp | 2 +- plugins/Popup/src/avatars_gif.h | 2 +- plugins/Popup/src/avatars_simple.cpp | 4 ++-- plugins/Popup/src/avatars_simple.h | 2 +- plugins/Scriver/src/msgs.h | 2 +- plugins/TabSRMM/src/msgs.h | 2 +- 20 files changed, 54 insertions(+), 54 deletions(-) (limited to 'plugins') diff --git a/plugins/AVS/src/acc.cpp b/plugins/AVS/src/acc.cpp index f24d1e6680..30dcc47720 100644 --- a/plugins/AVS/src/acc.cpp +++ b/plugins/AVS/src/acc.cpp @@ -496,11 +496,11 @@ static LRESULT CALLBACK ACCWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP int *height = (int*)lParam; // Get avatar - avatarCacheEntry *ace; + AVATARCACHEENTRY *ace; if (data->hContact == NULL) - ace = (avatarCacheEntry *)CallService(MS_AV_GETMYAVATAR, 0, (LPARAM)data->proto); + ace = (AVATARCACHEENTRY *)CallService(MS_AV_GETMYAVATAR, 0, (LPARAM)data->proto); else - ace = (avatarCacheEntry *)CallService(MS_AV_GETAVATARBITMAP, (WPARAM)data->hContact, 0); + ace = (AVATARCACHEENTRY *)CallService(MS_AV_GETAVATARBITMAP, (WPARAM)data->hContact, 0); if (ace == NULL || ace->bmHeight == 0 || ace->bmWidth == 0 || (data->respectHidden && (ace->dwFlags & AVS_HIDEONCLIST))) { *width = 0; diff --git a/plugins/AVS/src/cache.cpp b/plugins/AVS/src/cache.cpp index 6bd8f97177..18250bddd7 100644 --- a/plugins/AVS/src/cache.cpp +++ b/plugins/AVS/src/cache.cpp @@ -75,7 +75,7 @@ CacheNode* FindAvatarInCache(MCONTACT hContact, bool add, bool findAny) if (szProto == NULL || !db_get_b(NULL, AVS_MODULE, szProto, 1)) return NULL; - avatarCacheEntry tmp; + AVATARCACHEENTRY tmp; tmp.hContact = hContact; mir_cslock lck(cachecs); @@ -167,7 +167,7 @@ void DeleteAvatarFromCache(MCONTACT hContact, bool bForever) if (g_shutDown) return; - avatarCacheEntry tmp; + AVATARCACHEENTRY tmp; tmp.hContact = GetContactThatHaveTheAvatar(hContact); mir_cslock lck(cachecs); @@ -193,7 +193,7 @@ int SetAvatarAttribute(MCONTACT hContact, DWORD attrib, int mode) if (g_shutDown) return 0; - avatarCacheEntry tmp; + AVATARCACHEENTRY tmp; tmp.hContact = hContact; mir_cslock lck(cachecs); diff --git a/plugins/AVS/src/options.cpp b/plugins/AVS/src/options.cpp index e83ceb28e1..48475ff1ad 100644 --- a/plugins/AVS/src/options.cpp +++ b/plugins/AVS/src/options.cpp @@ -164,7 +164,7 @@ static void SetProtoPic(char *szProto) if (!mir_strcmp(p.szProtoname, szProto) && mir_strlen(p.szProtoname) == mir_strlen(szProto)) { if (p.hbmPic != 0) DeleteObject(p.hbmPic); - memset(&p, 0, sizeof(avatarCacheEntry)); + memset(&p, 0, sizeof(AVATARCACHEENTRY)); CreateAvatarInCache(0, &p, szProto); NotifyEventHooks(hEventChanged, 0, (LPARAM)&p); break; diff --git a/plugins/AVS/src/stdafx.h b/plugins/AVS/src/stdafx.h index a28ea994c6..4eb907d41e 100644 --- a/plugins/AVS/src/stdafx.h +++ b/plugins/AVS/src/stdafx.h @@ -64,7 +64,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -struct CacheNode : public avatarCacheEntry, public MZeroedObject +struct CacheNode : public AVATARCACHEENTRY, public MZeroedObject { CacheNode(); ~CacheNode(); @@ -76,8 +76,8 @@ struct CacheNode : public avatarCacheEntry, public MZeroedObject void wipeInfo(); }; -// The same fields as avatarCacheEntry + proto name -struct protoPicCacheEntry : public avatarCacheEntry, public MZeroedObject +// The same fields as AVATARCACHEENTRY + proto name +struct protoPicCacheEntry : public AVATARCACHEENTRY, public MZeroedObject { protoPicCacheEntry() { memset(this, 0, sizeof(*this)); }; ~protoPicCacheEntry(); @@ -126,10 +126,10 @@ void MakePathRelative(MCONTACT hContact); void MakePathRelative(MCONTACT hContact, wchar_t *dest); void MyPathToAbsolute(const wchar_t *ptszPath, wchar_t *ptszDest); -HBITMAP LoadPNG(struct avatarCacheEntry *ace, char *szFilename); +HBITMAP LoadPNG(struct AVATARCACHEENTRY *ace, char *szFilename); void UnloadCache(void); -int CreateAvatarInCache(MCONTACT hContact, avatarCacheEntry *ace, char *szProto); +int CreateAvatarInCache(MCONTACT hContact, AVATARCACHEENTRY *ace, char *szProto); void DeleteAvatarFromCache(MCONTACT hContact, bool bForever); void PicLoader(LPVOID param); void NotifyMetaAware(MCONTACT hContact, CacheNode *node = NULL, AVATARCACHEENTRY *ace = (AVATARCACHEENTRY*)-1); diff --git a/plugins/AVS/src/utils.cpp b/plugins/AVS/src/utils.cpp index a47b3f15c1..a20372b9dc 100644 --- a/plugins/AVS/src/utils.cpp +++ b/plugins/AVS/src/utils.cpp @@ -65,7 +65,7 @@ void MakePathRelative(MCONTACT hContact) // create the avatar in cache // returns 0 if not created (no avatar), iIndex otherwise, -2 if has to request avatar, -3 if avatar too big -int CreateAvatarInCache(MCONTACT hContact, avatarCacheEntry *ace, char *szProto) +int CreateAvatarInCache(MCONTACT hContact, AVATARCACHEENTRY *ace, char *szProto) { ptrW tszValue; wchar_t tszFilename[MAX_PATH]; tszFilename[0] = 0; @@ -157,7 +157,7 @@ int CreateAvatarInCache(MCONTACT hContact, avatarCacheEntry *ace, char *szProto) BITMAP bminfo; GetObject(ace->hbmPic, sizeof(bminfo), &bminfo); - ace->cbSize = sizeof(avatarCacheEntry); + ace->cbSize = sizeof(AVATARCACHEENTRY); ace->dwFlags = AVS_BITMAP_VALID; if (hContact != NULL && db_get_b(hContact, "ContactPhoto", "Hidden", 0)) ace->dwFlags |= AVS_HIDEONCLIST; @@ -280,7 +280,7 @@ void protoPicCacheEntry::clear() if (hbmPic != 0) DeleteObject(hbmPic); - memset(this, 0, sizeof(avatarCacheEntry)); + memset(this, 0, sizeof(AVATARCACHEENTRY)); } /////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/plugins/Clist_modern/src/modern_cachefuncs.cpp b/plugins/Clist_modern/src/modern_cachefuncs.cpp index e5f0f68040..e4fcfe208e 100644 --- a/plugins/Clist_modern/src/modern_cachefuncs.cpp +++ b/plugins/Clist_modern/src/modern_cachefuncs.cpp @@ -645,7 +645,7 @@ BOOL ReduceAvatarPosition(ClcContact *contact, BOOL, void *param) void Cache_ProceedAvatarInList(ClcData *dat, ClcContact *contact) { - avatarCacheEntry *ace = contact->avatar_data; + AVATARCACHEENTRY *ace = contact->avatar_data; int old_pos = contact->avatar_pos; if (ace == NULL || ace->dwFlags == AVS_BITMAP_EXPIRED || ace->hbmPic == NULL) { @@ -718,8 +718,8 @@ void Cache_GetAvatar(ClcData *dat, ClcContact *contact) } if (dat->avatars_show && !db_get_b(contact->hContact, "CList", "HideContactAvatar", 0)) { - contact->avatar_data = (avatarCacheEntry*)CallService(MS_AV_GETAVATARBITMAP, contact->hContact, 0); - if (contact->avatar_data == NULL || contact->avatar_data->cbSize != sizeof(avatarCacheEntry) || contact->avatar_data->dwFlags == AVS_BITMAP_EXPIRED) + contact->avatar_data = (AVATARCACHEENTRY*)CallService(MS_AV_GETAVATARBITMAP, contact->hContact, 0); + if (contact->avatar_data == NULL || contact->avatar_data->cbSize != sizeof(AVATARCACHEENTRY) || contact->avatar_data->dwFlags == AVS_BITMAP_EXPIRED) contact->avatar_data = NULL; if (contact->avatar_data != NULL) diff --git a/plugins/Clist_modern/src/modern_clc.h b/plugins/Clist_modern/src/modern_clc.h index 76ce6f3479..64deabf5f6 100644 --- a/plugins/Clist_modern/src/modern_clc.h +++ b/plugins/Clist_modern/src/modern_clc.h @@ -180,7 +180,7 @@ struct ClcContact : public ClcContactBase bool bSubExpanded, bImageIsSpecial; int avatar_pos; - avatarCacheEntry *avatar_data; + AVATARCACHEENTRY *avatar_data; SIZE avatar_size; CSmileyString ssText; diff --git a/plugins/Clist_nicer/src/clc.cpp b/plugins/Clist_nicer/src/clc.cpp index 2f15c72d6d..fafadeb568 100644 --- a/plugins/Clist_nicer/src/clc.cpp +++ b/plugins/Clist_nicer/src/clc.cpp @@ -423,7 +423,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L case INTM_AVATARCHANGED: contact = NULL; { - avatarCacheEntry *cEntry = (struct avatarCacheEntry *)lParam; + AVATARCACHEENTRY *cEntry = (struct AVATARCACHEENTRY *)lParam; if (wParam == 0) { //RemoveFromImgCache(0, cEntry); diff --git a/plugins/Clist_nicer/src/clc.h b/plugins/Clist_nicer/src/clc.h index 56b8fe301f..f5303f506d 100644 --- a/plugins/Clist_nicer/src/clc.h +++ b/plugins/Clist_nicer/src/clc.h @@ -117,20 +117,20 @@ struct TExtraCache struct ClcContact : public ClcContactBase { - BOOL bIsMeta; - BYTE xStatus; - int xStatusIcon; + BOOL bIsMeta; + BYTE xStatus; + int xStatusIcon; MCONTACT hSubContact; - char *metaProto; - DWORD codePage; - WORD wStatus; - int avatarLeft, extraIconRightBegin; - int isRtl; - DWORD cFlags; - BYTE bSecondLine; - - avatarCacheEntry *ace; - TExtraCache* pExtra; + char *metaProto; + DWORD codePage; + WORD wStatus; + int avatarLeft, extraIconRightBegin; + int isRtl; + DWORD cFlags; + BYTE bSecondLine; + + AVATARCACHEENTRY *ace; + TExtraCache *pExtra; }; #define DRAGSTAGE_NOTMOVED 0 diff --git a/plugins/Clist_nicer/src/clcitems.cpp b/plugins/Clist_nicer/src/clcitems.cpp index 0ab9137e9d..ebfdcd6cc8 100644 --- a/plugins/Clist_nicer/src/clcitems.cpp +++ b/plugins/Clist_nicer/src/clcitems.cpp @@ -84,8 +84,8 @@ void LoadAvatarForContact(ClcContact *p) p->ace = NULL; if (cfg::dat.bAvatarServiceAvail && (p->cFlags & ECF_AVATAR) && (!cfg::dat.bNoOfflineAvatars || p->wStatus != ID_STATUS_OFFLINE)) { - p->ace = (struct avatarCacheEntry *)CallService(MS_AV_GETAVATARBITMAP, (WPARAM)p->hContact, 0); - if (p->ace != NULL && p->ace->cbSize != sizeof(struct avatarCacheEntry)) + p->ace = (struct AVATARCACHEENTRY *)CallService(MS_AV_GETAVATARBITMAP, (WPARAM)p->hContact, 0); + if (p->ace != NULL && p->ace->cbSize != sizeof(struct AVATARCACHEENTRY)) p->ace = NULL; if (p->ace != NULL) p->ace->t_lastAccess = cfg::dat.t_now; diff --git a/plugins/Clist_nicer/src/clcpaint.cpp b/plugins/Clist_nicer/src/clcpaint.cpp index 4436f60553..f4b72bb304 100644 --- a/plugins/Clist_nicer/src/clcpaint.cpp +++ b/plugins/Clist_nicer/src/clcpaint.cpp @@ -262,7 +262,7 @@ static int __fastcall DrawAvatar(HDC hdcMem, RECT *rc, ClcContact *contact, int if (!cfg::dat.bAvatarServiceAvail || dat->bisEmbedded) return 0; - if (contact->ace != NULL && contact->ace->cbSize == sizeof(struct avatarCacheEntry)) { + if (contact->ace != NULL && contact->ace->cbSize == sizeof(struct AVATARCACHEENTRY)) { if (contact->ace->dwFlags & AVS_HIDEONCLIST) return (cfg::dat.dwFlags & CLUI_FRAME_ALWAYSALIGNNICK) ? avatar_size + 2 : 0; @@ -1458,11 +1458,11 @@ bgdone: line_num++; ClcContact *cc = group->cl[group->scanIndex]; if (cfg::dat.bForceRefetchOnPaint) - cc->ace = (struct avatarCacheEntry*) - 1; + cc->ace = (struct AVATARCACHEENTRY*) - 1; if (y > rcPaint->top - dat->row_heights[line_num] && y <= rcPaint->bottom) { - if (cc->ace == (struct avatarCacheEntry*) - 1) - cc->ace = (struct avatarCacheEntry *)CallService(MS_AV_GETAVATARBITMAP, (WPARAM)cc->hContact, 0); + if (cc->ace == (struct AVATARCACHEENTRY*) - 1) + cc->ace = (struct AVATARCACHEENTRY *)CallService(MS_AV_GETAVATARBITMAP, (WPARAM)cc->hContact, 0); RowHeight::getRowHeight(dat, cc, line_num, style); PaintItem(hdcMem, group, cc, indent, y, dat, index, hwnd, style, &clRect, &bFirstNGdrawn, groupCountsFontTopShift, dat->row_heights[line_num]); } diff --git a/plugins/IEView/src/TemplateHTMLBuilder.cpp b/plugins/IEView/src/TemplateHTMLBuilder.cpp index a1a7a3e565..2910730b1c 100644 --- a/plugins/IEView/src/TemplateHTMLBuilder.cpp +++ b/plugins/IEView/src/TemplateHTMLBuilder.cpp @@ -39,14 +39,14 @@ char* TemplateHTMLBuilder::getAvatar(MCONTACT hContact, const char *szProto) wchar_t *result = NULL; if (Options::getAvatarServiceFlags() == Options::AVATARSERVICE_PRESENT) { - avatarCacheEntry *ace; + AVATARCACHEENTRY *ace; if (hContact == NULL) - ace = (avatarCacheEntry *)CallService(MS_AV_GETMYAVATAR, 0, (LPARAM)szProto); + ace = (AVATARCACHEENTRY *)CallService(MS_AV_GETMYAVATAR, 0, (LPARAM)szProto); else - ace = (avatarCacheEntry *)CallService(MS_AV_GETAVATARBITMAP, hContact, 0); + ace = (AVATARCACHEENTRY *)CallService(MS_AV_GETAVATARBITMAP, hContact, 0); if (ace != NULL) { - if (ace->cbSize == sizeof(avatarCacheEntry)) + if (ace->cbSize == sizeof(AVATARCACHEENTRY)) result = ace->szFilename; else // compatibility: in M0.9 it will always be char* MultiByteToWideChar(CP_ACP, 0, (char*)ace->szFilename, -1, tmpPath, _countof(tmpPath)); diff --git a/plugins/MyDetails/src/data.cpp b/plugins/MyDetails/src/data.cpp index 6005135cd8..79a2cf47bd 100644 --- a/plugins/MyDetails/src/data.cpp +++ b/plugins/MyDetails/src/data.cpp @@ -265,7 +265,7 @@ void Protocol::GetAvatar() ace = NULL; // Get HBITMAP from cache - ace = (avatarCacheEntry *)CallService(MS_AV_GETMYAVATAR, 0, (LPARAM)name); + ace = (AVATARCACHEENTRY *)CallService(MS_AV_GETMYAVATAR, 0, (LPARAM)name); if (ace != NULL) avatar_bmp = ace->hbmPic; @@ -317,7 +317,7 @@ bool Protocol::CanSetAvatar() void Protocol::SetAvatar(const wchar_t *file_name) { if (CanSetAvatar()) - CallService(MS_AV_SETMYAVATART, (WPARAM)name, (LPARAM)file_name); + CallService(MS_AV_SETMYAVATARW, (WPARAM)name, (LPARAM)file_name); } bool Protocol::CanGetListeningTo() @@ -450,7 +450,7 @@ void ProtocolArray::SetAvatars(const wchar_t *file_name) if (!CanSetAvatars()) return; - CallService(MS_AV_SETMYAVATART, NULL, (WPARAM)file_name); + CallService(MS_AV_SETMYAVATARW, NULL, (WPARAM)file_name); } void ProtocolArray::SetNicks(const wchar_t *nick) diff --git a/plugins/Popup/src/avatars.cpp b/plugins/Popup/src/avatars.cpp index 73bd43ede4..d099ddbd73 100644 --- a/plugins/Popup/src/avatars.cpp +++ b/plugins/Popup/src/avatars.cpp @@ -27,7 +27,7 @@ PopupAvatar *PopupAvatar::create(MCONTACT hContact) { if (hContact) { if (ServiceExists(MS_AV_GETAVATARBITMAP)) { - avatarCacheEntry *av = (avatarCacheEntry *)CallService(MS_AV_GETAVATARBITMAP, hContact, 0); + AVATARCACHEENTRY *av = (AVATARCACHEENTRY*)CallService(MS_AV_GETAVATARBITMAP, hContact, 0); if (av && (mir_wstrlen(av->szFilename) > 4)) if (!mir_wstrcmpi(av->szFilename + mir_wstrlen(av->szFilename) - 4, L".gif")) if (db_get_b(NULL, MODULNAME, "EnableGifAnimation", 1) && GDIPlus_IsAnimatedGIF(av->szFilename)) diff --git a/plugins/Popup/src/avatars_gif.cpp b/plugins/Popup/src/avatars_gif.cpp index c0eba9f628..5b8cbac17c 100644 --- a/plugins/Popup/src/avatars_gif.cpp +++ b/plugins/Popup/src/avatars_gif.cpp @@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. GifAvatar::GifAvatar(MCONTACT hContact) : PopupAvatar() { - av = (avatarCacheEntry *)CallService(MS_AV_GETAVATARBITMAP, hContact, 0); + av = (AVATARCACHEENTRY*)CallService(MS_AV_GETAVATARBITMAP, hContact, 0); bIsAnimated = true; bIsValid = true; GDIPlus_GetGIFSize(av->szFilename, &this->width, &this->height); diff --git a/plugins/Popup/src/avatars_gif.h b/plugins/Popup/src/avatars_gif.h index eca4c186c8..07cf5e1a49 100644 --- a/plugins/Popup/src/avatars_gif.h +++ b/plugins/Popup/src/avatars_gif.h @@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. class GifAvatar : public PopupAvatar { protected: - avatarCacheEntry *av; + AVATARCACHEENTRY *av; int cachedWidth, cachedHeight; int activeFrame; diff --git a/plugins/Popup/src/avatars_simple.cpp b/plugins/Popup/src/avatars_simple.cpp index 5b55467b7f..b887bb27fd 100644 --- a/plugins/Popup/src/avatars_simple.cpp +++ b/plugins/Popup/src/avatars_simple.cpp @@ -36,7 +36,7 @@ SimpleAvatar::SimpleAvatar(HANDLE h, bool bUseBitmap) height = abs(bmp.bmHeight); avNeedFree = true; - av = new avatarCacheEntry; + av = new AVATARCACHEENTRY; av->bmHeight = abs(bmp.bmHeight); av->bmWidth = abs(bmp.bmWidth); av->hbmPic = (HBITMAP)h; @@ -46,7 +46,7 @@ SimpleAvatar::SimpleAvatar(HANDLE h, bool bUseBitmap) if (h && ServiceExists(MS_AV_GETAVATARBITMAP)) { avNeedFree = false; - av = (avatarCacheEntry *)CallService(MS_AV_GETAVATARBITMAP, (WPARAM)h, 0); + av = (AVATARCACHEENTRY*)CallService(MS_AV_GETAVATARBITMAP, (WPARAM)h, 0); if (av) { if (av->hbmPic && (av->dwFlags&AVS_BITMAP_VALID) && !(av->dwFlags&AVS_HIDEONCLIST) && !(av->dwFlags&AVS_NOTREADY)) { width = av->bmWidth; diff --git a/plugins/Popup/src/avatars_simple.h b/plugins/Popup/src/avatars_simple.h index 0479674cd4..490e1f403b 100644 --- a/plugins/Popup/src/avatars_simple.h +++ b/plugins/Popup/src/avatars_simple.h @@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. class SimpleAvatar : public PopupAvatar { private: - avatarCacheEntry *av; + AVATARCACHEENTRY *av; bool avNeedFree; public: diff --git a/plugins/Scriver/src/msgs.h b/plugins/Scriver/src/msgs.h index 2a2ba4411c..e3620340f7 100644 --- a/plugins/Scriver/src/msgs.h +++ b/plugins/Scriver/src/msgs.h @@ -134,7 +134,7 @@ struct SrmmWindowData : public CommonWindowData int lastEventType; DWORD flags; int messagesInProgress; - struct avatarCacheEntry *ace; + struct AVATARCACHEENTRY *ace; int isMixed; int sendAllConfirm; HICON statusIcon; diff --git a/plugins/TabSRMM/src/msgs.h b/plugins/TabSRMM/src/msgs.h index 29f5e8aa3b..d00fcfb84e 100644 --- a/plugins/TabSRMM/src/msgs.h +++ b/plugins/TabSRMM/src/msgs.h @@ -302,7 +302,7 @@ struct TWindowData HANDLE hTimeZone; DWORD panelStatusCX; COLORREF inputbg; - avatarCacheEntry *ace, *ownAce; + AVATARCACHEENTRY *ace, *ownAce; MEVENT *hHistoryEvents; int maxHistory, curHistory; HANDLE hTheme, hThemeIP, hThemeToolbar; -- cgit v1.2.3