summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-03-17 22:11:51 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-03-17 22:11:59 +0300
commit3ad5334f17119c9ae010d5059f5cfb1831c9ddbd (patch)
tree1d76618499baee7cf217c97dfe2045b467d20a0a /protocols
parentf632783f27da5dd0ed3513bbee6182ea8af30afe (diff)
more warning fixes
Diffstat (limited to 'protocols')
-rw-r--r--protocols/Gadu-Gadu/src/core.cpp3
-rw-r--r--protocols/Gadu-Gadu/src/oauth.cpp6
-rw-r--r--protocols/IcqOscarJ/src/icq_servlist.cpp1
-rw-r--r--protocols/IcqOscarJ/src/icq_uploadui.cpp2
-rw-r--r--protocols/IcqOscarJ/src/utilities.cpp18
-rw-r--r--protocols/MRA/src/Mra_functions.cpp12
-rw-r--r--protocols/VKontakte/src/vk_thread.cpp6
7 files changed, 23 insertions, 25 deletions
diff --git a/protocols/Gadu-Gadu/src/core.cpp b/protocols/Gadu-Gadu/src/core.cpp
index fdf025c619..f34e9b2e60 100644
--- a/protocols/Gadu-Gadu/src/core.cpp
+++ b/protocols/Gadu-Gadu/src/core.cpp
@@ -23,6 +23,8 @@
#include <errno.h>
#include <io.h>
+#pragma warning(disable : 4189)
+
////////////////////////////////////////////////////////////
// Swap bits in DWORD
uint32_t swap32(uint32_t x)
@@ -1433,7 +1435,6 @@ void GaduProto::notifyuser(MCONTACT hContact, int refresh)
void GaduProto::notifyall()
{
- MCONTACT hContact;
debugLogA("notifyall(): Subscribing notification to all users");
// Readup count
int count = 0;
diff --git a/protocols/Gadu-Gadu/src/oauth.cpp b/protocols/Gadu-Gadu/src/oauth.cpp
index cfe7942297..caa854ff6a 100644
--- a/protocols/Gadu-Gadu/src/oauth.cpp
+++ b/protocols/Gadu-Gadu/src/oauth.cpp
@@ -128,8 +128,6 @@ char *oauth_generate_signature(LIST<OAUTHPARAMETER> &params, const char *httpmet
char *oauth_getparam(LIST<OAUTHPARAMETER> &params, const char *name)
{
- OAUTHPARAMETER *p;
-
if (name == nullptr)
return nullptr;
@@ -142,8 +140,6 @@ char *oauth_getparam(LIST<OAUTHPARAMETER> &params, const char *name)
void oauth_setparam(LIST<OAUTHPARAMETER> &params, const char *name, const char *value)
{
- OAUTHPARAMETER *p;
-
if (name == nullptr)
return;
@@ -154,7 +150,7 @@ void oauth_setparam(LIST<OAUTHPARAMETER> &params, const char *name, const char *
return;
}
- p = (OAUTHPARAMETER*)mir_alloc(sizeof(OAUTHPARAMETER));
+ OAUTHPARAMETER *p = (OAUTHPARAMETER*)mir_alloc(sizeof(OAUTHPARAMETER));
p->name = oauth_uri_escape(name);
p->value = oauth_uri_escape(value);
params.insert(p);
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);
diff --git a/protocols/MRA/src/Mra_functions.cpp b/protocols/MRA/src/Mra_functions.cpp
index 70e1ed567d..0de82591be 100644
--- a/protocols/MRA/src/Mra_functions.cpp
+++ b/protocols/MRA/src/Mra_functions.cpp
@@ -508,16 +508,18 @@ MCONTACT CMraProto::MraHContactFromEmail(const CMStringA &szEmail, BOOL bAddIfNe
MCONTACT hContact = NULL;
bool bFound = false;
- //check not already on list
+ // check not already on list
CMStringA szEMailLocal;
- for (auto &hContact : AccContacts()) {
- if (mraGetStringA(hContact, "e-mail", szEMailLocal))
+ for (auto &cc : AccContacts()) {
+ if (mraGetStringA(cc, "e-mail", szEMailLocal)) {
if (szEMailLocal == szEmail) {
if (bTemporary == FALSE)
- db_unset(hContact, "CList", "NotOnList");
+ db_unset(cc, "CList", "NotOnList");
+ hContact = cc;
bFound = true;
break;
}
+ }
}
if (!bFound && bAddIfNeeded) {
@@ -549,7 +551,7 @@ MCONTACT CMraProto::MraHContactFromEmail(const CMStringA &szEmail, BOOL bAddIfNe
}
if (pbAdded)
- *pbAdded = (bFound == FALSE && bAddIfNeeded && hContact);
+ *pbAdded = (bFound == false && bAddIfNeeded && hContact);
return hContact;
}
diff --git a/protocols/VKontakte/src/vk_thread.cpp b/protocols/VKontakte/src/vk_thread.cpp
index 3a9c065b6d..0a4d0aa464 100644
--- a/protocols/VKontakte/src/vk_thread.cpp
+++ b/protocols/VKontakte/src/vk_thread.cpp
@@ -599,7 +599,6 @@ void CVkProto::OnReceiveUserInfo(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pRe
return;
}
- MCONTACT hContact;
LIST<void> arContacts(10, PtrKeySortT);
for (auto &hContact : AccContacts())
@@ -607,7 +606,7 @@ void CVkProto::OnReceiveUserInfo(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pRe
arContacts.insert((HANDLE)hContact);
for (auto &it : jnUsers) {
- hContact = SetContactInfo(it);
+ MCONTACT hContact = SetContactInfo(it);
if (hContact)
arContacts.remove((HANDLE)hContact);
}
@@ -646,7 +645,8 @@ void CVkProto::OnReceiveUserInfo(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pRe
LONG userid = it.as_int();
if (userid == 0)
break;
- hContact = FindUser(userid, true);
+
+ MCONTACT hContact = FindUser(userid, true);
if (!getBool(hContact, "ReqAuth")) {
RetrieveUserInfo(userid);
setByte(hContact, "ReqAuth", 1);