diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2018-03-06 20:24:07 +0300 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2018-03-07 12:54:58 +0300 |
commit | bebafc42ab6199e86d4c2c901fac8d091bfffef0 (patch) | |
tree | f3961879845e89688c6628dccf1a3c9cd3ebb9b3 | |
parent | 7e9fef8a6ff35c63f9217fcc618d77f660e45245 (diff) |
some fixes
29 files changed, 41 insertions, 111 deletions
diff --git a/include/m_string.h b/include/m_string.h index 1077298bcb..e81376da1f 100644 --- a/include/m_string.h +++ b/include/m_string.h @@ -436,18 +436,12 @@ public: static void ConvertToOem(_CharType* pstrString, size_t size)
{
- if (size > UINT_MAX) {
- return;
- }
DWORD dwSize = static_cast<DWORD>(size);
::CharToOemBuffA(pstrString, pstrString, dwSize);
}
static void ConvertToAnsi(_CharType* pstrString, size_t size)
{
- if (size > UINT_MAX)
- return;
-
DWORD dwSize = static_cast<DWORD>(size);
::OemToCharBuffA(pstrString, pstrString, dwSize);
}
diff --git a/include/statusmodes.h b/include/statusmodes.h index 1eb49e11e8..993b75aabc 100644 --- a/include/statusmodes.h +++ b/include/statusmodes.h @@ -40,7 +40,7 @@ __forceinline bool IsStatusConnecting(int iStatus) return iStatus >= ID_STATUS_CONNECTING && iStatus < ID_STATUS_CONNECTING + MAX_CONNECT_RETRIES;
}
#else
- #define IsStatusConnecting(X) (X >= ID_STATUS_CONNECTING && X < ID_STATUS_CONNECTING + MAX_CONNECT_RETRIES)
+ #define IsStatusConnecting(X) ((X) >= ID_STATUS_CONNECTING && (X) < ID_STATUS_CONNECTING + MAX_CONNECT_RETRIES)
#endif
#define ID_STATUS_OFFLINE 40071
diff --git a/libs/freeimage/src/FreeImage/PluginBMP.cpp b/libs/freeimage/src/FreeImage/PluginBMP.cpp index eb176ff325..713a9140f7 100644 --- a/libs/freeimage/src/FreeImage/PluginBMP.cpp +++ b/libs/freeimage/src/FreeImage/PluginBMP.cpp @@ -579,13 +579,8 @@ LoadWindowsBMP(FreeImageIO *io, fi_handle handle, int flags, unsigned bitmap_bit DWORD bitfields[4]; io->read_proc(bitfields, use_bitfields * sizeof(DWORD), 1, handle); dib = FreeImage_AllocateHeader(header_only, width, height, bit_count, bitfields[0], bitfields[1], bitfields[2]); - } else { - if( bit_count == 32 ) { - dib = FreeImage_AllocateHeader(header_only, width, height, bit_count, FI_RGBA_RED_MASK, FI_RGBA_GREEN_MASK, FI_RGBA_BLUE_MASK); - } else { - dib = FreeImage_AllocateHeader(header_only, width, height, bit_count, FI_RGBA_RED_MASK, FI_RGBA_GREEN_MASK, FI_RGBA_BLUE_MASK); - } - } + } else + dib = FreeImage_AllocateHeader(header_only, width, height, bit_count, FI_RGBA_RED_MASK, FI_RGBA_GREEN_MASK, FI_RGBA_BLUE_MASK); if (dib == NULL) { throw FI_MSG_ERROR_DIB_MEMORY; @@ -787,11 +782,7 @@ LoadOS22XBMP(FreeImageIO *io, fi_handle handle, int flags, unsigned bitmap_bits_ case 24 : case 32 : { - if( bit_count == 32 ) { - dib = FreeImage_AllocateHeader(header_only, width, height, bit_count, FI_RGBA_RED_MASK, FI_RGBA_GREEN_MASK, FI_RGBA_BLUE_MASK); - } else { - dib = FreeImage_AllocateHeader(header_only, width, height, bit_count, FI_RGBA_RED_MASK, FI_RGBA_GREEN_MASK, FI_RGBA_BLUE_MASK); - } + dib = FreeImage_AllocateHeader(header_only, width, height, bit_count, FI_RGBA_RED_MASK, FI_RGBA_GREEN_MASK, FI_RGBA_BLUE_MASK); if (dib == NULL) { throw FI_MSG_ERROR_DIB_MEMORY; @@ -934,11 +925,7 @@ LoadOS21XBMP(FreeImageIO *io, fi_handle handle, int flags, unsigned bitmap_bits_ case 24 : case 32 : { - if( bit_count == 32 ) { - dib = FreeImage_AllocateHeader(header_only, width, height, bit_count, FI_RGBA_RED_MASK, FI_RGBA_GREEN_MASK, FI_RGBA_BLUE_MASK); - } else { - dib = FreeImage_AllocateHeader(header_only, width, height, bit_count, FI_RGBA_RED_MASK, FI_RGBA_GREEN_MASK, FI_RGBA_BLUE_MASK); - } + dib = FreeImage_AllocateHeader(header_only, width, height, bit_count, FI_RGBA_RED_MASK, FI_RGBA_GREEN_MASK, FI_RGBA_BLUE_MASK); if (dib == NULL) { throw FI_MSG_ERROR_DIB_MEMORY; diff --git a/libs/freeimage/src/FreeImageToolkit/BSplineRotate.cpp b/libs/freeimage/src/FreeImageToolkit/BSplineRotate.cpp index 699d0ca99e..c58c46af2b 100644 --- a/libs/freeimage/src/FreeImageToolkit/BSplineRotate.cpp +++ b/libs/freeimage/src/FreeImageToolkit/BSplineRotate.cpp @@ -667,11 +667,7 @@ FreeImage_RotateEx(FIBITMAP *dib, double angle, double x_shift, double y_shift, // allocate dst image int width = FreeImage_GetWidth(dib); int height = FreeImage_GetHeight(dib); - if( bpp == 24 ) { - dst = FreeImage_Allocate(width, height, bpp, FI_RGBA_RED_MASK, FI_RGBA_GREEN_MASK, FI_RGBA_BLUE_MASK); - } else { - dst = FreeImage_Allocate(width, height, bpp, FI_RGBA_RED_MASK, FI_RGBA_GREEN_MASK, FI_RGBA_BLUE_MASK); - } + dst = FreeImage_Allocate(width, height, bpp, FI_RGBA_RED_MASK, FI_RGBA_GREEN_MASK, FI_RGBA_BLUE_MASK); if(!dst) throw(1); // allocate a temporary 8-bit dib (no need to build a palette) diff --git a/libs/hunspell/src/affixmgr.cxx b/libs/hunspell/src/affixmgr.cxx index ffce7bb1bd..90c7eaff33 100644 --- a/libs/hunspell/src/affixmgr.cxx +++ b/libs/hunspell/src/affixmgr.cxx @@ -1854,7 +1854,7 @@ struct hentry* AffixMgr::compound_check(const std::string& word, } // check FORCEUCASE - if (rv && forceucase && (rv) && + if (rv && forceucase && (TESTAFF(rv->astr, forceucase, rv->alen)) && !(info && *info & SPELL_ORIGCAP)) rv = NULL; @@ -1962,7 +1962,7 @@ struct hentry* AffixMgr::compound_check(const std::string& word, } // check FORCEUCASE - if (rv && forceucase && (rv) && + if (rv && forceucase && (TESTAFF(rv->astr, forceucase, rv->alen)) && !(info && *info & SPELL_ORIGCAP)) rv = NULL; diff --git a/plugins/AVS/src/image_utils.cpp b/plugins/AVS/src/image_utils.cpp index 0e2107f87b..c34a998aa3 100644 --- a/plugins/AVS/src/image_utils.cpp +++ b/plugins/AVS/src/image_utils.cpp @@ -1,7 +1,7 @@ #include "stdafx.h"
#include "image_utils.h"
-#define GET_PIXEL(__P__, __X__, __Y__) ( __P__ + width * 4 * (__Y__) + 4 * (__X__))
+#define GET_PIXEL(__P__, __X__, __Y__) ( (__P__) + width * 4 * (__Y__) + 4 * (__X__))
// Make a bitmap all transparent, but only if it is a 32bpp
void MakeBmpTransparent(HBITMAP hBitmap)
diff --git a/plugins/Clist_modern/src/modern_clcpaint.cpp b/plugins/Clist_modern/src/modern_clcpaint.cpp index e930994dea..c3208bfd1e 100644 --- a/plugins/Clist_modern/src/modern_clcpaint.cpp +++ b/plugins/Clist_modern/src/modern_clcpaint.cpp @@ -753,7 +753,6 @@ void CLCPaint::_PaintRowItemsEx(HDC hdcMem, ClcData *dat, ClcContact *Drawing, R SetRect(&rc, fr_rc.right - x, p_rect.top, fr_rc.right - x + ICON_HEIGHT, p_rect.bottom);
if (dat->text_rtl != 0) _RTLRect(&rc, free_row_rc.right);
Drawing->pos_extra[iImage] = rc;
- Drawing->pos_extra[iImage] = rc;
if (Drawing->iExtraImage[iImage] != EMPTY_EXTRA_ICON)
ske_ImageList_DrawEx(dat->himlExtraColumns, Drawing->iExtraImage[iImage], hdcMem, rc.left, rc.top, 0, 0, CLR_NONE, colourFg, mode);
}
diff --git a/plugins/Clist_modern/src/modern_skinengine.cpp b/plugins/Clist_modern/src/modern_skinengine.cpp index 9ac08875bd..986de4cac7 100644 --- a/plugins/Clist_modern/src/modern_skinengine.cpp +++ b/plugins/Clist_modern/src/modern_skinengine.cpp @@ -1016,11 +1016,9 @@ static int ske_DrawSkinObject(SKINDRAWREQUEST * preq, GLYPHOBJECT * pobj) membmp = ske_CreateDIB32(PRect.right - PRect.left, PRect.bottom - PRect.top); oldbmp = (HBITMAP)SelectObject(memdc, membmp); if (oldbmp == nullptr) { - if (mode == 2) { - SelectObject(memdc, oldbmp); - DeleteDC(memdc); - DeleteObject(membmp); - } + SelectObject(memdc, oldbmp); + DeleteDC(memdc); + DeleteObject(membmp); return 0; } } @@ -1244,8 +1242,7 @@ static int ske_DrawSkinObject(SKINDRAWREQUEST * preq, GLYPHOBJECT * pobj) if ((k > 0 || k == -1) && mode == 2) { { BLENDFUNCTION bf = { AC_SRC_OVER, 0, pobj->dwAlpha, BYTE(pobj->bmBitsPixel == 32 && pobj->Style != ST_BRUSH ? AC_SRC_ALPHA : 0) }; - if (mode == 2) - OffsetRect(&PRect, mode2offset.x, mode2offset.y); + OffsetRect(&PRect, mode2offset.x, mode2offset.y); ske_AlphaBlend(preq->hDC, PRect.left, PRect.top, PRect.right - PRect.left, PRect.bottom - PRect.top, memdc, 0, 0, PRect.right - PRect.left, PRect.bottom - PRect.top, bf); } diff --git a/plugins/Clist_nicer/src/coolscroll.cpp b/plugins/Clist_nicer/src/coolscroll.cpp index cd9f0750e7..9e2ea12830 100644 --- a/plugins/Clist_nicer/src/coolscroll.cpp +++ b/plugins/Clist_nicer/src/coolscroll.cpp @@ -3010,17 +3010,10 @@ LRESULT CALLBACK CoolSBWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lP case WM_STYLECHANGED:
if (swnd->bPreventStyleChange)
- {
// the NCPAINT handler has told us to eat this message!
return 0;
- }
else
- {
- if (message == WM_STYLECHANGED)
- return CoolSB_StyleChange(swnd, hwnd, WM_STYLECHANGED, wParam, lParam);
- else
- break;
- }
+ return CoolSB_StyleChange(swnd, hwnd, WM_STYLECHANGED, wParam, lParam);
case WM_NCMOUSEMOVE:
{
diff --git a/plugins/ListeningTo/src/options.cpp b/plugins/ListeningTo/src/options.cpp index a4d934f8c8..aeea6a1b6e 100644 --- a/plugins/ListeningTo/src/options.cpp +++ b/plugins/ListeningTo/src/options.cpp @@ -177,16 +177,14 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP }
else {
// Init combo
- int total = EXTRA_ICON_COUNT, first = 0;
+ int first = 0;
SendDlgItemMessage(hwndDlg, IDC_ADV_ICON, CB_ADDSTRING, 0, (LPARAM)L"1");
SendDlgItemMessage(hwndDlg, IDC_ADV_ICON, CB_ADDSTRING, 0, (LPARAM)L"2");
- if (total > 0) {
- wchar_t tmp[10];
- for (int i = first; i <= total; i++)
- SendDlgItemMessage(hwndDlg, IDC_ADV_ICON, CB_ADDSTRING, 0, (LPARAM)_itow(i - first + 3, tmp, 10));
- }
+ wchar_t tmp[10];
+ for (int i = first; i <= EXTRA_ICON_COUNT; i++)
+ SendDlgItemMessage(hwndDlg, IDC_ADV_ICON, CB_ADDSTRING, 0, (LPARAM)_itow(i - first + 3, tmp, 10));
}
ret = SaveOptsDlgProc(optionsControls, _countof(optionsControls), MODULE_NAME, hwndDlg, msg, wParam, lParam);
diff --git a/plugins/MirOTR/ekhtml/src/ekhtml_mktables.c b/plugins/MirOTR/ekhtml/src/ekhtml_mktables.c index e9d2102325..473beb14f7 100644 --- a/plugins/MirOTR/ekhtml/src/ekhtml_mktables.c +++ b/plugins/MirOTR/ekhtml/src/ekhtml_mktables.c @@ -68,9 +68,8 @@ static EKHTML_CHARMAP_TYPE valid_attrvalue(char in){ in == '/' || in == ':' || in == '+' || in == '*' || in == '%' || in == '?' || in == '!' || in == '&' || in == '(' || in == ')' || in == '#' || in == '=' || - in == '~' || in == ']' || in == '*' || in == '@' || - in == '$' || in == '_' || in == ',' || in == ';' || - in == '|') + in == '~' || in == ']' || in == '@' || in == '$' || + in == '_' || in == ',' || in == ';' || in == '|') return 1; return 0; } diff --git a/plugins/MirandaG15/src/LCDFramework/CLCDInput.cpp b/plugins/MirandaG15/src/LCDFramework/CLCDInput.cpp index 92723e0501..cce1f30125 100644 --- a/plugins/MirandaG15/src/LCDFramework/CLCDInput.cpp +++ b/plugins/MirandaG15/src/LCDFramework/CLCDInput.cpp @@ -212,7 +212,6 @@ void CLCDInput::OnFontChanged() m_pScrollbar->SetSliderSize(m_iLineCount);
m_Marker[0].iLine = 0;
- m_Marker[0].iPosition = 0;
m_Marker[0].iPosition = (int)m_strText.length();
// Delete all offsets and recalculate them
@@ -429,9 +428,6 @@ LRESULT CLCDInput::ProcessKeyEvent(int Code, WPARAM wParam, LPARAM lParam) }
if(res != 0)
{
- if(dir != MARKER_HOLD) {
- MoveMarker(dir,res);
- }
UpdateOffsets(size);
UpdateMarker();
ScrollToMarker();
diff --git a/plugins/NewsAggregator/Src/Services.cpp b/plugins/NewsAggregator/Src/Services.cpp index 1e222f9314..68f7dedd05 100644 --- a/plugins/NewsAggregator/Src/Services.cpp +++ b/plugins/NewsAggregator/Src/Services.cpp @@ -145,7 +145,7 @@ INT_PTR CheckAllFeeds(WPARAM, LPARAM lParam) UpdateListAdd(hContact);
}
if (!ThreadRunning)
- mir_forkthread(UpdateThreadProc, nullptr);
+ mir_forkthread(UpdateThreadProc);
return 0;
}
@@ -188,7 +188,7 @@ INT_PTR CheckFeed(WPARAM hContact, LPARAM) if(IsMyContact(hContact))
UpdateListAdd(hContact);
if ( !ThreadRunning)
- mir_forkthread(UpdateThreadProc, FALSE);
+ mir_forkthread(UpdateThreadProc);
return 0;
}
diff --git a/plugins/NewsAggregator/Src/Update.cpp b/plugins/NewsAggregator/Src/Update.cpp index 07489d7dd8..56c0d2f44d 100644 --- a/plugins/NewsAggregator/Src/Update.cpp +++ b/plugins/NewsAggregator/Src/Update.cpp @@ -40,7 +40,7 @@ void CALLBACK timerProc(HWND, UINT, UINT_PTR, DWORD) }
}
if (!ThreadRunning && HaveUpdates)
- mir_forkthread(UpdateThreadProc, nullptr);
+ mir_forkthread(UpdateThreadProc);
}
}
diff --git a/plugins/NewsAggregator/Src/Utils.cpp b/plugins/NewsAggregator/Src/Utils.cpp index 2f180e9c14..43eb082f0f 100644 --- a/plugins/NewsAggregator/Src/Utils.cpp +++ b/plugins/NewsAggregator/Src/Utils.cpp @@ -193,7 +193,7 @@ time_t __stdcall DateToUnixTime(const wchar_t *stamp, bool FeedType) else {
wchar_t *weekday, monthstr[4], timezonesign[2];
int day, month = 0, year, hour, min, sec, timezoneh, timezonem;
- if (wcsstr(p, L",")) {
+ if (wcschr(p, L',')) {
weekday = wcstok(p, L",");
p = wcstok(nullptr, L",");
swscanf(p + 1, L"%d %3s %d %d:%d:%d %1s%02d%02d", &day, &monthstr, &year, &hour, &min, &sec, &timezonesign, &timezoneh, &timezonem);
@@ -230,7 +230,7 @@ time_t __stdcall DateToUnixTime(const wchar_t *stamp, bool FeedType) else
mir_snwprintf(p, 4 + 2 + 2 + 1 + 2 + 1 + 2 + 1 + 2 + 1, L"%04d%02d%02dT%02d:%02d:%02d", year, month, day, hour, min, sec);
}
- else if (wcsstr(p, L"T")) {
+ else if (wcschr(p, L'T')) {
swscanf(p, L"%d-%d-%dT%d:%d:%d", &year, &month, &day, &hour, &min, &sec);
mir_snwprintf(p, 4 + 2 + 2 + 1 + 2 + 1 + 2 + 1 + 2 + 1, L"%04d%02d%02dT%02d:%02d:%02d", year, month, day, hour, min, sec);
}
diff --git a/plugins/SMS/src/functions.cpp b/plugins/SMS/src/functions.cpp index 4501afcde7..3f125ac24e 100644 --- a/plugins/SMS/src/functions.cpp +++ b/plugins/SMS/src/functions.cpp @@ -163,7 +163,7 @@ BOOL IsContactPhone(MCONTACT hContact, LPWSTR lpwszPhone, size_t dwPhoneSize) size_t dwPhoneSizeLocal = CopyNumberW(wszPhoneLocal, lpwszPhone, dwPhoneSize);
LPSTR lpszProto = GetContactProto(hContact);
if (lpszProto) {
- if (bRet == FALSE) bRet = IsContactPhoneParam(hContact, lpszProto, "Phone", wszPhoneLocal, dwPhoneSizeLocal);
+ bRet = IsContactPhoneParam(hContact, lpszProto, "Phone", wszPhoneLocal, dwPhoneSizeLocal);
if (bRet == FALSE) bRet = IsContactPhoneParam(hContact, lpszProto, "Cellular", wszPhoneLocal, dwPhoneSizeLocal);
if (bRet == FALSE) bRet = IsContactPhoneParam(hContact, lpszProto, "Fax", wszPhoneLocal, dwPhoneSizeLocal);
}
diff --git a/plugins/Scriver/src/tabs.cpp b/plugins/Scriver/src/tabs.cpp index dad688b38a..8792f09ec7 100644 --- a/plugins/Scriver/src/tabs.cpp +++ b/plugins/Scriver/src/tabs.cpp @@ -855,7 +855,7 @@ static INT_PTR CALLBACK DlgProcParentWindow(HWND hwndDlg, UINT msg, WPARAM wPara if (nm->pt.x >= rc.left) {
CScriverWindow *pDlg = GetChildFromHWND(dat, dat->hwndActive);
if (pDlg != nullptr)
- CheckStatusIconClick(pDlg->m_hContact, dat->hwndStatus, nm->pt, rc, 2, (pNMHDR->code == NM_RCLICK ? MBCF_RIGHTBUTTON : 0));
+ CheckStatusIconClick(pDlg->m_hContact, dat->hwndStatus, nm->pt, rc, 2, 0);
}
return TRUE;
}
diff --git a/plugins/UserInfoEx/src/Flags/svc_flags.cpp b/plugins/UserInfoEx/src/Flags/svc_flags.cpp index d0ecb3c5a7..a5352033ab 100644 --- a/plugins/UserInfoEx/src/Flags/svc_flags.cpp +++ b/plugins/UserInfoEx/src/Flags/svc_flags.cpp @@ -219,7 +219,7 @@ void SvcFlagsLoadModule() langid = 1;
char szId[20];
- mir_snprintf(szId, (langid == 0xFFFF) ? "%s_0x%X" : "%s_%i", "flags", langid); /* buffer safe */
+ mir_snprintf(szId, "flags_%i", langid); /* buffer safe */
hExtraIconSvc = ExtraIcon_RegisterIcolib("Flags", LPGEN("Flags (UInfoEx)"), szId);
}
diff --git a/plugins/UserInfoEx/src/psp_profile.cpp b/plugins/UserInfoEx/src/psp_profile.cpp index ab335c58bb..07e2043a1f 100644 --- a/plugins/UserInfoEx/src/psp_profile.cpp +++ b/plugins/UserInfoEx/src/psp_profile.cpp @@ -697,10 +697,7 @@ static LRESULT CALLBACK ProfileList_LabelEditProc(HWND hwnd, UINT msg, WPARAM wP lvi.iSubItem = iSubItem;
lvi.mask = LVIF_PARAM;
do {
- if (wParam == VK_UP)
- lvi.iItem--;
- else
- lvi.iItem++;
+ lvi.iItem++;
if (lvi.iItem == -1 || !ListView_GetItem(pList->hList, &lvi))
return 0;
diff --git a/plugins/WebView/src/webview_cleanup.cpp b/plugins/WebView/src/webview_cleanup.cpp index 9ca77f42c2..9325881d38 100644 --- a/plugins/WebView/src/webview_cleanup.cpp +++ b/plugins/WebView/src/webview_cleanup.cpp @@ -375,8 +375,7 @@ void CodetoSymbol(char *truncated) Sleep(1); // avoid 100% CPU
if ( strstr(truncated, CharacterCodes[n]) != nullptr) { // does character code exist?
- if (strstr(truncated, CharacterCodes[n]) != nullptr)
- stringfrompos = strstr(truncated, CharacterCodes[n]);
+ stringfrompos = strstr(truncated, CharacterCodes[n]);
position = stringfrompos - truncated;
counter = 0;
diff --git a/protocols/IcqOscarJ/src/icq_popups.cpp b/protocols/IcqOscarJ/src/icq_popups.cpp index 28de27d6f7..e067fd966a 100644 --- a/protocols/IcqOscarJ/src/icq_popups.cpp +++ b/protocols/IcqOscarJ/src/icq_popups.cpp @@ -278,12 +278,8 @@ int CIcqProto::ShowPopupMsg(MCONTACT hContact, const char *szTitle, const char * make_unicode_string_static( ICQTranslateUtfStatic(szTitle, str, sizeof(str)), ppd.lpwzContactName, MAX_CONTACTNAME);
make_unicode_string_static( ICQTranslateUtfStatic(szMsg, str, sizeof(str)), ppd.lpwzText, MAX_SECONDLINE);
ppd.lchContact = hContact;
- ppd.lchIcon = ppd.lchIcon;
- ppd.colorBack = ppd.colorBack;
- ppd.colorText = ppd.colorText;
ppd.PluginWindowProc = nullptr;
ppd.PluginData = nullptr;
- ppd.iSeconds = ppd.iSeconds;
return PUAddPopupT(&ppd);
}
return -1; // Failure
diff --git a/protocols/JabberG/src/jabber_treelist.cpp b/protocols/JabberG/src/jabber_treelist.cpp index fcfba8f7b7..7a960fedd4 100644 --- a/protocols/JabberG/src/jabber_treelist.cpp +++ b/protocols/JabberG/src/jabber_treelist.cpp @@ -367,11 +367,8 @@ BOOL TreeList_ProcessMessage(HWND hwnd, UINT msg, WPARAM, LPARAM lparam, UINT id nmtv.itemNew.hItem = (HTREEITEM)lvi.lParam;
SendMessage(hwnd, WM_NOTIFY, lpnmia->hdr.idFrom, (LPARAM)&nmtv);
- if (data->mode == TLM_REPORT)
- {
- ListView_DeleteAllItems(lpnmia->hdr.hwndFrom);
- TreeList_Update(lpnmia->hdr.hwndFrom);
- }
+ ListView_DeleteAllItems(lpnmia->hdr.hwndFrom);
+ TreeList_Update(lpnmia->hdr.hwndFrom);
}
break;
diff --git a/protocols/MSN/src/msn_auth.cpp b/protocols/MSN/src/msn_auth.cpp index e75fded15c..f9420029cd 100644 --- a/protocols/MSN/src/msn_auth.cpp +++ b/protocols/MSN/src/msn_auth.cpp @@ -1133,7 +1133,7 @@ int CMsnProto::MSN_AuthOAuth(void) int loginRet;
/* Do Login via Skype login server, if not possible switch to SkypeWebExperience login */
if ((loginRet = LoginSkypeOAuth(pRefreshToken)) < 1) {
- if (loginRet < 0) bLogin = true; else retVal = 0;
+ retVal = 0;
}
else {
/* SkyLogin succeeded, request required tokens */
diff --git a/protocols/MSN/src/msn_misc.cpp b/protocols/MSN/src/msn_misc.cpp index dc509db31b..78ec94f5dd 100644 --- a/protocols/MSN/src/msn_misc.cpp +++ b/protocols/MSN/src/msn_misc.cpp @@ -1025,13 +1025,11 @@ char* TWinErrorCode::getText() if (mErrorText == nullptr)
return nullptr;
- int tBytes = 0;
mErrorText = (char*)mir_alloc(256);
- if (tBytes == 0)
- tBytes = FormatMessageA(
- FORMAT_MESSAGE_FROM_SYSTEM, nullptr,
- mErrorCode, LANG_NEUTRAL, mErrorText, 256, nullptr);
+ int tBytes = FormatMessageA(
+ FORMAT_MESSAGE_FROM_SYSTEM, nullptr,
+ mErrorCode, LANG_NEUTRAL, mErrorText, 256, nullptr);
if (tBytes == 0)
tBytes = mir_snprintf(mErrorText, 256, "unknown Windows error code %d", mErrorCode);
diff --git a/protocols/MSN/src/skylogin/login.c b/protocols/MSN/src/skylogin/login.c index 406ebe279e..348c582b7b 100644 --- a/protocols/MSN/src/skylogin/login.c +++ b/protocols/MSN/src/skylogin/login.c @@ -74,7 +74,8 @@ static int SendAuthentificationBlobLS(Skype_Inst *pInst, LSConnection *pConn, co uchar *Browser;
uchar *Mark;
uchar *MarkObjL;
- uint Idx, Size, Crc, BSize, ret = 0;
+ uint Size, Crc, BSize, ret = 0;
+ int Idx;
HttpsPacketHeader *HSHeader;
uchar HSHeaderBuf[sizeof(HttpsPacketHeader)], RecvBuf[0x1000];
AES_KEY AesKey;
diff --git a/protocols/SkypeWeb/src/skype_profile.cpp b/protocols/SkypeWeb/src/skype_profile.cpp index 6e704ce411..f658f7d916 100644 --- a/protocols/SkypeWeb/src/skype_profile.cpp +++ b/protocols/SkypeWeb/src/skype_profile.cpp @@ -53,7 +53,6 @@ void CSkypeProto::InitLanguages() result[L"km"] = L"Central Khmer";
result[L"ch"] = L"Chamorro";
result[L"ce"] = L"Chechen";
- result[L"ny"] = L"Chewa";
result[L"ny"] = L"Chichewa";
result[L"zh"] = L"Chinese";
result[L"za"] = L"Chuang";
@@ -66,7 +65,6 @@ void CSkypeProto::InitLanguages() result[L"hr"] = L"Croatian";
result[L"cs"] = L"Czech";
result[L"da"] = L"Danish";
- result[L"dv"] = L"Dhivehi";
result[L"dv"] = L"Divehi";
result[L"nl"] = L"Dutch";
result[L"dz"] = L"Dzongkha";
@@ -90,7 +88,6 @@ void CSkypeProto::InitLanguages() result[L"kl"] = L"Greenlandic";
result[L"gn"] = L"Guarani";
result[L"gu"] = L"Gujarati";
- result[L"ht"] = L"Haitian";
result[L"ht"] = L"Haitian Creole";
result[L"ha"] = L"Hausa";
result[L"he"] = L"Hebrew";
@@ -146,11 +143,9 @@ void CSkypeProto::InitLanguages() result[L"mi"] = L"Maori";
result[L"mr"] = L"Marathi";
result[L"mh"] = L"Marshallese";
- result[L"ro"] = L"Moldavian";
result[L"ro"] = L"Moldovan";
result[L"mn"] = L"Mongolian";
result[L"na"] = L"Nauru";
- result[L"nv"] = L"Navaho";
result[L"nv"] = L"Navajo";
result[L"nd"] = L"Ndebele, North";
result[L"nr"] = L"Ndebele, South";
@@ -172,7 +167,6 @@ void CSkypeProto::InitLanguages() result[L"cu"] = L"Old Slavonic";
result[L"or"] = L"Oriya";
result[L"om"] = L"Oromo";
- result[L"os"] = L"Ossetian";
result[L"os"] = L"Ossetic";
result[L"pi"] = L"Pali";
result[L"pa"] = L"Panjabi";
@@ -196,7 +190,6 @@ void CSkypeProto::InitLanguages() result[L"sn"] = L"Shona";
result[L"ii"] = L"Sichuan Yi";
result[L"sd"] = L"Sindhi";
- result[L"si"] = L"Sinhala";
result[L"si"] = L"Sinhalese";
result[L"sk"] = L"Slovak";
result[L"sl"] = L"Slovenian";
diff --git a/src/mir_app/src/clc.cpp b/src/mir_app/src/clc.cpp index 3af1660df8..382150ff65 100644 --- a/src/mir_app/src/clc.cpp +++ b/src/mir_app/src/clc.cpp @@ -767,8 +767,6 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam if (contact->type != CLCIT_CONTACT)
break;
contact->flags ^= CONTACTF_CHECKED;
- if (contact->type == CLCIT_GROUP)
- cli.pfnSetGroupChildCheckboxes(contact->group, contact->flags & CONTACTF_CHECKED);
cli.pfnRecalculateGroupCheckboxes(hwnd, dat);
cli.pfnInvalidateRect(hwnd, nullptr, FALSE);
nm.hdr.code = CLN_CHECKCHANGED;
diff --git a/src/mir_app/src/netlibopenconn.cpp b/src/mir_app/src/netlibopenconn.cpp index fd2323c156..eb5c368ffe 100644 --- a/src/mir_app/src/netlibopenconn.cpp +++ b/src/mir_app/src/netlibopenconn.cpp @@ -845,10 +845,8 @@ MIR_APP_DLL(HNETLIBCONN) Netlib_OpenConnection(NetlibUser *nlu, const NETLIBOPEN if (iUPnPCleanup == 0) { mir_cslock lck(csNetlibUser); - if (iUPnPCleanup == 0) { - iUPnPCleanup = 1; - mir_forkthread(NetlibUPnPCleanup); - } + iUPnPCleanup = 1; + mir_forkthread(NetlibUPnPCleanup); } return nlc; diff --git a/utils/mir_buffer.h b/utils/mir_buffer.h index fae75e2d08..9e64474fd3 100644 --- a/utils/mir_buffer.h +++ b/utils/mir_buffer.h @@ -241,8 +241,6 @@ class Buffer va_list arg; va_start(arg, app); total = __bvsnprintf<T>(&str[len], size - len - 1, app, arg); //!!!!!!!!!!!! - if (total < 0) - total = size - len - 1; len += total; pack(); } @@ -251,8 +249,6 @@ class Buffer { if (pos > len) pos = len; - if (pos < 0) - pos = 0; if (appLen == -1) appLen = __blen(app); @@ -271,9 +267,7 @@ class Buffer { if (start > len) start = len; - if (start < 0) - start = 0; - + if (end > len) end = len; if (end < start) |