summaryrefslogtreecommitdiff
path: root/plugins/Clist_mw/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-10-24 15:21:30 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-10-24 15:21:30 +0000
commit5e01c907bf4cace9542f880bae418f71c0fd0c07 (patch)
tree4e8b60aa99bcc10540be4b0ca09bcb313ff78677 /plugins/Clist_mw/src
parent4a4b816398add26a704f13af1aa2ff5023df01af (diff)
more warning fixes
git-svn-id: http://svn.miranda-ng.org/main/trunk@6608 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_mw/src')
-rw-r--r--plugins/Clist_mw/src/CLUIFrames/cluiframes.cpp22
-rw-r--r--plugins/Clist_mw/src/CLUIFrames/statusbar.cpp2
-rw-r--r--plugins/Clist_mw/src/clc.cpp2
-rw-r--r--plugins/Clist_mw/src/clcidents.cpp2
-rw-r--r--plugins/Clist_mw/src/clcitems.cpp2
-rw-r--r--plugins/Clist_mw/src/clcpaint.cpp6
-rw-r--r--plugins/Clist_mw/src/clui.cpp2
-rw-r--r--plugins/Clist_mw/src/init.cpp2
8 files changed, 16 insertions, 24 deletions
diff --git a/plugins/Clist_mw/src/CLUIFrames/cluiframes.cpp b/plugins/Clist_mw/src/CLUIFrames/cluiframes.cpp
index 577218a782..5374b67ae1 100644
--- a/plugins/Clist_mw/src/CLUIFrames/cluiframes.cpp
+++ b/plugins/Clist_mw/src/CLUIFrames/cluiframes.cpp
@@ -609,9 +609,6 @@ int CLUIFramesStoreAllFrames()
// Get client frame
int CLUIFramesGetalClientFrame(void)
{
- if (alclientFrame != -1)
- return alclientFrame;
-
if (alclientFrame != -1) {
/* this value could become invalid if RemoveItemFromList was called,
* so we double-check */
@@ -1209,8 +1206,7 @@ INT_PTR CLUIFramesMoveUpDown(WPARAM wParam,LPARAM lParam)
}
}
- if (sd != NULL)
- free(sd);
+ free(sd);
CLUIFramesStoreFrameSettings(pos);
CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList,0);
}
@@ -1515,7 +1511,6 @@ INT_PTR CLUIFramesAddFrame(WPARAM wParam,LPARAM lParam)
Frames[nFramescount].hWnd = clfrm->hWnd;
Frames[nFramescount].height = clfrm->height;
Frames[nFramescount].TitleBar.hicon = clfrm->hIcon;
- Frames[nFramescount].TitleBar.BackColour;
Frames[nFramescount].floating = FALSE;
//override tbbtip
@@ -1742,7 +1737,6 @@ int CLUIFramesResize(const RECT newsize)
GapBetweenFrames = db_get_dw(NULL,"CLUIFrames","GapBetweenFrames",1);
TitleBarH = db_get_dw(NULL,"CLUIFrames","TitleBarH",DEFAULT_TITLEBAR_HEIGHT);
- sepw = GapBetweenFrames;
if (nFramescount < 1)
return 0;
@@ -1873,11 +1867,10 @@ INT_PTR CLUIFramesUpdateFrame(WPARAM wParam,LPARAM lParam)
if (wParam == -1) { CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList,0); return 0;}
if (lParam&FU_FMPOS) CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList,1);
lockfrm();
- wParam = id2pos(wParam);
- if (wParam<0||(int)wParam>=nFramescount) { ulockfrm(); return -1;}
- if (lParam&FU_TBREDRAW) CLUIFramesForceUpdateTB(&Frames[wParam]);
- if (lParam&FU_FMREDRAW) CLUIFramesForceUpdateFrame(&Frames[wParam]);
- //if () {}
+ int pos = id2pos(wParam);
+ if (pos < 0 || pos >= nFramescount) { ulockfrm(); return -1;}
+ if (lParam & FU_TBREDRAW) CLUIFramesForceUpdateTB(&Frames[pos]);
+ if (lParam & FU_FMREDRAW) CLUIFramesForceUpdateFrame(&Frames[pos]);
ulockfrm();
return 0;
@@ -2412,7 +2405,7 @@ LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA
ulockfrm();
}
- if (wParam & MK_LBUTTON) {
+ if (wParam & MK_RBUTTON) {
int newh = -1,prevold;
if (GetCapture() != hwnd){break;}
@@ -2933,8 +2926,7 @@ int UnLoadCLUIFramesModule(void)
mir_free(Frames[i].TitleBar.tooltip);
}
- if (Frames)
- free(Frames);
+ free(Frames);
Frames = NULL;
nFramescount = 0;
UnregisterClass(CLUIFrameTitleBarClassName,g_hInst);
diff --git a/plugins/Clist_mw/src/CLUIFrames/statusbar.cpp b/plugins/Clist_mw/src/CLUIFrames/statusbar.cpp
index 1b03281334..2b82d539b4 100644
--- a/plugins/Clist_mw/src/CLUIFrames/statusbar.cpp
+++ b/plugins/Clist_mw/src/CLUIFrames/statusbar.cpp
@@ -221,7 +221,7 @@ void DrawBackGround(HWND hwnd,HDC mhdc)
ds.hDC = hdcMem;
int startoffset = db_get_dw(NULL,"StatusBar","FirstIconOffset",0);
- int extraspace = db_get_dw(NULL,"StatusBar","BkExtraSpace",0);
+ extraspace = db_get_dw(NULL,"StatusBar","BkExtraSpace",0);
int nParts = SendMessage(hwnd,SB_GETPARTS,0,0);
RECT rc = { 0 }, clrc;
diff --git a/plugins/Clist_mw/src/clc.cpp b/plugins/Clist_mw/src/clc.cpp
index 26924d1f8c..96e34af520 100644
--- a/plugins/Clist_mw/src/clc.cpp
+++ b/plugins/Clist_mw/src/clc.cpp
@@ -229,7 +229,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L
}
}
db_free(&dbv);
- if (_tcslen(contact->szStatusMsg)>0) {
+ if (contact->szStatusMsg[0] != 0) {
contact->flags |= CONTACTF_STATUSMSG;
dat->needsResort = TRUE;
}
diff --git a/plugins/Clist_mw/src/clcidents.cpp b/plugins/Clist_mw/src/clcidents.cpp
index 52efd81c30..45987be54f 100644
--- a/plugins/Clist_mw/src/clcidents.cpp
+++ b/plugins/Clist_mw/src/clcidents.cpp
@@ -160,7 +160,7 @@ int FindItem(HWND hwnd,struct ClcData *dat,HANDLE hItem,struct ClcContact **cont
void *z = {0};
int ret;
ret = FindItem(hwnd,dat,hItem,(struct ClcContact ** )&z,(struct ClcGroup** )&isv,NULL);
- if (ret = 0) {return 0;}
+ if (ret == 0) {return 0;}
cacheEntry->ClcContact = (void *)z;
}
diff --git a/plugins/Clist_mw/src/clcitems.cpp b/plugins/Clist_mw/src/clcitems.cpp
index 12b8e2304f..ac35462c4b 100644
--- a/plugins/Clist_mw/src/clcitems.cpp
+++ b/plugins/Clist_mw/src/clcitems.cpp
@@ -172,7 +172,7 @@ static struct ClcContact * AddContactToGroup(struct ClcData *dat,ClcGroup *group
}
}
db_free(&dbv);
- if (_tcslen(group->cl.items[i]->szStatusMsg)>0) {
+ if (group->cl.items[i]->szStatusMsg[0] != 0) {
group->cl.items[i]->flags |= CONTACTF_STATUSMSG;
}
}
diff --git a/plugins/Clist_mw/src/clcpaint.cpp b/plugins/Clist_mw/src/clcpaint.cpp
index b08e989b06..f6bd3e34c4 100644
--- a/plugins/Clist_mw/src/clcpaint.cpp
+++ b/plugins/Clist_mw/src/clcpaint.cpp
@@ -154,7 +154,7 @@ void InternalPaintClc(HWND hwnd,struct ClcData *dat,HDC hdc,RECT *rcPaint)
RECT testrc;
// yes I know about GetSysColorBrush()
- COLORREF tmpbkcolour = style&CLS_CONTACTLIST ? ( /*dat->useWindowsColours ? GetSysColor(COLOR_3DFACE) :*/ dat->bkColour ) : dat->bkColour;
+ COLORREF tmpbkcolour = dat->bkColour;
if (dat->greyoutFlags & pcli->pfnClcStatusToPf2(status) || style&WS_DISABLED) grey = 1;
else if (GetFocus() != hwnd && dat->greyoutFlags&GREYF_UNFOCUS) grey = 1;
@@ -373,7 +373,7 @@ void InternalPaintClc(HWND hwnd,struct ClcData *dat,HDC hdc,RECT *rcPaint)
SetHotTrackColour(hdcMem,dat);
//checkboxes
- if (checkboxWidth && (subindex == -1 ||1)) {
+ if (checkboxWidth) {
RECT rc;
HANDLE hTheme = OpenThemeData(hwnd,L"BUTTON");
@@ -473,7 +473,7 @@ void InternalPaintClc(HWND hwnd,struct ClcData *dat,HDC hdc,RECT *rcPaint)
rc.top = y+((dat->rowHeight-fontHeight)>>1);
rc.bottom = rc.top+dat->rowHeight;
rc.right = clRect.right;
- if (Drawing->type = CLCIT_CONTACT)
+ if (Drawing->type == CLCIT_CONTACT)
if (hottrack)
ChangeToFont(hdcMem,dat,FONTID_CONTACTSHOVER,&fontHeight);
diff --git a/plugins/Clist_mw/src/clui.cpp b/plugins/Clist_mw/src/clui.cpp
index d04b463c6e..c8c22f6cc8 100644
--- a/plugins/Clist_mw/src/clui.cpp
+++ b/plugins/Clist_mw/src/clui.cpp
@@ -183,7 +183,7 @@ HICON LoadIconFromExternalFile(char *filename,int i,boolean UseLibrary,boolean r
sid.pszSection = SectName;
sid.pszName = IconName;
sid.pszDescription = Description;
- if (strlen(szMyPath) != 0)
+ if (szMyPath[0] != 0)
sid.pszDefaultFile = szMyPath;
sid.iDefaultIndex = internalidx;
diff --git a/plugins/Clist_mw/src/init.cpp b/plugins/Clist_mw/src/init.cpp
index be7d95d862..220ed4be88 100644
--- a/plugins/Clist_mw/src/init.cpp
+++ b/plugins/Clist_mw/src/init.cpp
@@ -124,7 +124,7 @@ INT_PTR SetDrawer(WPARAM wParam,LPARAM lParam)
pDrawerServiceStruct DSS = (pDrawerServiceStruct)wParam;
if (DSS->cbSize != sizeof(*DSS)) return -1;
if (DSS->PluginName == NULL) return -1;
- if (DSS->PluginName == NULL) return -1;
+ if (DSS->GetDrawFuncsServiceName == NULL) return -1;
if ( !ServiceExists(DSS->GetDrawFuncsServiceName)) return -1;