summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2019-07-26 11:30:13 +0300
committerGeorge Hazan <ghazan@miranda.im>2019-07-26 11:30:21 +0300
commitb68ca2a7e1035ecceb09fc1efe7529d5d8c989bf (patch)
treecb23a3a4faa8e890a072085cc625fb93b4a01892
parentde4efd42afb991d26104aa37b8a4aa97ef7b5703 (diff)
warning fixes
-rw-r--r--plugins/Scriver/src/msgs.cpp2
-rw-r--r--plugins/SmileyAdd/src/anim.h16
-rw-r--r--plugins/TipperYM/src/bitmap_func.cpp3
-rw-r--r--plugins/TipperYM/src/options.cpp5
-rw-r--r--plugins/UserInfoEx/src/classPsTreeItem.cpp2
-rw-r--r--plugins/UserInfoEx/src/ctrl_annivedit.cpp6
-rw-r--r--plugins/UserInfoEx/src/svc_refreshci.cpp2
-rw-r--r--protocols/MSN/src/msn_ieembed.cpp4
-rw-r--r--protocols/MSN/src/msn_ieembed.h2
9 files changed, 20 insertions, 22 deletions
diff --git a/plugins/Scriver/src/msgs.cpp b/plugins/Scriver/src/msgs.cpp
index 468894c6eb..7569692e0f 100644
--- a/plugins/Scriver/src/msgs.cpp
+++ b/plugins/Scriver/src/msgs.cpp
@@ -138,7 +138,7 @@ static INT_PTR SendMessageCommandWorker(MCONTACT hContact, wchar_t *pszMsg)
if (szProto == nullptr)
return 1; /* unknown contact */
- if (!CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IMSEND)
+ if (!(CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IMSEND))
return 1;
HWND hwnd = Srmm_FindWindow(hContact);
diff --git a/plugins/SmileyAdd/src/anim.h b/plugins/SmileyAdd/src/anim.h
index 86e33a968a..553f8dc695 100644
--- a/plugins/SmileyAdd/src/anim.h
+++ b/plugins/SmileyAdd/src/anim.h
@@ -26,17 +26,17 @@ private:
ImageBase *m_img;
SmileyType *m_sml;
- HDC m_hdcMem;
- HBRUSH m_hbr;
+ HDC m_hdcMem;
+ HBRUSH m_hbr;
- RECT m_cliprect;
+ RECT m_cliprect;
unsigned m_nFramePosition;
- int m_offset;
- int m_counter;
- bool m_running;
- bool m_sel;
- bool m_clip;
+ int m_offset;
+ int m_counter = 0;
+ bool m_running;
+ bool m_sel;
+ bool m_clip;
void DrawFrame(HDC hdc);
diff --git a/plugins/TipperYM/src/bitmap_func.cpp b/plugins/TipperYM/src/bitmap_func.cpp
index db3a24e0c7..d10a95c460 100644
--- a/plugins/TipperYM/src/bitmap_func.cpp
+++ b/plugins/TipperYM/src/bitmap_func.cpp
@@ -175,11 +175,10 @@ void CreateFromBitmaps(bool bServiceTip)
rcWidth = skin.iWidth;
rcHeight = skin.iHeight;
}
- else if (i == SKIN_ITEM_SIDEBAR) {
+ else { // SKIN_ITEM_SIDEBAR
rcWidth = opt.iSidebarWidth;
rcHeight = skin.iHeight;
}
- else rcWidth = rcHeight = 0;
// bitmap size
iBmpWidth = FreeImage_GetWidth(fib);
diff --git a/plugins/TipperYM/src/options.cpp b/plugins/TipperYM/src/options.cpp
index 214e408c78..d075a8c88d 100644
--- a/plugins/TipperYM/src/options.cpp
+++ b/plugins/TipperYM/src/options.cpp
@@ -1909,9 +1909,8 @@ INT_PTR CALLBACK DlgProcFavouriteContacts(HWND hwndDlg, UINT msg, WPARAM wParam,
}
g_plugin.setDword("FavouriteContactsCount", count);
- opt.iFavoriteContFlags = 0;
- opt.iFavoriteContFlags |= IsDlgButtonChecked(hwndDlg, IDC_CHK_HIDEOFFLINE) ? FAVCONT_HIDE_OFFLINE : 0
- | IsDlgButtonChecked(hwndDlg, IDC_CHK_APPENDPROTO) ? FAVCONT_APPEND_PROTO : 0;
+ opt.iFavoriteContFlags = (IsDlgButtonChecked(hwndDlg, IDC_CHK_HIDEOFFLINE) ? FAVCONT_HIDE_OFFLINE : 0)
+ | (IsDlgButtonChecked(hwndDlg, IDC_CHK_APPENDPROTO) ? FAVCONT_APPEND_PROTO : 0);
g_plugin.setDword("FavContFlags", opt.iFavoriteContFlags);
}
diff --git a/plugins/UserInfoEx/src/classPsTreeItem.cpp b/plugins/UserInfoEx/src/classPsTreeItem.cpp
index 6e88f8d7cb..aac56ca1bd 100644
--- a/plugins/UserInfoEx/src/classPsTreeItem.cpp
+++ b/plugins/UserInfoEx/src/classPsTreeItem.cpp
@@ -426,7 +426,7 @@ int CPsTreeItem::Create(CPsHdr* pPsh, OPTIONSDIALOGPAGE *odp)
// load custom order
if (!(pPsh->_dwFlags & PSTVF_SORTTREE)) {
_iPosition = (int)g_plugin.getByte(PropertyKey(SET_ITEM_POS), odp->position);
- if ((_iPosition < 0) && (_iPosition > 0x800000A))
+ if ((_iPosition < 0) || (_iPosition > 0x800000A))
_iPosition = 0;
}
// read visibility state
diff --git a/plugins/UserInfoEx/src/ctrl_annivedit.cpp b/plugins/UserInfoEx/src/ctrl_annivedit.cpp
index 612a6fe0a1..a7fdec5079 100644
--- a/plugins/UserInfoEx/src/ctrl_annivedit.cpp
+++ b/plugins/UserInfoEx/src/ctrl_annivedit.cpp
@@ -187,10 +187,8 @@ MAnnivDate* CAnnivEditCtrl::FindDateById(const WORD wId)
**/
INT_PTR CAnnivEditCtrl::AddDate(MAnnivDate &mda)
{
- MAnnivDate *pmda, **pmd;
-
// if a date with wID exists, replace it
- if ((pmda = FindDateById(mda.Id())) != nullptr) {
+ if (MAnnivDate *pmda = FindDateById(mda.Id())) {
BYTE bChanged = pmda->IsChanged(),
bRemindChanged = pmda->IsReminderChanged();
@@ -209,7 +207,7 @@ INT_PTR CAnnivEditCtrl::AddDate(MAnnivDate &mda)
if (mda.Id() == ANID_NONE)
mda.Id(_numDates - 1);
- if (pmd = (MAnnivDate **)mir_realloc(_pDates, (_numDates + 1) * sizeof(pmda))) {
+ if (MAnnivDate **pmd = (MAnnivDate **)mir_realloc(_pDates, (_numDates + 1) * sizeof(MAnnivDate *))) {
_pDates = pmd;
if (_pDates[_numDates] = new MAnnivDate(mda)) {
_numDates++;
diff --git a/plugins/UserInfoEx/src/svc_refreshci.cpp b/plugins/UserInfoEx/src/svc_refreshci.cpp
index 9b28bfe730..b5d3ebaab9 100644
--- a/plugins/UserInfoEx/src/svc_refreshci.cpp
+++ b/plugins/UserInfoEx/src/svc_refreshci.cpp
@@ -199,7 +199,7 @@ public:
_bBBCode = FALSE;
}
- ~CUpdProgress()
+ virtual ~CUpdProgress()
{
}
diff --git a/protocols/MSN/src/msn_ieembed.cpp b/protocols/MSN/src/msn_ieembed.cpp
index c9b4b964a7..d093282776 100644
--- a/protocols/MSN/src/msn_ieembed.cpp
+++ b/protocols/MSN/src/msn_ieembed.cpp
@@ -376,7 +376,9 @@ IHTMLDocument2* IEEmbed::getDocument()
void IEEmbed::navigate(const wchar_t *url)
{
- pWebBrowser->Navigate((BSTR)url, nullptr, nullptr, nullptr, nullptr);
+ BSTR tmp = ::SysAllocString(url);
+ pWebBrowser->Navigate(tmp, nullptr, nullptr, nullptr, nullptr);
+ ::SysFreeString(tmp);
}
void IEEmbed::navigate(char *url)
diff --git a/protocols/MSN/src/msn_ieembed.h b/protocols/MSN/src/msn_ieembed.h
index 25cbf45b22..e1f8632341 100644
--- a/protocols/MSN/src/msn_ieembed.h
+++ b/protocols/MSN/src/msn_ieembed.h
@@ -33,7 +33,7 @@ class IEEmbed;
class IEEmbedSink :public DWebBrowserEvents2 {
private:
- int m_cRef;
+ int m_cRef = 0;
IEEmbed *ieWindow;
public:
IEEmbedSink(IEEmbed *);