summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/AVS/src/stdafx.h4
-rw-r--r--plugins/Clist_modern/src/modern_clc.cpp32
-rw-r--r--plugins/Clist_nicer/src/clcpaint.cpp2
-rw-r--r--plugins/Clist_nicer/src/clui.cpp4
-rw-r--r--plugins/Clist_nicer/src/coolscroll.cpp5
-rw-r--r--plugins/DbEditorPP/src/exportimport.cpp2
-rw-r--r--plugins/IEView/src/IEView.cpp2
-rw-r--r--plugins/IEView/src/MUCCHTMLBuilder.cpp2
-rw-r--r--plugins/IEView/src/ScriverHTMLBuilder.cpp6
-rw-r--r--plugins/IEView/src/TextToken.cpp12
-rw-r--r--plugins/IEView/src/TextToken.h14
11 files changed, 37 insertions, 48 deletions
diff --git a/plugins/AVS/src/stdafx.h b/plugins/AVS/src/stdafx.h
index eb0199eb25..b2479bd540 100644
--- a/plugins/AVS/src/stdafx.h
+++ b/plugins/AVS/src/stdafx.h
@@ -99,8 +99,8 @@ struct protoPicCacheEntry : public AVATARCACHEENTRY, public MZeroedObject
void clear();
- char* szProtoname;
- int cacheType = 0;
+ char *szProtoname = nullptr;
+ int cacheType = 0;
union {
PROTOCOLDESCRIPTOR *pd;
PROTOACCOUNT *pa;
diff --git a/plugins/Clist_modern/src/modern_clc.cpp b/plugins/Clist_modern/src/modern_clc.cpp
index ad2fe35a51..e59f10c3fe 100644
--- a/plugins/Clist_modern/src/modern_clc.cpp
+++ b/plugins/Clist_modern/src/modern_clc.cpp
@@ -284,9 +284,9 @@ static bool clcItemNotHiddenOffline(ClcGroup *group, ClcContact *contact)
return false;
}
-static LRESULT clcOnCreate(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
+static LRESULT clcOnCreate(ClcData*, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- dat = new ClcData();
+ ClcData *dat = new ClcData();
SetWindowLongPtr(hwnd, 0, (LONG_PTR)dat);
dat->hCheckBoxTheme = xpt_AddThemeHandle(hwnd, L"BUTTON");
dat->m_paintCouter = 0;
@@ -551,25 +551,27 @@ static LRESULT clcOnKeyDown(ClcData *dat, HWND hwnd, UINT, WPARAM wParam, LPARAM
dat->selection = cliGetRowsPriorTo(&dat->list, group, -1);
selMoved = 1;
}
- else {
- if (contact->type == CLCIT_GROUP) {
- if (changeGroupExpand == 1) {
- if (!contact->group->expanded) {
- dat->selection--;
- selMoved = 1;
- }
- else g_clistApi.pfnSetGroupExpand(hwnd, dat, contact->group, 0);
- }
- else if (changeGroupExpand == 2) {
- g_clistApi.pfnSetGroupExpand(hwnd, dat, contact->group, 1);
- dat->selection++;
+ else if (contact->type == CLCIT_GROUP) {
+ if (changeGroupExpand == 1) {
+ if (!contact->group->expanded) {
+ dat->selection--;
selMoved = 1;
}
- else { SetCapture(hwnd); return 0; }
+ else g_clistApi.pfnSetGroupExpand(hwnd, dat, contact->group, 0);
+ }
+ else if (changeGroupExpand == 2) {
+ g_clistApi.pfnSetGroupExpand(hwnd, dat, contact->group, 1);
+ dat->selection++;
+ selMoved = 1;
+ }
+ else {
+ SetCapture(hwnd);
+ return 0;
}
}
}
}
+
if (selMoved) {
if (dat->selection >= g_clistApi.pfnGetGroupContentsCount(&dat->list, 1))
dat->selection = g_clistApi.pfnGetGroupContentsCount(&dat->list, 1) - 1;
diff --git a/plugins/Clist_nicer/src/clcpaint.cpp b/plugins/Clist_nicer/src/clcpaint.cpp
index 5274ffa3f3..ed679ef10a 100644
--- a/plugins/Clist_nicer/src/clcpaint.cpp
+++ b/plugins/Clist_nicer/src/clcpaint.cpp
@@ -1223,7 +1223,7 @@ void PaintClc(HWND hwnd, struct ClcData *dat, HDC hdc, RECT *rcPaint)
GetSystemTime(&cfg::dat.st);
SystemTimeToFileTime(&cfg::dat.st, &cfg::dat.ft);
- cfg::dat.bUseFastGradients = cfg::dat.bWantFastGradients && (GdiGradientFill != nullptr);
+ cfg::dat.bUseFastGradients = cfg::dat.bWantFastGradients;
av_left = (cfg::dat.dwFlags & CLUI_FRAME_AVATARSLEFT);
av_right = (cfg::dat.dwFlags & CLUI_FRAME_AVATARSRIGHT);
diff --git a/plugins/Clist_nicer/src/clui.cpp b/plugins/Clist_nicer/src/clui.cpp
index eecf002363..544fe91482 100644
--- a/plugins/Clist_nicer/src/clui.cpp
+++ b/plugins/Clist_nicer/src/clui.cpp
@@ -946,9 +946,9 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
GetWindowRect(hwnd, &rcWin);
BitBlt(hdc, 0, 0, rcClient.right, rcClient.bottom, dc, rcWin.left, rcWin.top, SRCCOPY);
+ ReleaseDC(nullptr, dc);
}
- else
- FillRect(hdc, &rcClient, g_CLUISkinnedBkColor);
+ else FillRect(hdc, &rcClient, g_CLUISkinnedBkColor);
}
if (cfg::dat.bClipBorder != 0 || cfg::dat.dwFlags & CLUI_FRAME_ROUNDEDFRAME) {
diff --git a/plugins/Clist_nicer/src/coolscroll.cpp b/plugins/Clist_nicer/src/coolscroll.cpp
index f27fcf6e9c..5a8828a312 100644
--- a/plugins/Clist_nicer/src/coolscroll.cpp
+++ b/plugins/Clist_nicer/src/coolscroll.cpp
@@ -1631,7 +1631,6 @@ static LRESULT ThumbTrackHorz(SCROLLBAR *sbar, HWND hwnd, int x, int y)
}
RotateRect0(sbar, &rc2);
- ReleaseDC(hwnd, hdc);
//post a SB_TRACKPOS message!!!
siMaxMin = si->nMax - si->nMin;
@@ -1649,10 +1648,8 @@ static LRESULT ThumbTrackHorz(SCROLLBAR *sbar, HWND hwnd, int x, int y)
nLastPos = pos;
-//#ifdef CUSTOM_DRAW
PostCustomPrePostPaint(hwnd, hdc, sbar, CDDS_POSTPAINT);
-//#endif
-
+ ReleaseDC(hwnd, hdc);
return 0;
}
diff --git a/plugins/DbEditorPP/src/exportimport.cpp b/plugins/DbEditorPP/src/exportimport.cpp
index 8241c13ed5..956e317ccb 100644
--- a/plugins/DbEditorPP/src/exportimport.cpp
+++ b/plugins/DbEditorPP/src/exportimport.cpp
@@ -341,7 +341,7 @@ void importSettings(MCONTACT hContact, char *utf8)
deleteModule(hContact, module, 0);
}
}
- else if (strstr(&importstring[i], "=") && module[0]) { // get the setting
+ else if (strchr(&importstring[i], '=') && module[0]) { // get the setting
if (end = strpbrk(&importstring[i + 1], "=")) {
*end = '\0';
mir_strcpy(setting, &importstring[i]);
diff --git a/plugins/IEView/src/IEView.cpp b/plugins/IEView/src/IEView.cpp
index 28b19a3562..260b9b007d 100644
--- a/plugins/IEView/src/IEView.cpp
+++ b/plugins/IEView/src/IEView.cpp
@@ -1122,7 +1122,7 @@ void IEView::saveDocument()
VARIANT vValue;
vValue.vt = VT_BOOL;
- vValue.boolVal = TRUE;
+ vValue.boolVal = VARIANT_TRUE;
VARIANT_BOOL vb;
document->execCommand(BSTR_PTR(L"SaveAs"), VARIANT_FALSE, vValue, &vb);
diff --git a/plugins/IEView/src/MUCCHTMLBuilder.cpp b/plugins/IEView/src/MUCCHTMLBuilder.cpp
index f7885430c1..b2bd3968f4 100644
--- a/plugins/IEView/src/MUCCHTMLBuilder.cpp
+++ b/plugins/IEView/src/MUCCHTMLBuilder.cpp
@@ -199,7 +199,7 @@ void MUCCHTMLBuilder::appendEventNonTemplate(IEView *view, IEVIEWEVENT *event)
str.AppendFormat("<div class=\"%s\">", isSent ? "divOut" : "divIn");
if (dwData & IEEDD_MUCC_SHOW_TIME || dwData & IEEDD_MUCC_SHOW_DATE)
- str.AppendFormat("<span class=\"%s\">%s </span>", isSent ? "timestamp" : "timestamp", timestampToString(dwData, eventData->time));
+ str.AppendFormat("<span class=\"%s\">%s </span>", "timestamp", timestampToString(dwData, eventData->time));
if (dwData & IEEDD_MUCC_SHOW_NICK)
str.AppendFormat("<span class=\"%s\">%s: </span>", isSent ? "nameOut" : "nameIn", szName.get());
diff --git a/plugins/IEView/src/ScriverHTMLBuilder.cpp b/plugins/IEView/src/ScriverHTMLBuilder.cpp
index bcb7096ba5..7086f35447 100644
--- a/plugins/IEView/src/ScriverHTMLBuilder.cpp
+++ b/plugins/IEView/src/ScriverHTMLBuilder.cpp
@@ -302,15 +302,15 @@ void ScriverHTMLBuilder::appendEventNonTemplate(IEView *view, IEVIEWEVENT *event
/* Scriver-specific formatting */
if ((dwFlags & SMF_LOG_DRAWLINES) && isGroupBreak && getLastEventType() != -1) {
if (eventData->iType == IEED_EVENT_MESSAGE)
- className = isRTL ? isSent ? "divOutGridRTL" : "divInGridRTL" : isSent ? "divOutGrid" : "divInGrid";
+ className = isRTL ? (isSent ? "divOutGridRTL" : "divInGridRTL") : (isSent ? "divOutGrid" : "divInGrid");
else
- className = isRTL ? isSent ? "divNoticeGridRTL" : "divNoticeGridRTL" : isSent ? "divNoticeGrid" : "divNoticeGrid";
+ className = isRTL ? "divNoticeGridRTL" : "divNoticeGrid";
}
else {
if (eventData->iType == IEED_EVENT_MESSAGE)
className = isRTL ? (isSent ? "divOutRTL" : "divInRTL") : (isSent ? "divOut" : "divIn");
else
- className = isRTL ? "divNoticeRTL" : (isSent ? "divNotice" : "divNotice");
+ className = isRTL ? "divNoticeRTL" : "divNotice";
}
CMStringA str;
diff --git a/plugins/IEView/src/TextToken.cpp b/plugins/IEView/src/TextToken.cpp
index aebc99d09f..0e322d00ec 100644
--- a/plugins/IEView/src/TextToken.cpp
+++ b/plugins/IEView/src/TextToken.cpp
@@ -23,26 +23,16 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
TextToken::TextToken(int _type, const char *_text, int _len)
{
- next = nullptr;
- tag = 0;
- end = false;
type = _type;
text = mir_strndup(_text, _len);
wtext = mir_a2u(text);
- link = nullptr;
- wlink = nullptr;
}
TextToken::TextToken(int _type, const wchar_t *_wtext, int _len)
{
- next = nullptr;
- tag = 0;
- end = false;
type = _type;
wtext = mir_wstrndup(_wtext, _len);
text = mir_u2a(wtext);
- link = nullptr;
- wlink = nullptr;
}
TextToken::~TextToken()
@@ -520,7 +510,7 @@ void TextToken::toString(CMStringW &str)
match = wcsstr(match + 11, L"v=");
if (match != nullptr) {
match += 2;
- wchar_t *match2 = wcsstr(match, L"&");
+ wchar_t *match2 = wcschr(match, '&');
int len = match2 != nullptr ? match2 - match : (int)mir_wstrlen(match);
match = mir_wstrdup(match);
match[len] = 0;
diff --git a/plugins/IEView/src/TextToken.h b/plugins/IEView/src/TextToken.h
index 7e5ef3260c..8cc048e18a 100644
--- a/plugins/IEView/src/TextToken.h
+++ b/plugins/IEView/src/TextToken.h
@@ -25,15 +25,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
class TextToken {
private:
int type;
- bool end;
- int tag;
- DWORD value;
+ bool end = false;
+ int tag = 0;
+ DWORD value = 0;
wchar_t *wtext;
char *text;
- wchar_t *wlink;
- char *link;
- TextToken *next;
- static TextToken* tokenizeBBCodes(const wchar_t *text, int len);
+ wchar_t *wlink = nullptr;
+ char *link = nullptr;
+ TextToken *next = nullptr;
+ static TextToken* tokenizeBBCodes(const wchar_t *text, int len);
public:
enum TOKENS {
END = 0,