From 9374c8e701dcb61a46c89a854235d91a23bf672e Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 26 Jul 2019 20:02:16 +0300 Subject: warning fixes --- plugins/IEView/src/IEView.cpp | 2 +- plugins/IEView/src/MUCCHTMLBuilder.cpp | 2 +- plugins/IEView/src/ScriverHTMLBuilder.cpp | 6 +++--- plugins/IEView/src/TextToken.cpp | 12 +----------- plugins/IEView/src/TextToken.h | 14 +++++++------- 5 files changed, 13 insertions(+), 23 deletions(-) (limited to 'plugins/IEView/src') 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("
", isSent ? "divOut" : "divIn"); if (dwData & IEEDD_MUCC_SHOW_TIME || dwData & IEEDD_MUCC_SHOW_DATE) - str.AppendFormat("%s ", isSent ? "timestamp" : "timestamp", timestampToString(dwData, eventData->time)); + str.AppendFormat("%s ", "timestamp", timestampToString(dwData, eventData->time)); if (dwData & IEEDD_MUCC_SHOW_NICK) str.AppendFormat("%s: ", 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, -- cgit v1.2.3