diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2014-12-15 15:55:33 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2014-12-15 15:55:33 +0000 |
commit | 9d77e8b56786904331b2805a32d245a512292be4 (patch) | |
tree | 9075bd5dc97c0c675c32725c550567a223529269 /plugins/FingerprintNG/src/fingerprint.cpp | |
parent | 4713bb2ff5b737628291e2903dd0245e3a6212e4 (diff) |
Fingerprint: changed warning lavel to w4
git-svn-id: http://svn.miranda-ng.org/main/trunk@11435 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/FingerprintNG/src/fingerprint.cpp')
-rw-r--r-- | plugins/FingerprintNG/src/fingerprint.cpp | 88 |
1 files changed, 44 insertions, 44 deletions
diff --git a/plugins/FingerprintNG/src/fingerprint.cpp b/plugins/FingerprintNG/src/fingerprint.cpp index d095f6e8a5..10534fe7de 100644 --- a/plugins/FingerprintNG/src/fingerprint.cpp +++ b/plugins/FingerprintNG/src/fingerprint.cpp @@ -39,9 +39,9 @@ static INT_PTR ServiceGetClientIconW(WPARAM wParam, LPARAM lParam); static TCHAR* getSectionName(int flag) { - switch(flag) + switch (flag) { - #include "finger_groups.h" +#include "finger_groups.h" } return NULL; } @@ -70,7 +70,7 @@ void __fastcall Prepare(KN_FP_MASK* mask, bool bEnable) _tcsncpy_s(destfile, g_szSkinLib, _TRUNCATE); struct _stat64i32 stFileInfo; - if ( _tstat(destfile, &stFileInfo) == -1) + if (_tstat(destfile, &stFileInfo) == -1) return; } @@ -108,7 +108,7 @@ void RegisterIcons() for (i = 0; i < DEFAULT_KN_FP_OVERLAYS_COUNT; i++) Prepare(&def_kn_fp_overlays_mask[i], true); - if ( db_get_b(NULL, MODULENAME, "GroupMirandaVersion", 0)) { + if (db_get_b(NULL, MODULENAME, "GroupMirandaVersion", 0)) { for (i = 0; i < DEFAULT_KN_FP_OVERLAYS2_COUNT; i++) Prepare(&def_kn_fp_overlays2_mask[i], true); } @@ -119,7 +119,7 @@ void RegisterIcons() Prepare(&def_kn_fp_overlays2_mask[i], false); } - if ( db_get_b(NULL, MODULENAME, "GroupOverlaysUnicode", 1)) { + if (db_get_b(NULL, MODULENAME, "GroupOverlaysUnicode", 1)) { for (i = 0; i < DEFAULT_KN_FP_OVERLAYS3_COUNT; i++) Prepare(&def_kn_fp_overlays3_mask[i], true); } @@ -148,7 +148,7 @@ static void SetSrmmIcon(MCONTACT hContact, LPTSTR ptszMirver) sid.flags = MBF_TCHAR; sid.tszTooltip = ptszMirver; - if ( mir_tstrlen(ptszMirver)) + if (mir_tstrlen(ptszMirver)) sid.hIcon = (HICON)ServiceGetClientIconW((WPARAM)ptszMirver, TRUE); else sid.flags |= MBF_HIDDEN; @@ -177,7 +177,7 @@ int __fastcall ApplyFingerprintImage(MCONTACT hContact, LPTSTR szMirVer) return 0; } -int OnExtraIconClick(WPARAM wParam, LPARAM lParam, LPARAM) +int OnExtraIconClick(WPARAM wParam, LPARAM, LPARAM) { CallService(MS_USERINFO_SHOWDIALOG, wParam, NULL); return 0; @@ -219,10 +219,10 @@ BOOL __fastcall WildCompareW(LPWSTR wszName, LPWSTR wszMask) LPWSTR wszTemp = (LPWSTR)_alloca(wcslen(wszMask) * sizeof(WCHAR) + sizeof(WCHAR)); BOOL bExcept; - while(wszMask[e] != L'\0') + while (wszMask[e] != L'\0') { s = e; - while(wszMask[e] != L'\0' && wszMask[e] != L'|') e++; + while (wszMask[e] != L'\0' && wszMask[e] != L'|') e++; // exception mask bExcept = (*(wszMask + s) == L'^'); @@ -231,7 +231,7 @@ BOOL __fastcall WildCompareW(LPWSTR wszName, LPWSTR wszMask) memcpy(wszTemp, wszMask + s, (e - s) * sizeof(WCHAR)); wszTemp[e - s] = L'\0'; - if ( wildcmpw(wszName, wszTemp)) + if (wildcmpw(wszName, wszTemp)) return !bExcept; if (wszMask[e] != L'\0') @@ -246,12 +246,12 @@ static void MatchMasks(TCHAR* szMirVer, short *base, short *overlay, short *over { int i = 0, j = -1, k = -1, n = -1, m = -1; - for (i=0; i < DEFAULT_KN_FP_MASK_COUNT; i++) { + for (i = 0; i < DEFAULT_KN_FP_MASK_COUNT; i++) { KN_FP_MASK& p = def_kn_fp_mask[i]; if (p.hIcolibItem == NULL) continue; - if ( !WildCompareW(szMirVer, p.szMaskUpper)) + if (!WildCompareW(szMirVer, p.szMaskUpper)) continue; if (p.iIconIndex != IDI_NOTFOUND && p.iIconIndex != IDI_UNKNOWN && p.iIconIndex != IDI_UNDETECTED) { @@ -259,12 +259,12 @@ static void MatchMasks(TCHAR* szMirVer, short *base, short *overlay, short *over _tcsncpy_s(destfile, g_szSkinLib, _TRUNCATE); struct _stat64i32 stFileInfo; - if ( _tstat(destfile, &stFileInfo) == -1) + if (_tstat(destfile, &stFileInfo) == -1) i = NOTFOUND_MASK_NUMBER; } break; } - if (i == DEFAULT_KN_FP_MASK_COUNT-1) + if (i == DEFAULT_KN_FP_MASK_COUNT - 1) i = -1; if (!def_kn_fp_mask[i].fNotUseOverlay && i < DEFAULT_KN_FP_MASK_COUNT) { @@ -273,11 +273,11 @@ static void MatchMasks(TCHAR* szMirVer, short *base, short *overlay, short *over if (p.hIcolibItem == NULL) continue; - if ( !WildCompare(szMirVer, p.szMaskUpper)) + if (!WildCompare(szMirVer, p.szMaskUpper)) continue; struct _stat64i32 stFileInfo; - if ( _tstat(g_szSkinLib, &stFileInfo) != -1) + if (_tstat(g_szSkinLib, &stFileInfo) != -1) break; } @@ -286,7 +286,7 @@ static void MatchMasks(TCHAR* szMirVer, short *base, short *overlay, short *over if (p.hIcolibItem == NULL) continue; - if ( WildCompareW(szMirVer, p.szMaskUpper)) + if (WildCompareW(szMirVer, p.szMaskUpper)) break; } @@ -295,7 +295,7 @@ static void MatchMasks(TCHAR* szMirVer, short *base, short *overlay, short *over if (p.hIcolibItem == NULL) continue; - if ( WildCompareW(szMirVer, p.szMaskUpper)) + if (WildCompareW(szMirVer, p.szMaskUpper)) break; } @@ -304,7 +304,7 @@ static void MatchMasks(TCHAR* szMirVer, short *base, short *overlay, short *over if (p.hIcolibItem == NULL) continue; - if ( WildCompareW(szMirVer, p.szMaskUpper)) + if (WildCompareW(szMirVer, p.szMaskUpper)) break; } } @@ -424,19 +424,19 @@ HICON __fastcall CreateIconFromIndexes(short base, short overlay, short overlay2 * Futher routines is for creating joined 'overlay' icons. ******************************************************************************/ - /* - * CreateBitmap32 - Create DIB 32 bitmap with sizes cx*cy - */ +/* +* CreateBitmap32 - Create DIB 32 bitmap with sizes cx*cy +*/ HBITMAP __inline CreateBitmap32(int cx, int cy) { return CreateBitmap32Point(cx, cy, NULL); } - /* - * CreateBitmap32 - Create DIB 32 bitmap with sizes cx*cy and put reference - * to new bitmap pixel image memory area to void ** bits - */ +/* +* CreateBitmap32 - Create DIB 32 bitmap with sizes cx*cy and put reference +* to new bitmap pixel image memory area to void ** bits +*/ HBITMAP __fastcall CreateBitmap32Point(int cx, int cy, LPVOID* bits) { BITMAPINFO bmpi = { 0 }; @@ -467,7 +467,7 @@ BOOL __fastcall checkHasAlfa(LPBYTE from, int width, int height) { LPDWORD pt = (LPDWORD)from; LPDWORD lim = pt + width * height; - while(pt < lim) + while (pt < lim) { if (*pt & 0xFF000000) return TRUE; @@ -484,7 +484,7 @@ BOOL __fastcall checkHasAlfa(LPBYTE from, int width, int height) BOOL __fastcall checkMaskUsed(LPBYTE from) { int i; - for (i=0; i < 16 * 16 / 8; i++) + for (i = 0; i < 16 * 16 / 8; i++) { if (from[i] != 0) return TRUE; } @@ -503,7 +503,7 @@ BOOL __inline GetMaskBit(LPBYTE line, int x) * blend - alpha blend ARGB values of 2 pixels. X1 - underlaying, * X2 - overlaying points. */ -DWORD __fastcall blend(DWORD X1,DWORD X2) +DWORD __fastcall blend(DWORD X1, DWORD X2) { RGBA* q1 = (RGBA*)&X1; RGBA* q2 = (RGBA*)&X2; @@ -537,7 +537,7 @@ HICON __fastcall CreateJoinedIcon(HICON hBottom, HICON hTop) BOOL drawn = FALSE; HDC tempDC, tempDC2, tempDC3; HICON res = NULL; - HBITMAP oImage,nImage; + HBITMAP oImage, nImage; HBITMAP nMask, hbm, obmp, obmp2; LPBYTE ptPixels = NULL; ICONINFO iNew = { 0 }; @@ -618,9 +618,9 @@ HICON __fastcall CreateJoinedIcon(HICON hBottom, HICON hTop) BOOL topMaskUsed = !topHasAlpha && checkMaskUsed(TopMaskBuffer); BOOL bottomMaskUsed = !bottomHasAlpha && checkMaskUsed(BottomMaskBuffer); - for(y = 0; y < 16; y++) + for (y = 0; y < 16; y++) { - for(x = 0; x < 16; x++) + for (x = 0; x < 16; x++) { DWORD bottom_d = ((LPDWORD)bb)[x]; DWORD top_d = ((LPDWORD)tb)[x]; @@ -714,7 +714,7 @@ HANDLE __fastcall GetIconIndexFromFI(LPTSTR szMirVer) int i; HANDLE hFoundImage = INVALID_HANDLE_VALUE; - for (i=0; i < nFICount; i++) { + for (i = 0; i < nFICount; i++) { if (fiList[i].dwArray == val) { hFoundImage = fiList[i].hRegisteredImage; break; @@ -756,7 +756,7 @@ VOID ClearFI() * ICON IS ALWAYS COPIED!!! */ -static INT_PTR ServiceGetClientIconW(WPARAM wParam, LPARAM lParam) +static INT_PTR ServiceGetClientIconW(WPARAM wParam, LPARAM) { LPWSTR wszMirVer = (LPWSTR)wParam; // MirVer value to get client for. if (wszMirVer == NULL) @@ -780,7 +780,7 @@ static INT_PTR ServiceGetClientIconW(WPARAM wParam, LPARAM lParam) * returns LPCWSTR: client desription (do not destroy) or NULL */ -static INT_PTR ServiceGetClientDescrW(WPARAM wParam, LPARAM lParam) +static INT_PTR ServiceGetClientDescrW(WPARAM wParam, LPARAM) { LPWSTR wszMirVer = (LPWSTR)wParam; // MirVer value to get client for. if (wszMirVer == NULL) @@ -820,7 +820,7 @@ static INT_PTR ServiceSameClientsW(WPARAM wParam, LPARAM lParam) * Set all registered indexes in array to EMPTY_EXTRA_ICON (unregistered icon) */ -static int OnExtraIconListRebuild(WPARAM wParam, LPARAM lParam) +static int OnExtraIconListRebuild(WPARAM, LPARAM) { ClearFI(); return 0; @@ -830,7 +830,7 @@ static int OnExtraIconListRebuild(WPARAM wParam, LPARAM lParam) * OnIconsChanged */ -static int OnIconsChanged(WPARAM wParam, LPARAM lParam) +static int OnIconsChanged(WPARAM, LPARAM) { ClearFI(); return 0; @@ -841,7 +841,7 @@ static int OnIconsChanged(WPARAM wParam, LPARAM lParam) * Try to get MirVer value from db for contact and if success calls ApplyFingerprintImage */ -int OnExtraImageApply(WPARAM hContact, LPARAM lParam) +int OnExtraImageApply(WPARAM hContact, LPARAM) { if (hContact == NULL) return 0; @@ -850,7 +850,7 @@ int OnExtraImageApply(WPARAM hContact, LPARAM lParam) char *szProto = GetContactProto(hContact); if (szProto != NULL) tszMirver = db_get_tsa(hContact, szProto, "MirVer"); - + ApplyFingerprintImage(hContact, tszMirver); return 0; } @@ -910,9 +910,9 @@ static int OnContactSettingChanged(WPARAM hContact, LPARAM lParam) * Monitors SRMM window's creation to draw a statusbar icon */ -static int OnSrmmWindowEvent(WPARAM wParam, LPARAM lParam) +static int OnSrmmWindowEvent(WPARAM, LPARAM lParam) { - if ( !db_get_b(NULL, MODULENAME, "StatusBarIcon", 1)) + if (!db_get_b(NULL, MODULENAME, "StatusBarIcon", 1)) return 0; MessageWindowEventData *event = (MessageWindowEventData *)lParam; @@ -938,7 +938,7 @@ static int OnSrmmWindowEvent(WPARAM wParam, LPARAM lParam) * Hook necessary events here */ -int OnModulesLoaded(WPARAM wParam, LPARAM lParam) +int OnModulesLoaded(WPARAM, LPARAM) { g_LPCodePage = CallService(MS_LANGPACK_GETCODEPAGE, 0, 0); @@ -958,7 +958,7 @@ int OnModulesLoaded(WPARAM wParam, LPARAM lParam) sid.flags = MBF_HIDDEN; sid.dwId = 1; Srmm_AddIcon(&sid); - } + } return 0; } @@ -967,7 +967,7 @@ void InitFingerModule() { HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded); HookEvent(ME_MC_DEFAULTTCHANGED, OnMetaDefaultChanged); - + CreateServiceFunction(MS_FP_SAMECLIENTSW, ServiceSameClientsW); CreateServiceFunction(MS_FP_GETCLIENTDESCRW, ServiceGetClientDescrW); CreateServiceFunction(MS_FP_GETCLIENTICONW, ServiceGetClientIconW); |