From 3ad5334f17119c9ae010d5059f5cfb1831c9ddbd Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 17 Mar 2018 22:11:51 +0300 Subject: more warning fixes --- protocols/IcqOscarJ/src/icq_servlist.cpp | 1 - protocols/IcqOscarJ/src/icq_uploadui.cpp | 2 +- protocols/IcqOscarJ/src/utilities.cpp | 18 +++++++++--------- 3 files changed, 10 insertions(+), 11 deletions(-) (limited to 'protocols/IcqOscarJ') diff --git a/protocols/IcqOscarJ/src/icq_servlist.cpp b/protocols/IcqOscarJ/src/icq_servlist.cpp index f1d17036ef..b3c613d017 100644 --- a/protocols/IcqOscarJ/src/icq_servlist.cpp +++ b/protocols/IcqOscarJ/src/icq_servlist.cpp @@ -1194,7 +1194,6 @@ void* CIcqProto::collectBuddyGroup(WORD wGroupID, int *count) { WORD* buf = nullptr; int cnt = 0; - MCONTACT hContact; WORD wItemID; for (auto &hContact : AccContacts()) { diff --git a/protocols/IcqOscarJ/src/icq_uploadui.cpp b/protocols/IcqOscarJ/src/icq_uploadui.cpp index 1a6cd6c4c6..7fbdeca635 100644 --- a/protocols/IcqOscarJ/src/icq_uploadui.cpp +++ b/protocols/IcqOscarJ/src/icq_uploadui.cpp @@ -226,7 +226,6 @@ static char* getServerResultDesc(int wCode) static INT_PTR CALLBACK DlgProcUploadList(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam) { CIcqProto* ppro = (CIcqProto*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); - MCONTACT hContact; static int working; static HANDLE hProtoAckHook; @@ -468,6 +467,7 @@ static INT_PTR CALLBACK DlgProcUploadList(HWND hwndDlg, UINT message, WPARAM wPa case STATE_ITEMS: // Iterate over all contacts until one is found that // needs to be updated on the server + MCONTACT hContact; if (hCurrentContact == NULL) hContact = db_find_first(ppro->m_szModuleName); else { // we do not want to go thru all contacts over and over again diff --git a/protocols/IcqOscarJ/src/utilities.cpp b/protocols/IcqOscarJ/src/utilities.cpp index 399ecf503b..81c08d073e 100644 --- a/protocols/IcqOscarJ/src/utilities.cpp +++ b/protocols/IcqOscarJ/src/utilities.cpp @@ -413,9 +413,9 @@ MCONTACT CIcqProto::HContactFromUIN(DWORD dwUin, int *Added) if (Added) *Added = 0; - MCONTACT hContact = HandleFromCacheByUid(dwUin, nullptr); - if (hContact) - return hContact; + MCONTACT cc = HandleFromCacheByUid(dwUin, nullptr); + if (cc) + return cc; for (auto &hContact : AccContacts()) { DWORD dwContactUin = getContactUin(hContact); @@ -429,7 +429,7 @@ MCONTACT CIcqProto::HContactFromUIN(DWORD dwUin, int *Added) if (Added) { debugLogA("Attempt to create ICQ contact %u", dwUin); - hContact = db_add_contact(); + MCONTACT hContact = db_add_contact(); if (!hContact) { debugLogA("Failed to create ICQ contact %u", dwUin); return INVALID_CONTACT_ID; @@ -476,9 +476,9 @@ MCONTACT CIcqProto::HContactFromUID(DWORD dwUin, const char *szUid, int *Added) if (Added) *Added = 0; - MCONTACT hContact = HandleFromCacheByUid(dwUin, szUid); - if (hContact) - return hContact; + MCONTACT cc = HandleFromCacheByUid(dwUin, szUid); + if (cc) + return cc; for (auto &hContact : AccContacts()) { DWORD dwContactUin; @@ -493,11 +493,11 @@ MCONTACT CIcqProto::HContactFromUID(DWORD dwUin, const char *szUid, int *Added) } } - //not present: add + // not present: add if (Added) { debugLogA("Attempt to create ICQ contact by string <%s>", szUid); - hContact = db_add_contact(); + MCONTACT hContact = db_add_contact(); Proto_AddToContact(hContact, m_szModuleName); setString(hContact, UNIQUEIDSETTING, szUid); -- cgit v1.2.3