summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-08-27 15:15:33 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-08-27 15:15:33 +0000
commitd6eee2018898f2442883a0aa77ad095b75572cfb (patch)
tree8fbfe32690b9b32e5d47b1958a02f6f6a5fbf000 /protocols
parent2d37d969153b5fad810984182f747755c1cbc616 (diff)
fix for 64-bit issues & warnings
git-svn-id: http://svn.miranda-ng.org/main/trunk@15043 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols')
-rw-r--r--protocols/AimOscar/src/avatars.cpp2
-rw-r--r--protocols/AimOscar/src/proto.cpp2
-rw-r--r--protocols/AimOscar/src/ui.cpp2
-rw-r--r--protocols/Dummy/src/dummy_proto.cpp2
-rw-r--r--protocols/GTalkExt/src/inbox.cpp2
-rw-r--r--protocols/GTalkExt/src/notifications.cpp15
-rw-r--r--protocols/Gadu-Gadu/src/core.cpp6
-rw-r--r--protocols/Gadu-Gadu/src/filetransfer.cpp36
-rw-r--r--protocols/Gadu-Gadu/src/gg_proto.cpp241
-rw-r--r--protocols/Gadu-Gadu/src/groupchat.cpp2
-rw-r--r--protocols/Gadu-Gadu/src/libgadu/http.cpp2
-rw-r--r--protocols/ICQCorp/src/protocol.cpp2
-rw-r--r--protocols/ICQCorp/src/services.cpp93
-rw-r--r--protocols/IRCG/src/ircproto.cpp4
-rw-r--r--protocols/IcqOscarJ/src/icq_direct.cpp2
-rw-r--r--protocols/IcqOscarJ/src/icq_uploadui.cpp2
-rw-r--r--protocols/IcqOscarJ/src/icq_xstatus.cpp2
-rw-r--r--protocols/IcqOscarJ/src/userinfotab.cpp6
-rw-r--r--protocols/IcqOscarJ/src/utilities.cpp5
-rw-r--r--protocols/MSN/src/msn_chat.cpp4
-rw-r--r--protocols/MSN/src/msn_lists.cpp2
-rw-r--r--protocols/Sametime/src/sametime_proto.cpp4
-rw-r--r--protocols/Sametime/src/sametime_session.cpp14
-rw-r--r--protocols/Sametime/src/userlist.cpp2
-rw-r--r--protocols/Steam/src/steam_contacts.cpp4
-rw-r--r--protocols/Steam/src/steam_proto.cpp2
-rw-r--r--protocols/Tlen/src/tlen_thread.cpp2
-rw-r--r--protocols/Tlen/src/tlen_voice.cpp2
-rw-r--r--protocols/Tox/src/tox_chatrooms.cpp2
-rw-r--r--protocols/Tox/src/tox_messages.cpp2
-rw-r--r--protocols/VKontakte/src/misc.cpp6
-rw-r--r--protocols/VKontakte/src/vk_avatars.cpp8
-rw-r--r--protocols/VKontakte/src/vk_captcha.cpp2
-rw-r--r--protocols/VKontakte/src/vk_files.cpp2
-rw-r--r--protocols/VKontakte/src/vk_thread.cpp4
35 files changed, 224 insertions, 266 deletions
diff --git a/protocols/AimOscar/src/avatars.cpp b/protocols/AimOscar/src/avatars.cpp
index 0b21052483..4b53eaa8a4 100644
--- a/protocols/AimOscar/src/avatars.cpp
+++ b/protocols/AimOscar/src/avatars.cpp
@@ -21,7 +21,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
void __cdecl CAimProto::avatar_request_thread(void* param)
{
- MCONTACT hContact = (MCONTACT)param;
+ MCONTACT hContact = (UINT_PTR)param;
char *sn = getStringA(hContact, AIM_KEY_SN);
debugLogA("Starting avatar request thread for %s)", sn);
diff --git a/protocols/AimOscar/src/proto.cpp b/protocols/AimOscar/src/proto.cpp
index 869c081787..276706acc7 100644
--- a/protocols/AimOscar/src/proto.cpp
+++ b/protocols/AimOscar/src/proto.cpp
@@ -553,7 +553,7 @@ void __cdecl CAimProto::get_online_msg_thread(void* arg)
{
Sleep(150);
- MCONTACT hContact = (MCONTACT)arg;
+ MCONTACT hContact = (UINT_PTR)arg;
DBVARIANT dbv;
if (!db_get_ts(hContact, MOD_KEY_CL, OTH_KEY_SM, &dbv)) {
ProtoBroadcastAck(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, (LPARAM)dbv.ptszVal);
diff --git a/protocols/AimOscar/src/ui.cpp b/protocols/AimOscar/src/ui.cpp
index 4802fe3bd2..16c4328468 100644
--- a/protocols/AimOscar/src/ui.cpp
+++ b/protocols/AimOscar/src/ui.cpp
@@ -1330,7 +1330,7 @@ INT_PTR CALLBACK invite_to_chat_dialog(HWND hwndDlg, UINT msg, WPARAM wParam, LP
switch (nmc->hdr.code) {
case CLN_NEWCONTACT:
if (param && (nmc->flags & (CLNF_ISGROUP | CLNF_ISINFO)) == 0)
- clist_validate_contact((MCONTACT)nmc->hItem, nmc->hdr.hwndFrom, param->ppro);
+ clist_validate_contact((UINT_PTR)nmc->hItem, nmc->hdr.hwndFrom, param->ppro);
break;
case CLN_LISTREBUILT:
diff --git a/protocols/Dummy/src/dummy_proto.cpp b/protocols/Dummy/src/dummy_proto.cpp
index f7c6c6396d..2503e15ea0 100644
--- a/protocols/Dummy/src/dummy_proto.cpp
+++ b/protocols/Dummy/src/dummy_proto.cpp
@@ -19,7 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
void CDummyProto::SendMsgAck(void *param)
{
- MCONTACT hContact = (MCONTACT)param;
+ MCONTACT hContact = (UINT_PTR)param;
Sleep(100);
ProtoBroadcastAck(hContact, ACKTYPE_MESSAGE, ACKRESULT_FAILED, (HANDLE)0, (LPARAM)Translate("Dummy protocol is too dumb to send messages."));
}
diff --git a/protocols/GTalkExt/src/inbox.cpp b/protocols/GTalkExt/src/inbox.cpp
index c2cf1f7235..c58533f122 100644
--- a/protocols/GTalkExt/src/inbox.cpp
+++ b/protocols/GTalkExt/src/inbox.cpp
@@ -199,7 +199,7 @@ BOOL OpenUrlWithAuth(LPCSTR acc, LPCTSTR mailbox, LPCTSTR url)
void OpenUrl(LPCSTR acc, LPCTSTR mailbox, LPCTSTR url)
{
extern DWORD itlsSettings;
- if (!ReadCheckbox(0, IDC_AUTHONMAILBOX, (DWORD)TlsGetValue(itlsSettings)) || !OpenUrlWithAuth(acc, mailbox, url))
+ if (!ReadCheckbox(0, IDC_AUTHONMAILBOX, (UINT_PTR)TlsGetValue(itlsSettings)) || !OpenUrlWithAuth(acc, mailbox, url))
Utils_OpenUrlT(url);
}
diff --git a/protocols/GTalkExt/src/notifications.cpp b/protocols/GTalkExt/src/notifications.cpp
index c4e21d177d..eca670801e 100644
--- a/protocols/GTalkExt/src/notifications.cpp
+++ b/protocols/GTalkExt/src/notifications.cpp
@@ -65,7 +65,7 @@ LPCSTR GetJidAcc(LPCTSTR jid)
void MarkEventRead(MCONTACT hCnt, MEVENT hEvt)
{
- DWORD settings = (DWORD)TlsGetValue(itlsSettings);
+ DWORD settings = (UINT_PTR)TlsGetValue(itlsSettings);
if (ReadCheckbox(0, IDC_POPUPSENABLED, settings) &&
ReadCheckbox(0, IDC_PSEUDOCONTACTENABLED, settings) &&
ReadCheckbox(0, IDC_MARKEVENTREAD, settings) &&
@@ -144,7 +144,7 @@ LRESULT CALLBACK PopupProc(HWND wnd, UINT msg, WPARAM wParam, LPARAM lParam)
static bool DoAddPopup(POPUPDATAT *data)
{
- if (ReadCheckbox(0, IDC_POPUPSINFULLSCREEN, (DWORD)TlsGetValue(itlsSettings)) && IsFullScreen()) {
+ if (ReadCheckbox(0, IDC_POPUPSINFULLSCREEN, (UINT_PTR)TlsGetValue(itlsSettings)) && IsFullScreen()) {
HWND handle = CreateWindowEx(WS_EX_TOOLWINDOW, TEMP_WINDOW_CLASS_NAME, NULL, WS_OVERLAPPED | WS_VISIBLE, -100, -100, 10, 10, 0, 0, 0, 0);
if (handle) {
ShowWindow(handle, SW_MINIMIZE);
@@ -208,13 +208,13 @@ BOOL UsePopups()
{
return ServiceExists(MS_POPUP_QUERY) &&
CallService(MS_POPUP_QUERY, PUQS_GETSTATUS, 0) &&
- ReadCheckbox(0, IDC_POPUPSENABLED, (DWORD)TlsGetValue(itlsSettings));
+ ReadCheckbox(0, IDC_POPUPSENABLED, (UINT_PTR)TlsGetValue(itlsSettings));
}
void ShowNotification(LPCSTR acc, POPUPDATAT *data, LPCTSTR jid, LPCTSTR url, LPCTSTR unreadCount)
{
MCONTACT hCnt = SetupPseudocontact(jid, unreadCount, acc, &data->lptzContactName[0]);
- MEVENT hEvt = ReadCheckbox(0, IDC_PSEUDOCONTACTENABLED, (DWORD)TlsGetValue(itlsSettings))
+ MEVENT hEvt = ReadCheckbox(0, IDC_PSEUDOCONTACTENABLED, (UINT_PTR)TlsGetValue(itlsSettings))
? AddCListNotification(hCnt, acc, data, url) : NULL;
if (!UsePopups())
@@ -276,7 +276,7 @@ void UnreadThreadNotification(LPCSTR acc, LPCTSTR jid, LPCTSTR url, LPCTSTR unre
tszSenders.AppendFormat(_T(" %s\n"), p.addr);
}
- if (ReadCheckbox(0, IDC_ADDSNIP, (DWORD)TlsGetValue(itlsSettings)))
+ if (ReadCheckbox(0, IDC_ADDSNIP, (UINT_PTR)TlsGetValue(itlsSettings)))
mir_sntprintf(data.lptzText, TranslateTS(FULL_NOTIFICATION_FORMAT), mtn->subj, tszSenders.c_str(), mtn->snip);
else
mir_sntprintf(data.lptzText, TranslateTS(SHORT_NOTIFICATION_FORMAT), mtn->subj, tszSenders.c_str());
@@ -304,7 +304,8 @@ DWORD ReadNotificationSettings(LPCSTR acc)
return result;
}
-struct POPUP_IDENT_STRINGS {
+struct POPUP_IDENT_STRINGS
+{
LPCTSTR url;
LPCTSTR jid;
};
@@ -329,7 +330,7 @@ BOOL CALLBACK ClosePopupFunc(__in HWND hwnd, __in LPARAM lParam)
void CloseNotifications(LPCSTR acc, LPCTSTR url, LPCTSTR jid, BOOL PopupsOnly)
{
- DWORD settings = (DWORD)TlsGetValue(itlsSettings);
+ DWORD settings = (UINT_PTR)TlsGetValue(itlsSettings);
if (acc && !PopupsOnly &&
ReadCheckbox(0, IDC_PSEUDOCONTACTENABLED, settings) &&
ReadCheckbox(0, IDC_CLEARPSEUDOCONTACTLOG, settings))
diff --git a/protocols/Gadu-Gadu/src/core.cpp b/protocols/Gadu-Gadu/src/core.cpp
index f5558e99ad..014beec412 100644
--- a/protocols/Gadu-Gadu/src/core.cpp
+++ b/protocols/Gadu-Gadu/src/core.cpp
@@ -1063,7 +1063,7 @@ retry:
pre.descr.t = filenameT;
pre.files.t = &filenameT;
pre.lParam = (LPARAM)dcc7;
- ProtoChainRecvFile((MCONTACT)dcc7->contact, &pre);
+ ProtoChainRecvFile((UINT_PTR)dcc7->contact, &pre);
mir_free(filenameT);
e->event.dcc7_new = NULL;
@@ -1077,7 +1077,7 @@ retry:
if (dcc7->type == GG_SESSION_DCC7_SEND)
{
debugLogA("mainthread() (%x): File transfer denied by client %d (reason = %d).", this, dcc7->peer_uin, e->event.dcc7_reject.reason);
- ProtoBroadcastAck((MCONTACT)dcc7->contact, ACKTYPE_FILE, ACKRESULT_DENIED, dcc7, 0);
+ ProtoBroadcastAck((UINT_PTR)dcc7->contact, ACKTYPE_FILE, ACKRESULT_DENIED, dcc7, 0);
// Remove from watches and free
gg_EnterCriticalSection(&ft_mutex, "mainthread", 21, "ft_mutex", 1);
@@ -1138,7 +1138,7 @@ retry:
}
if (dcc7->contact)
- ProtoBroadcastAck((MCONTACT)dcc7->contact, ACKTYPE_FILE, ACKRESULT_FAILED, dcc7, 0);
+ ProtoBroadcastAck((UINT_PTR)dcc7->contact, ACKTYPE_FILE, ACKRESULT_FAILED, dcc7, 0);
// Free dcc
gg_dcc7_free(dcc7);
diff --git a/protocols/Gadu-Gadu/src/filetransfer.cpp b/protocols/Gadu-Gadu/src/filetransfer.cpp
index 7034f31036..dfa99bcffe 100644
--- a/protocols/Gadu-Gadu/src/filetransfer.cpp
+++ b/protocols/Gadu-Gadu/src/filetransfer.cpp
@@ -272,7 +272,7 @@ void __cdecl GGPROTO::dccmainthread(void*)
mir_snprintf(szFilename, _countof(szFilename), "%s%s", local_dcc->folder, local_dcc->file_info.filename);
memset(&pfts, 0, sizeof(PROTOFILETRANSFERSTATUS));
pfts.cbSize = sizeof(PROTOFILETRANSFERSTATUS);
- pfts.hContact = (MCONTACT)local_dcc->contact;
+ pfts.hContact = (UINT_PTR)local_dcc->contact;
pfts.flags = (local_dcc->type == GG_SESSION_DCC_SEND);
pfts.pszFiles = NULL;
pfts.totalFiles = 1;
@@ -285,7 +285,7 @@ void __cdecl GGPROTO::dccmainthread(void*)
pfts.currentFileProgress = local_dcc->offset;
pfts.currentFileTime = 0;
gg_LeaveCriticalSection(&ft_mutex, "dccmainthread", 37, 3, "ft_mutex", 1);
- ProtoBroadcastAck((MCONTACT)local_dcc->contact, ACKTYPE_FILE, ACKRESULT_DATA, local_dcc, (LPARAM)&pfts);
+ ProtoBroadcastAck((UINT_PTR)local_dcc->contact, ACKTYPE_FILE, ACKRESULT_DATA, local_dcc, (LPARAM)&pfts);
gg_EnterCriticalSection(&ft_mutex, "dccmainthread", 37, "ft_mutex", 1);
}
break;
@@ -302,7 +302,7 @@ void __cdecl GGPROTO::dccmainthread(void*)
mir_snprintf(szFilename, _countof(szFilename), "%s%s", local_dcc->folder, local_dcc->file_info.filename);
memset(&pfts, 0, sizeof(PROTOFILETRANSFERSTATUS));
pfts.cbSize = sizeof(PROTOFILETRANSFERSTATUS);
- pfts.hContact = (MCONTACT)local_dcc->contact;
+ pfts.hContact = (UINT_PTR)local_dcc->contact;
pfts.flags = (local_dcc->type == GG_SESSION_DCC_SEND);
pfts.pszFiles = NULL;
pfts.totalFiles = 1;
@@ -315,11 +315,11 @@ void __cdecl GGPROTO::dccmainthread(void*)
pfts.currentFileProgress = local_dcc->file_info.size;
pfts.currentFileTime = 0;
gg_LeaveCriticalSection(&ft_mutex, "dccmainthread", 37, 4, "ft_mutex", 1);
- ProtoBroadcastAck((MCONTACT)local_dcc->contact, ACKTYPE_FILE, ACKRESULT_DATA, local_dcc, (LPARAM)&pfts);
+ ProtoBroadcastAck((UINT_PTR)local_dcc->contact, ACKTYPE_FILE, ACKRESULT_DATA, local_dcc, (LPARAM)&pfts);
gg_EnterCriticalSection(&ft_mutex, "dccmainthread", 37, "ft_mutex", 1);
_close(local_dcc->file_fd); local_dcc->file_fd = -1;
gg_LeaveCriticalSection(&ft_mutex, "dccmainthread", 37, 5, "ft_mutex", 1);
- ProtoBroadcastAck((MCONTACT)local_dcc->contact, ACKTYPE_FILE, ACKRESULT_SUCCESS, local_dcc, 0);
+ ProtoBroadcastAck((UINT_PTR)local_dcc->contact, ACKTYPE_FILE, ACKRESULT_SUCCESS, local_dcc, 0);
gg_EnterCriticalSection(&ft_mutex, "dccmainthread", 37, "ft_mutex", 1);
}
// Free dcc
@@ -359,7 +359,7 @@ void __cdecl GGPROTO::dccmainthread(void*)
{
_close(local_dcc->file_fd); local_dcc->file_fd = -1;
gg_LeaveCriticalSection(&ft_mutex, "dccmainthread", 37, 6, "ft_mutex", 1);
- ProtoBroadcastAck((MCONTACT)local_dcc->contact, ACKTYPE_FILE, ACKRESULT_FAILED, local_dcc, 0);
+ ProtoBroadcastAck((UINT_PTR)local_dcc->contact, ACKTYPE_FILE, ACKRESULT_FAILED, local_dcc, 0);
gg_EnterCriticalSection(&ft_mutex, "dccmainthread", 37, "ft_mutex", 1);
}
// Free dcc
@@ -391,7 +391,7 @@ void __cdecl GGPROTO::dccmainthread(void*)
pre.lParam = (LPARAM)local_dcc;
gg_LeaveCriticalSection(&ft_mutex, "dccmainthread", 37, 7, "ft_mutex", 1);
- ProtoChainRecvFile((MCONTACT)local_dcc->contact, &pre);
+ ProtoChainRecvFile((UINT_PTR)local_dcc->contact, &pre);
gg_EnterCriticalSection(&ft_mutex, "dccmainthread", 37, "ft_mutex", 1);
mir_free(filenameT);
@@ -500,7 +500,7 @@ void __cdecl GGPROTO::dccmainthread(void*)
mir_snprintf(szFilename, _countof(szFilename), "%s%s", local_dcc->folder, local_dcc7->filename);
memset(&pfts, 0, sizeof(PROTOFILETRANSFERSTATUS));
pfts.cbSize = sizeof(PROTOFILETRANSFERSTATUS);
- pfts.hContact = (MCONTACT)local_dcc7->contact;
+ pfts.hContact = (UINT_PTR)local_dcc7->contact;
pfts.flags = (local_dcc7->type == GG_SESSION_DCC7_SEND);
pfts.pszFiles = NULL;
pfts.totalFiles = 1;
@@ -513,7 +513,7 @@ void __cdecl GGPROTO::dccmainthread(void*)
pfts.currentFileProgress = local_dcc7->offset;
pfts.currentFileTime = 0;
gg_LeaveCriticalSection(&ft_mutex, "dccmainthread", 37, 9, "ft_mutex", 1);
- ProtoBroadcastAck((MCONTACT)local_dcc7->contact, ACKTYPE_FILE, ACKRESULT_DATA, local_dcc7, (LPARAM)&pfts);
+ ProtoBroadcastAck((UINT_PTR)local_dcc7->contact, ACKTYPE_FILE, ACKRESULT_DATA, local_dcc7, (LPARAM)&pfts);
gg_EnterCriticalSection(&ft_mutex, "dccmainthread", 37, "ft_mutex", 1);
}
break;
@@ -530,7 +530,7 @@ void __cdecl GGPROTO::dccmainthread(void*)
mir_snprintf(szFilename, _countof(szFilename), "%s%s", local_dcc->folder, local_dcc7->filename);
memset(&pfts, 0, sizeof(PROTOFILETRANSFERSTATUS));
pfts.cbSize = sizeof(PROTOFILETRANSFERSTATUS);
- pfts.hContact = (MCONTACT)local_dcc7->contact;
+ pfts.hContact = (UINT_PTR)local_dcc7->contact;
pfts.flags = (local_dcc7->type == GG_SESSION_DCC7_SEND);
pfts.pszFiles = NULL;
pfts.totalFiles = 1;
@@ -543,11 +543,11 @@ void __cdecl GGPROTO::dccmainthread(void*)
pfts.currentFileProgress = local_dcc7->size;
pfts.currentFileTime = 0;
gg_LeaveCriticalSection(&ft_mutex, "dccmainthread", 37, 10, "ft_mutex", 1);
- ProtoBroadcastAck((MCONTACT)local_dcc7->contact, ACKTYPE_FILE, ACKRESULT_DATA, local_dcc7, (LPARAM)&pfts);
+ ProtoBroadcastAck((UINT_PTR)local_dcc7->contact, ACKTYPE_FILE, ACKRESULT_DATA, local_dcc7, (LPARAM)&pfts);
gg_EnterCriticalSection(&ft_mutex, "dccmainthread", 37, "ft_mutex", 1);
_close(local_dcc7->file_fd); local_dcc7->file_fd = -1;
gg_LeaveCriticalSection(&ft_mutex, "dccmainthread", 37, 11, "ft_mutex", 1);
- ProtoBroadcastAck((MCONTACT)local_dcc7->contact, ACKTYPE_FILE, ACKRESULT_SUCCESS, local_dcc7, 0);
+ ProtoBroadcastAck((UINT_PTR)local_dcc7->contact, ACKTYPE_FILE, ACKRESULT_SUCCESS, local_dcc7, 0);
gg_EnterCriticalSection(&ft_mutex, "dccmainthread", 37, "ft_mutex", 1);
}
// Free dcc
@@ -591,7 +591,7 @@ void __cdecl GGPROTO::dccmainthread(void*)
if (local_dcc7->contact) {
gg_LeaveCriticalSection(&ft_mutex, "dccmainthread", 37, 12, "ft_mutex", 1);
- ProtoBroadcastAck((MCONTACT)local_dcc7->contact, ACKTYPE_FILE, ACKRESULT_FAILED, local_dcc7, 0);
+ ProtoBroadcastAck((UINT_PTR)local_dcc7->contact, ACKTYPE_FILE, ACKRESULT_FAILED, local_dcc7, 0);
gg_EnterCriticalSection(&ft_mutex, "dccmainthread", 37, "ft_mutex", 1);
}
@@ -679,7 +679,7 @@ HANDLE GGPROTO::dccfileallow(HANDLE hTransfer, const TCHAR* szPath)
TCHAR error[512];
mir_sntprintf(error, TranslateT("Cannot create transfer file. ERROR: %d: %s (dcc)\n%s"), errno, _tcserror(errno), szPath);
showpopup(m_tszUserName, error, GG_POPUP_ERROR);
- ProtoBroadcastAck((MCONTACT)dcc->contact, ACKTYPE_FILE, ACKRESULT_FAILED, dcc, 0);
+ ProtoBroadcastAck((UINT_PTR)dcc->contact, ACKTYPE_FILE, ACKRESULT_FAILED, dcc, 0);
// Free transfer
gg_free_dcc(dcc);
return 0;
@@ -715,7 +715,7 @@ HANDLE GGPROTO::dcc7fileallow(HANDLE hTransfer, const TCHAR* szPath)
if (iFtRemoveRes == -1)
{
debugLogA("dcc7fileallow(): File transfer denied.");
- ProtoBroadcastAck((MCONTACT)dcc7->contact, ACKTYPE_FILE, ACKRESULT_DENIED, dcc7, 0);
+ ProtoBroadcastAck((UINT_PTR)dcc7->contact, ACKTYPE_FILE, ACKRESULT_DENIED, dcc7, 0);
// Free transfer
gg_dcc7_free(dcc7);
return 0;
@@ -729,7 +729,7 @@ HANDLE GGPROTO::dcc7fileallow(HANDLE hTransfer, const TCHAR* szPath)
mir_sntprintf(error, TranslateT("Cannot create transfer file. ERROR: %d: %s (dcc7)\n%s"), errno, _tcserror(errno), szPath);
showpopup(m_tszUserName, error, GG_POPUP_ERROR);
gg_dcc7_reject(dcc7, GG_DCC7_REJECT_USER);
- ProtoBroadcastAck((MCONTACT)dcc7->contact, ACKTYPE_FILE, ACKRESULT_FAILED, dcc7, 0);
+ ProtoBroadcastAck((UINT_PTR)dcc7->contact, ACKTYPE_FILE, ACKRESULT_FAILED, dcc7, 0);
// Free transfer
gg_dcc7_free(dcc7);
return 0;
@@ -800,7 +800,7 @@ int GGPROTO::dccfilecancel(HANDLE hTransfer)
gg_LeaveCriticalSection(&ft_mutex, "dccfilecancel", 44, 1, "ft_mutex", 1);
// Send failed info
- ProtoBroadcastAck((MCONTACT)dcc->contact, ACKTYPE_FILE, ACKRESULT_FAILED, dcc, 0);
+ ProtoBroadcastAck((UINT_PTR)dcc->contact, ACKTYPE_FILE, ACKRESULT_FAILED, dcc, 0);
// Close file
if (dcc->file_fd != -1)
{
@@ -830,7 +830,7 @@ int GGPROTO::dcc7filecancel(HANDLE hTransfer)
gg_LeaveCriticalSection(&ft_mutex, "dcc7filecancel", 45, 1, "ft_mutex", 1);
// Send failed info
- ProtoBroadcastAck((MCONTACT)dcc7->contact, ACKTYPE_FILE, ACKRESULT_FAILED, dcc7, 0);
+ ProtoBroadcastAck((UINT_PTR)dcc7->contact, ACKTYPE_FILE, ACKRESULT_FAILED, dcc7, 0);
// Close file
if (dcc7->file_fd != -1)
{
diff --git a/protocols/Gadu-Gadu/src/gg_proto.cpp b/protocols/Gadu-Gadu/src/gg_proto.cpp
index d77fb87d72..855542a409 100644
--- a/protocols/Gadu-Gadu/src/gg_proto.cpp
+++ b/protocols/Gadu-Gadu/src/gg_proto.cpp
@@ -21,7 +21,7 @@
#include "gg.h"
-GGPROTO::GGPROTO(const char* pszProtoName, const TCHAR* tszUserName) :
+GGPROTO::GGPROTO(const char *pszProtoName, const TCHAR *tszUserName) :
PROTO<GGPROTO>(pszProtoName, tszUserName),
avatar_requests(1, NumericKeySortT),
avatar_transfers(1, NumericKeySortT)
@@ -68,7 +68,7 @@ GGPROTO::GGPROTO(const char* pszProtoName, const TCHAR* tszUserName) :
db_set_resident(m_szModuleName, GG_KEY_AVATARREQUESTED);
TCHAR szPath[MAX_PATH];
- mir_sntprintf(szPath, _T("%s\\%s\\ImageCache"), (TCHAR*)VARST( _T("%miranda_userdata%")), m_tszUserName);
+ mir_sntprintf(szPath, _T("%s\\%s\\ImageCache"), (TCHAR*)VARST(_T("%miranda_userdata%")), m_tszUserName);
hImagesFolder = FoldersRegisterCustomPathT(LPGEN("Images"), m_szModuleName, szPath, m_tszUserName);
DWORD dwVersion;
@@ -142,22 +142,22 @@ MCONTACT GGPROTO::AddToList(int flags, PROTOSEARCHRESULT *pmsr)
DWORD_PTR GGPROTO::GetCaps(int type, MCONTACT hContact)
{
switch (type) {
- case PFLAGNUM_1:
- return PF1_IM | PF1_BASICSEARCH | PF1_EXTSEARCH | PF1_EXTSEARCHUI | PF1_SEARCHBYNAME |
- PF1_MODEMSG | PF1_NUMERICUSERID | PF1_VISLIST | PF1_FILE;
- case PFLAGNUM_2:
- return PF2_ONLINE | PF2_SHORTAWAY | PF2_HEAVYDND | PF2_FREECHAT | PF2_INVISIBLE |
- PF2_LONGAWAY;
- case PFLAGNUM_3:
- return PF2_ONLINE | PF2_SHORTAWAY | PF2_HEAVYDND | PF2_FREECHAT | PF2_INVISIBLE;
- case PFLAGNUM_4:
- return PF4_NOCUSTOMAUTH | PF4_SUPPORTTYPING | PF4_AVATARS | PF4_IMSENDOFFLINE;
- case PFLAGNUM_5:
- return PF2_LONGAWAY;
- case PFLAG_UNIQUEIDTEXT:
- return (DWORD_PTR) Translate("Gadu-Gadu Number");
- case PFLAG_UNIQUEIDSETTING:
- return (DWORD_PTR) GG_KEY_UIN;
+ case PFLAGNUM_1:
+ return PF1_IM | PF1_BASICSEARCH | PF1_EXTSEARCH | PF1_EXTSEARCHUI | PF1_SEARCHBYNAME |
+ PF1_MODEMSG | PF1_NUMERICUSERID | PF1_VISLIST | PF1_FILE;
+ case PFLAGNUM_2:
+ return PF2_ONLINE | PF2_SHORTAWAY | PF2_HEAVYDND | PF2_FREECHAT | PF2_INVISIBLE |
+ PF2_LONGAWAY;
+ case PFLAGNUM_3:
+ return PF2_ONLINE | PF2_SHORTAWAY | PF2_HEAVYDND | PF2_FREECHAT | PF2_INVISIBLE;
+ case PFLAGNUM_4:
+ return PF4_NOCUSTOMAUTH | PF4_SUPPORTTYPING | PF4_AVATARS | PF4_IMSENDOFFLINE;
+ case PFLAGNUM_5:
+ return PF2_LONGAWAY;
+ case PFLAG_UNIQUEIDTEXT:
+ return (DWORD_PTR)Translate("Gadu-Gadu Number");
+ case PFLAG_UNIQUEIDSETTING:
+ return (DWORD_PTR)GG_KEY_UIN;
}
return 0;
}
@@ -169,7 +169,7 @@ void __cdecl GGPROTO::cmdgetinfothread(void *hContact)
{
debugLogA("cmdgetinfothread(): started. Failed info retreival.");
gg_sleep(100, FALSE, "cmdgetinfothread", 103, 1);
- ProtoBroadcastAck((MCONTACT)hContact, ACKTYPE_GETINFO, ACKRESULT_FAILED, (HANDLE)1, 0);
+ ProtoBroadcastAck((UINT_PTR)hContact, ACKTYPE_GETINFO, ACKRESULT_FAILED, (HANDLE)1, 0);
debugLogA("cmdgetinfothread(): end.");
}
@@ -178,13 +178,11 @@ int GGPROTO::GetInfo(MCONTACT hContact, int infoType)
gg_pubdir50_t req;
// Custom contact info
- if (hContact)
- {
- if (!(req = gg_pubdir50_new(GG_PUBDIR50_SEARCH)))
- {
-#ifdef DEBUGMODE
+ if (hContact) {
+ if (!(req = gg_pubdir50_new(GG_PUBDIR50_SEARCH))) {
+ #ifdef DEBUGMODE
debugLogA("GetInfo(): ForkThread 6 GGPROTO::cmdgetinfothread");
-#endif
+ #endif
ForkThread(&GGPROTO::cmdgetinfothread, (void*)hContact);
return 1;
}
@@ -194,15 +192,13 @@ int GGPROTO::GetInfo(MCONTACT hContact, int infoType)
gg_pubdir50_seq_set(req, GG_SEQ_INFO);
debugLogA("GetInfo(): Requesting user info.", req->seq);
- if (isonline())
- {
+ if (isonline()) {
gg_EnterCriticalSection(&sess_mutex, "GetInfo", 48, "sess_mutex", 1);
- if (!gg_pubdir50(sess, req))
- {
+ if (!gg_pubdir50(sess, req)) {
gg_LeaveCriticalSection(&sess_mutex, "GetInfo", 48, 1, "sess_mutex", 1);
-#ifdef DEBUGMODE
+ #ifdef DEBUGMODE
debugLogA("GetInfo(): ForkThread 7 GGPROTO::cmdgetinfothread");
-#endif
+ #endif
ForkThread(&GGPROTO::cmdgetinfothread, (void*)hContact);
return 1;
}
@@ -210,13 +206,11 @@ int GGPROTO::GetInfo(MCONTACT hContact, int infoType)
}
}
// Own contact info
- else
- {
- if (!(req = gg_pubdir50_new(GG_PUBDIR50_READ)))
- {
-#ifdef DEBUGMODE
+ else {
+ if (!(req = gg_pubdir50_new(GG_PUBDIR50_READ))) {
+ #ifdef DEBUGMODE
debugLogA("GetInfo(): ForkThread 8 GGPROTO::cmdgetinfothread");
-#endif
+ #endif
ForkThread(&GGPROTO::cmdgetinfothread, (void*)hContact);
return 1;
}
@@ -225,15 +219,13 @@ int GGPROTO::GetInfo(MCONTACT hContact, int infoType)
gg_pubdir50_seq_set(req, GG_SEQ_CHINFO);
debugLogA("GetInfo(): Requesting owner info.", req->seq);
- if (isonline())
- {
+ if (isonline()) {
gg_EnterCriticalSection(&sess_mutex, "GetInfo", 49, "sess_mutex", 1);
- if (!gg_pubdir50(sess, req))
- {
+ if (!gg_pubdir50(sess, req)) {
gg_LeaveCriticalSection(&sess_mutex, "GetInfo", 49, 1, "sess_mutex", 1);
-#ifdef DEBUGMODE
+ #ifdef DEBUGMODE
debugLogA("GetInfo(): ForkThread 9 GGPROTO::cmdgetinfothread");
-#endif
+ #endif
ForkThread(&GGPROTO::cmdgetinfothread, (void*)hContact);
return 1;
}
@@ -266,9 +258,9 @@ HANDLE GGPROTO::SearchBasic(const TCHAR *id)
gg_pubdir50_t req = gg_pubdir50_new(GG_PUBDIR50_SEARCH);
if (!req) {
-#ifdef DEBUGMODE
+ #ifdef DEBUGMODE
debugLogA("SearchBasic(): ForkThread 10 GGPROTO::searchthread");
-#endif
+ #endif
ForkThread(&GGPROTO::searchthread, NULL);
return (HANDLE)1;
}
@@ -278,12 +270,11 @@ HANDLE GGPROTO::SearchBasic(const TCHAR *id)
gg_pubdir50_seq_set(req, GG_SEQ_SEARCH);
gg_EnterCriticalSection(&sess_mutex, "SearchBasic", 50, "sess_mutex", 1);
- if (!gg_pubdir50(sess, req))
- {
+ if (!gg_pubdir50(sess, req)) {
gg_LeaveCriticalSection(&sess_mutex, "SearchBasic", 50, 1, "sess_mutex", 1);
-#ifdef DEBUGMODE
+ #ifdef DEBUGMODE
debugLogA("SearchBasic(): ForkThread 11 GGPROTO::searchthread");
-#endif
+ #endif
ForkThread(&GGPROTO::searchthread, NULL);
return (HANDLE)1;
}
@@ -308,33 +299,30 @@ HANDLE GGPROTO::SearchByName(const TCHAR *nick, const TCHAR *firstName, const TC
gg_pubdir50_t req = gg_pubdir50_new(GG_PUBDIR50_SEARCH);
if (req == NULL) {
-#ifdef DEBUGMODE
+ #ifdef DEBUGMODE
debugLogA("SearchByName(): ForkThread 12 GGPROTO::searchthread");
-#endif
+ #endif
ForkThread(&GGPROTO::searchthread, NULL);
return (HANDLE)1;
}
// Add nick,firstName,lastName and search it
CMStringA szQuery;
- if (nick)
- {
+ if (nick) {
T2Utf nick_utf8(nick);
gg_pubdir50_add(req, GG_PUBDIR50_NICKNAME, nick_utf8);
szQuery.Append(nick_utf8);
}
szQuery.AppendChar('.');
- if (firstName)
- {
+ if (firstName) {
T2Utf firstName_utf8(firstName);
gg_pubdir50_add(req, GG_PUBDIR50_FIRSTNAME, firstName_utf8);
szQuery.Append(firstName_utf8);
}
szQuery.AppendChar('.');
- if (lastName)
- {
+ if (lastName) {
T2Utf lastName_utf8(lastName);
gg_pubdir50_add(req, GG_PUBDIR50_LASTNAME, lastName_utf8);
szQuery.Append(lastName_utf8);
@@ -350,12 +338,11 @@ HANDLE GGPROTO::SearchByName(const TCHAR *nick, const TCHAR *firstName, const TC
gg_pubdir50_seq_set(req, GG_SEQ_SEARCH);
gg_EnterCriticalSection(&sess_mutex, "SearchByName", 51, "sess_mutex", 1);
- if (!gg_pubdir50(sess, req))
- {
+ if (!gg_pubdir50(sess, req)) {
gg_LeaveCriticalSection(&sess_mutex, "SearchByName", 51, 1, "sess_mutex", 1);
-#ifdef DEBUGMODE
+ #ifdef DEBUGMODE
debugLogA("SearchByName(): ForkThread 13 GGPROTO::searchthread");
-#endif
+ #endif
ForkThread(&GGPROTO::searchthread, NULL);
return (HANDLE)1;
}
@@ -376,11 +363,10 @@ HWND GGPROTO::SearchAdvanced(HWND hwndDlg)
return 0;
gg_pubdir50_t req = gg_pubdir50_new(GG_PUBDIR50_SEARCH);
- if (!req)
- {
-#ifdef DEBUGMODE
+ if (!req) {
+ #ifdef DEBUGMODE
debugLogA("SearchAdvanced(): ForkThread 14 GGPROTO::searchthread");
-#endif
+ #endif
ForkThread(&GGPROTO::searchthread, NULL);
return (HWND)1;
}
@@ -390,8 +376,7 @@ HWND GGPROTO::SearchAdvanced(HWND hwndDlg)
// Fetch search data
TCHAR text[64];
GetDlgItemText(hwndDlg, IDC_FIRSTNAME, text, _countof(text));
- if (mir_tstrlen(text))
- {
+ if (mir_tstrlen(text)) {
T2Utf firstName_utf8(text);
gg_pubdir50_add(req, GG_PUBDIR50_FIRSTNAME, firstName_utf8);
szQuery.Append(firstName_utf8);
@@ -399,8 +384,7 @@ HWND GGPROTO::SearchAdvanced(HWND hwndDlg)
/* 1 */ szQuery.AppendChar('.');
GetDlgItemText(hwndDlg, IDC_LASTNAME, text, _countof(text));
- if (mir_tstrlen(text))
- {
+ if (mir_tstrlen(text)) {
T2Utf lastName_utf8(text);
gg_pubdir50_add(req, GG_PUBDIR50_LASTNAME, lastName_utf8);
szQuery.Append(lastName_utf8);
@@ -408,8 +392,7 @@ HWND GGPROTO::SearchAdvanced(HWND hwndDlg)
/* 2 */ szQuery.AppendChar('.');
GetDlgItemText(hwndDlg, IDC_NICKNAME, text, _countof(text));
- if (mir_tstrlen(text))
- {
+ if (mir_tstrlen(text)) {
T2Utf nickName_utf8(text);
gg_pubdir50_add(req, GG_PUBDIR50_NICKNAME, nickName_utf8);
szQuery.Append(nickName_utf8);
@@ -417,8 +400,7 @@ HWND GGPROTO::SearchAdvanced(HWND hwndDlg)
/* 3 */ szQuery.AppendChar('.');
GetDlgItemText(hwndDlg, IDC_CITY, text, _countof(text));
- if (mir_tstrlen(text))
- {
+ if (mir_tstrlen(text)) {
T2Utf city_utf8(text);
gg_pubdir50_add(req, GG_PUBDIR50_CITY, city_utf8);
szQuery.Append(city_utf8);
@@ -426,8 +408,7 @@ HWND GGPROTO::SearchAdvanced(HWND hwndDlg)
/* 4 */ szQuery.AppendChar('.');
GetDlgItemText(hwndDlg, IDC_AGEFROM, text, _countof(text));
- if (mir_tstrlen(text))
- {
+ if (mir_tstrlen(text)) {
int yearTo = _tstoi(text);
int yearFrom;
time_t t = time(NULL);
@@ -455,21 +436,19 @@ HWND GGPROTO::SearchAdvanced(HWND hwndDlg)
}
/* 5 */ szQuery.AppendChar('.');
- switch(SendDlgItemMessage(hwndDlg, IDC_GENDER, CB_GETCURSEL, 0, 0))
- {
- case 1:
- gg_pubdir50_add(req, GG_PUBDIR50_GENDER, GG_PUBDIR50_GENDER_FEMALE);
- szQuery.Append(GG_PUBDIR50_GENDER_MALE);
- break;
- case 2:
- gg_pubdir50_add(req, GG_PUBDIR50_GENDER, GG_PUBDIR50_GENDER_MALE);
- szQuery.Append(GG_PUBDIR50_GENDER_FEMALE);
- break;
+ switch (SendDlgItemMessage(hwndDlg, IDC_GENDER, CB_GETCURSEL, 0, 0)) {
+ case 1:
+ gg_pubdir50_add(req, GG_PUBDIR50_GENDER, GG_PUBDIR50_GENDER_FEMALE);
+ szQuery.Append(GG_PUBDIR50_GENDER_MALE);
+ break;
+ case 2:
+ gg_pubdir50_add(req, GG_PUBDIR50_GENDER, GG_PUBDIR50_GENDER_MALE);
+ szQuery.Append(GG_PUBDIR50_GENDER_FEMALE);
+ break;
}
/* 6 */ szQuery.AppendChar('.');
- if (IsDlgButtonChecked(hwndDlg, IDC_ONLYCONNECTED))
- {
+ if (IsDlgButtonChecked(hwndDlg, IDC_ONLYCONNECTED)) {
gg_pubdir50_add(req, GG_PUBDIR50_ACTIVE, GG_PUBDIR50_ACTIVE_TRUE);
szQuery.Append(GG_PUBDIR50_ACTIVE_TRUE);
}
@@ -489,15 +468,13 @@ HWND GGPROTO::SearchAdvanced(HWND hwndDlg)
gg_pubdir50_seq_set(req, GG_SEQ_SEARCH);
- if (isonline())
- {
+ if (isonline()) {
gg_EnterCriticalSection(&sess_mutex, "SearchAdvanced", 52, "sess_mutex", 1);
- if (!gg_pubdir50(sess, req))
- {
+ if (!gg_pubdir50(sess, req)) {
gg_LeaveCriticalSection(&sess_mutex, "SearchAdvanced", 52, 1, "sess_mutex", 1);
-#ifdef DEBUGMODE
+ #ifdef DEBUGMODE
debugLogA("SearchAdvanced(): ForkThread 15 GGPROTO::searchthread");
-#endif
+ #endif
ForkThread(&GGPROTO::searchthread, NULL);
return (HWND)1;
}
@@ -512,9 +489,9 @@ HWND GGPROTO::SearchAdvanced(HWND hwndDlg)
//////////////////////////////////////////////////////////
// create adv search dialog
-static INT_PTR CALLBACK gg_advancedsearchdlgproc(HWND hwndDlg,UINT message,WPARAM wParam,LPARAM lParam)
+static INT_PTR CALLBACK gg_advancedsearchdlgproc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
- switch(message) {
+ switch (message) {
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
SendDlgItemMessage(hwndDlg, IDC_GENDER, CB_ADDSTRING, 0, (LPARAM)_T("")); // 0
@@ -544,7 +521,7 @@ void __cdecl GGPROTO::sendackthread(void *ack)
{
GG_SEQ_ACK *pAck = (GG_SEQ_ACK *)ack;
gg_sleep(100, FALSE, "sendackthread", 105, 1);
- ProtoBroadcastAck(pAck->hContact, ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, (HANDLE) pAck->seq, 0);
+ ProtoBroadcastAck(pAck->hContact, ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, (HANDLE)pAck->seq, 0);
mir_free(ack);
}
@@ -560,17 +537,15 @@ int GGPROTO::SendMsg(MCONTACT hContact, int, const char *msg)
gg_EnterCriticalSection(&sess_mutex, "SendMsg", 53, "sess_mutex", 1);
int seq = gg_send_message(sess, GG_CLASS_CHAT, uin, (BYTE*)msg);
gg_LeaveCriticalSection(&sess_mutex, "SendMsg", 53, 1, "sess_mutex", 1);
- if (!getByte(GG_KEY_MSGACK, GG_KEYDEF_MSGACK))
- {
+ if (!getByte(GG_KEY_MSGACK, GG_KEYDEF_MSGACK)) {
// Auto-ack message without waiting for server ack
GG_SEQ_ACK *ack = (GG_SEQ_ACK*)mir_alloc(sizeof(GG_SEQ_ACK));
- if (ack)
- {
+ if (ack) {
ack->seq = seq;
ack->hContact = hContact;
-#ifdef DEBUGMODE
+ #ifdef DEBUGMODE
debugLogA("SendMsg(): ForkThread 16 GGPROTO::sendackthread");
-#endif
+ #endif
ForkThread(&GGPROTO::sendackthread, ack);
}
}
@@ -615,15 +590,15 @@ void __cdecl GGPROTO::getawaymsgthread(void *arg)
{
DBVARIANT dbv;
- MCONTACT hContact = (MCONTACT) arg;
+ MCONTACT hContact = (UINT_PTR)arg;
debugLogA("getawaymsgthread(): started");
gg_sleep(100, FALSE, "getawaymsgthread", 106, 1);
- if (!db_get_s(hContact, "CList", GG_KEY_STATUSDESCR, &dbv, DBVT_TCHAR))
- {
+ if (!db_get_s(hContact, "CList", GG_KEY_STATUSDESCR, &dbv, DBVT_TCHAR)) {
ProtoBroadcastAck(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, (LPARAM)dbv.ptszVal);
debugLog(_T("getawaymsgthread(): Reading away msg <%s>."), dbv.ptszVal);
db_free(&dbv);
- } else {
+ }
+ else {
ProtoBroadcastAck(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, 0);
}
debugLogA("getawaymsgthread(): end");
@@ -651,47 +626,43 @@ int GGPROTO::SetAwayMsg(int iStatus, const TCHAR *newMsg)
gg_EnterCriticalSection(&modemsg_mutex, "SetAwayMsg", 55, "modemsg_mutex", 1);
// Select proper our msg ptr
- switch(status)
- {
- case ID_STATUS_ONLINE:
- msgPtr = &modemsg.online;
- break;
- case ID_STATUS_AWAY:
- msgPtr = &modemsg.away;
- break;
- case ID_STATUS_DND:
- msgPtr = &modemsg.dnd;
- break;
- case ID_STATUS_FREECHAT:
- msgPtr = &modemsg.freechat;
- break;
- case ID_STATUS_INVISIBLE:
- msgPtr = &modemsg.invisible;
- break;
- default:
- gg_LeaveCriticalSection(&modemsg_mutex, "SetAwayMsg", 55, 1, "modemsg_mutex", 1);
- return 1;
+ switch (status) {
+ case ID_STATUS_ONLINE:
+ msgPtr = &modemsg.online;
+ break;
+ case ID_STATUS_AWAY:
+ msgPtr = &modemsg.away;
+ break;
+ case ID_STATUS_DND:
+ msgPtr = &modemsg.dnd;
+ break;
+ case ID_STATUS_FREECHAT:
+ msgPtr = &modemsg.freechat;
+ break;
+ case ID_STATUS_INVISIBLE:
+ msgPtr = &modemsg.invisible;
+ break;
+ default:
+ gg_LeaveCriticalSection(&modemsg_mutex, "SetAwayMsg", 55, 1, "modemsg_mutex", 1);
+ return 1;
}
// Check if we change status here somehow
if (*msgPtr && newMsg && !mir_tstrcmp(*msgPtr, newMsg)
- || !*msgPtr && (!newMsg || !*newMsg))
- {
- if (status == m_iDesiredStatus && m_iDesiredStatus == m_iStatus)
- {
+ || !*msgPtr && (!newMsg || !*newMsg)) {
+ if (status == m_iDesiredStatus && m_iDesiredStatus == m_iStatus) {
debugLogA("SetAwayMsg(): Message hasn't been changed, return.");
gg_LeaveCriticalSection(&modemsg_mutex, "SetAwayMsg", 55, 2, "modemsg_mutex", 1);
return 0;
}
}
- else
- {
+ else {
if (*msgPtr)
mir_free(*msgPtr);
*msgPtr = newMsg && *newMsg ? mir_tstrdup(newMsg) : NULL;
-#ifdef DEBUGMODE
+ #ifdef DEBUGMODE
debugLogA("SetAwayMsg(): Message changed.");
-#endif
+ #endif
}
gg_LeaveCriticalSection(&modemsg_mutex, "SetAwayMsg", 55, 3, "modemsg_mutex", 1);
@@ -725,7 +696,7 @@ int GGPROTO::UserIsTyping(MCONTACT hContact, int type)
int GGPROTO::OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam)
{
- switch( eventType ) {
+ switch (eventType) {
case EV_PROTO_ONLOAD:
HookProtoEvent(ME_OPT_INITIALISE, &GGPROTO::options_init);
HookProtoEvent(ME_USERINFO_INITIALISE, &GGPROTO::details_init);
diff --git a/protocols/Gadu-Gadu/src/groupchat.cpp b/protocols/Gadu-Gadu/src/groupchat.cpp
index b76e4816cd..4e2bfc3038 100644
--- a/protocols/Gadu-Gadu/src/groupchat.cpp
+++ b/protocols/Gadu-Gadu/src/groupchat.cpp
@@ -306,7 +306,7 @@ TCHAR* GGPROTO::gc_getchat(uin_t sender, uin_t *recipients, int recipients_count
gcwindow.pszModule = m_szModuleName;
gcwindow.ptszName = sender ? senderName : TranslateT("Conference");
gcwindow.ptszID = chat->id;
- gcwindow.dwItemData = (DWORD)chat;
+ gcwindow.dwItemData = (UINT_PTR)chat;
gcwindow.ptszStatusbarText = status;
// Here we put nice new hash sign
diff --git a/protocols/Gadu-Gadu/src/libgadu/http.cpp b/protocols/Gadu-Gadu/src/libgadu/http.cpp
index d07dca27d3..e1cc1b457f 100644
--- a/protocols/Gadu-Gadu/src/libgadu/http.cpp
+++ b/protocols/Gadu-Gadu/src/libgadu/http.cpp
@@ -330,7 +330,7 @@ int gg_http_watch_fd(struct gg_http *h)
unsigned int left;
char *line;
- left = h->header_size - ((long)(tmp) - (long)(h->header) + sep_len);
+ left = h->header_size - ((INT_PTR)tmp - (INT_PTR)(h->header) + sep_len);
gg_debug(GG_DEBUG_MISC, "=> http, got all header (%d bytes, %d left)\n", h->header_size - left, left);
diff --git a/protocols/ICQCorp/src/protocol.cpp b/protocols/ICQCorp/src/protocol.cpp
index 76350c4f18..d99b39d166 100644
--- a/protocols/ICQCorp/src/protocol.cpp
+++ b/protocols/ICQCorp/src/protocol.cpp
@@ -2301,7 +2301,7 @@ void ICQ::addFileReq(ICQUser *u, char *m, char *filename, unsigned long size, un
// Send chain event
szBlob = new char[sizeof(DWORD) + mir_strlen(filename) + mir_strlen(m) + 2];
- *(PDWORD)szBlob = (DWORD)transfer;
+ *(PDWORD)szBlob = (UINT_PTR)transfer;
mir_strcpy(szBlob + sizeof(DWORD), filename);
mir_strcpy(szBlob + sizeof(DWORD) + mir_strlen(filename) + 1, m);
diff --git a/protocols/ICQCorp/src/services.cpp b/protocols/ICQCorp/src/services.cpp
index 5eb8bed4d3..9cbea15a26 100644
--- a/protocols/ICQCorp/src/services.cpp
+++ b/protocols/ICQCorp/src/services.cpp
@@ -1,20 +1,20 @@
/*
- ICQ Corporate protocol plugin for Miranda IM.
- Copyright (C) 2003-2005 Eugene Tarasenko <zlyden13@inbox.ru>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ ICQ Corporate protocol plugin for Miranda IM.
+ Copyright (C) 2003-2005 Eugene Tarasenko <zlyden13@inbox.ru>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "corp.h"
@@ -25,19 +25,19 @@ static INT_PTR icqGetCaps(WPARAM wParam, LPARAM lParam)
{
switch (wParam) {
case PFLAGNUM_1:
- return PF1_IM|PF1_URL|PF1_FILE|PF1_MODEMSG|PF1_AUTHREQ|PF1_ADDED|PF1_PEER2PEER|PF1_BASICSEARCH|PF1_EXTSEARCH|PF1_CANRENAMEFILE|PF1_FILERESUME|PF1_ADDSEARCHRES|PF1_SEARCHBYEMAIL|PF1_SEARCHBYNAME|PF1_NUMERICUSERID;
+ return PF1_IM | PF1_URL | PF1_FILE | PF1_MODEMSG | PF1_AUTHREQ | PF1_ADDED | PF1_PEER2PEER | PF1_BASICSEARCH | PF1_EXTSEARCH | PF1_CANRENAMEFILE | PF1_FILERESUME | PF1_ADDSEARCHRES | PF1_SEARCHBYEMAIL | PF1_SEARCHBYNAME | PF1_NUMERICUSERID;
case PFLAGNUM_2:
- return PF2_ONLINE|PF2_INVISIBLE|PF2_SHORTAWAY|PF2_LONGAWAY|PF2_LIGHTDND|PF2_HEAVYDND|PF2_FREECHAT;
+ return PF2_ONLINE | PF2_INVISIBLE | PF2_SHORTAWAY | PF2_LONGAWAY | PF2_LIGHTDND | PF2_HEAVYDND | PF2_FREECHAT;
case PFLAGNUM_3:
- return PF2_SHORTAWAY|PF2_LONGAWAY|PF2_LIGHTDND|PF2_HEAVYDND|PF2_FREECHAT;
+ return PF2_SHORTAWAY | PF2_LONGAWAY | PF2_LIGHTDND | PF2_HEAVYDND | PF2_FREECHAT;
case PFLAG_UNIQUEIDTEXT:
- return (int)Translate("ICQ number:");
+ return (INT_PTR)Translate("ICQ number:");
case PFLAG_UNIQUEIDSETTING:
- return (int)"UIN";
+ return (INT_PTR)"UIN";
}
return 0;
}
@@ -54,14 +54,13 @@ static INT_PTR icqGetName(WPARAM wParam, LPARAM lParam)
static INT_PTR icqLoadIcon(WPARAM wParam, LPARAM lParam)
{
- unsigned int id;
+ int id;
- switch (wParam & 0xFFFF)
- {
+ switch (wParam & 0xFFFF) {
case PLI_PROTOCOL: id = IDI_ICQCORP; break;
- default: return (int)(HICON)NULL;
+ default: return NULL;
}
- return (int)LoadImage(hInstance, MAKEINTRESOURCE(id), IMAGE_ICON, GetSystemMetrics(wParam & PLIF_SMALL ? SM_CXSMICON : SM_CXICON), GetSystemMetrics(wParam & PLIF_SMALL ? SM_CYSMICON : SM_CYICON), 0);
+ return (INT_PTR)LoadImage(hInstance, MAKEINTRESOURCE(id), IMAGE_ICON, GetSystemMetrics(wParam & PLIF_SMALL ? SM_CXSMICON : SM_CXICON), GetSystemMetrics(wParam & PLIF_SMALL ? SM_CYSMICON : SM_CYICON), 0);
}
///////////////////////////////////////////////////////////////////////////////
@@ -76,13 +75,11 @@ static INT_PTR icqSetStatus(WPARAM wParam, LPARAM lParam)
if (desiredStatus == ID_STATUS_ONLINE) icq.awayMessage[0] = 0;
if (icq.desiredStatus == desiredStatus) return 0;
- if (desiredStatus == ID_STATUS_OFFLINE)
- {
+ if (desiredStatus == ID_STATUS_OFFLINE) {
icq.desiredStatus = desiredStatus;
icq.logoff(false);
}
- else
- {
+ else {
if (icq.statusVal == ID_STATUS_OFFLINE) icq.logon(desiredStatus);
else icq.setStatus(desiredStatus);
}
@@ -259,7 +256,7 @@ static INT_PTR icqSetAwayMsg(WPARAM wParam, LPARAM lParam)
if (lParam == NULL) return 0;
- if (icq.awayMessage) delete [] icq.awayMessage;
+ if (icq.awayMessage) delete[] icq.awayMessage;
icq.awayMessage = new char[mir_strlen((char*)lParam) + 1];
mir_strcpy(icq.awayMessage, (char*)lParam);
@@ -314,30 +311,26 @@ static INT_PTR icqSendFile(WPARAM wParam, LPARAM lParam)
char filename[MAX_PATH], format[32];
WIN32_FIND_DATA findData;
- for (filesCount=0,directoriesCount=0; files[filesCount]; filesCount++)
- {
+ for (filesCount = 0, directoriesCount = 0; files[filesCount]; filesCount++) {
FindClose(FindFirstFile(files[filesCount], &findData));
if (findData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) directoriesCount++;
else filesSize += findData.nFileSizeLow;
}
filesCount -= directoriesCount;
- if (directoriesCount)
- {
+ if (directoriesCount) {
sprintf(format, "%s, %s", filesCount == 1 ? Translate("%d file") : Translate("%d files"), directoriesCount == 1 ? Translate("%d directory") : Translate("%d directories"));
sprintf(filename, format, filesCount, directoriesCount);
}
- else
- {
- if (filesCount == 1)
- {
+ else {
+ if (filesCount == 1) {
char *p = strrchr(files[0], '\\');
- mir_strcpy(filename, p ? p+1 : files[0]);
+ mir_strcpy(filename, p ? p + 1 : files[0]);
}
else sprintf(filename, filesCount == 1 ? Translate("%d file") : Translate("%d files"), filesCount);
}
- return (int)icq.sendFile(u, (char*)ccs->wParam, filename, filesSize, files);
+ return (INT_PTR)icq.sendFile(u, (char*)ccs->wParam, filename, filesSize, files);
}
///////////////////////////////////////////////////////////////////////////////
@@ -356,7 +349,7 @@ static INT_PTR icqFileAllow(WPARAM wParam, LPARAM lParam)
t->path = _strdup((char*)ccs->lParam);
icq.acceptFile(u, t->sequence, (char*)ccs->lParam);
- return (int)t;
+ return (INT_PTR)t;
}
///////////////////////////////////////////////////////////////////////////////
@@ -375,10 +368,8 @@ static INT_PTR icqFileDeny(WPARAM wParam, LPARAM lParam)
icq.refuseFile(u, t->sequence, (char*)ccs->lParam);
unsigned int i;
- for (i=0; i<icqTransfers.size(); i++)
- {
- if (icqTransfers[i] == t)
- {
+ for (i = 0; i < icqTransfers.size(); i++) {
+ if (icqTransfers[i] == t) {
delete icqTransfers[i];
icqTransfers[i] = icqTransfers[icqTransfers.size() - 1];
icqTransfers.pop_back();
@@ -404,10 +395,8 @@ static INT_PTR icqFileCancel(WPARAM wParam, LPARAM lParam)
// icq.refuseFile(u, t->sequence, (char*)ccs->lParam);
unsigned int i;
- for (i=0; i<icqTransfers.size(); i++)
- {
- if (icqTransfers[i] == t)
- {
+ for (i = 0; i < icqTransfers.size(); i++) {
+ if (icqTransfers[i] == t) {
delete icqTransfers[i];
icqTransfers[i] = icqTransfers[icqTransfers.size() - 1];
icqTransfers.pop_back();
@@ -439,7 +428,7 @@ static INT_PTR icqRecvFile(WPARAM wParam, LPARAM lParam)
dbei.timestamp = pre->timestamp;
dbei.flags = pre->flags & (PREF_CREATEREAD ? DBEF_READ : 0);
dbei.eventType = EVENTTYPE_FILE;
- dbei.cbBlob = sizeof(DWORD)+(DWORD)mir_strlen(szFile) + (DWORD)mir_strlen(szDesc) + 2;
+ dbei.cbBlob = sizeof(DWORD) + (DWORD)mir_strlen(szFile) + (DWORD)mir_strlen(szDesc) + 2;
dbei.pBlob = (PBYTE)pre->szMessage;
db_event_add(ccs->hContact, &dbei);
@@ -483,7 +472,7 @@ static INT_PTR icqSetApparentMode(WPARAM wParam, LPARAM lParam)
if (oldMode != 0) icq.updateUserList(u, oldMode == ID_STATUS_OFFLINE ? 1 : 2, 0);
if (newMode != 0) icq.updateUserList(u, newMode == ID_STATUS_OFFLINE ? 1 : 2, 1);
- */
+ */
return 0;
}
diff --git a/protocols/IRCG/src/ircproto.cpp b/protocols/IRCG/src/ircproto.cpp
index da16702dbe..9625abd87a 100644
--- a/protocols/IRCG/src/ircproto.cpp
+++ b/protocols/IRCG/src/ircproto.cpp
@@ -658,12 +658,12 @@ struct TFakeAckParam
void __cdecl CIrcProto::AckMessageFail(void *info)
{
- ProtoBroadcastAck((MCONTACT)info, ACKTYPE_MESSAGE, ACKRESULT_FAILED, NULL, (LPARAM)Translate("The protocol is not online"));
+ ProtoBroadcastAck((UINT_PTR)info, ACKTYPE_MESSAGE, ACKRESULT_FAILED, NULL, (LPARAM)Translate("The protocol is not online"));
}
void __cdecl CIrcProto::AckMessageFailDcc(void *info)
{
- ProtoBroadcastAck((MCONTACT)info, ACKTYPE_MESSAGE, ACKRESULT_FAILED, NULL, (LPARAM)Translate("The dcc chat connection is not active"));
+ ProtoBroadcastAck((UINT_PTR)info, ACKTYPE_MESSAGE, ACKRESULT_FAILED, NULL, (LPARAM)Translate("The dcc chat connection is not active"));
}
void __cdecl CIrcProto::AckMessageSuccess(void *info)
diff --git a/protocols/IcqOscarJ/src/icq_direct.cpp b/protocols/IcqOscarJ/src/icq_direct.cpp
index 5c837b352a..7131dc5b70 100644
--- a/protocols/IcqOscarJ/src/icq_direct.cpp
+++ b/protocols/IcqOscarJ/src/icq_direct.cpp
@@ -243,7 +243,7 @@ void __cdecl CIcqProto::icq_directThread(directthreadstartinfo *dtsi)
dwReqMsgID1 = pCookie->dwMsgID1;
dwReqMsgID2 = pCookie->dwMsgID2;
- dc.dwReqId = (DWORD)pCookie->ft;
+ dc.dwReqId = (UINT_PTR)pCookie->ft;
SAFE_FREE((void**)&pCookie);
}
}
diff --git a/protocols/IcqOscarJ/src/icq_uploadui.cpp b/protocols/IcqOscarJ/src/icq_uploadui.cpp
index edb1b0075d..51b58641c9 100644
--- a/protocols/IcqOscarJ/src/icq_uploadui.cpp
+++ b/protocols/IcqOscarJ/src/icq_uploadui.cpp
@@ -309,7 +309,7 @@ static INT_PTR CALLBACK DlgProcUploadList(HWND hwndDlg, UINT message, WPARAM wPa
if (ack->type != ICQACKTYPE_SERVERCLIST)
break;
- if ((int)ack->hProcess != currentSequence)
+ if ((INT_PTR)ack->hProcess != currentSequence)
break;
lastAckResult = ack->result == ACKRESULT_SUCCESS ? 0 : 1;
diff --git a/protocols/IcqOscarJ/src/icq_xstatus.cpp b/protocols/IcqOscarJ/src/icq_xstatus.cpp
index 455c83ada1..e663d4ee38 100644
--- a/protocols/IcqOscarJ/src/icq_xstatus.cpp
+++ b/protocols/IcqOscarJ/src/icq_xstatus.cpp
@@ -610,7 +610,7 @@ static INT_PTR CALLBACK SetXStatusDlgProc(HWND hwndDlg,UINT message,WPARAM wPara
ACKDATA *ack = (ACKDATA*)lParam;
if (ack->type != ICQACKTYPE_XSTATUS_RESPONSE) break;
if (ack->hContact != dat->hContact) break;
- if ((DWORD)ack->hProcess != dat->iEvent) break;
+ if ((UINT_PTR)ack->hProcess != dat->iEvent) break;
ShowDlgItem(hwndDlg, IDC_RETRXSTATUS, SW_HIDE);
ShowDlgItem(hwndDlg, IDC_XMSG, SW_SHOW);
diff --git a/protocols/IcqOscarJ/src/userinfotab.cpp b/protocols/IcqOscarJ/src/userinfotab.cpp
index 1b475a068b..75d2c8c054 100644
--- a/protocols/IcqOscarJ/src/userinfotab.cpp
+++ b/protocols/IcqOscarJ/src/userinfotab.cpp
@@ -51,10 +51,10 @@ static void SetValue(CIcqProto* ppro, HWND hwndDlg, int idCtrl, MCONTACT hContac
dbv.type = DBVT_DELETED;
- if ((hContact == NULL) && ((int)szModule < 0x100)) {
+ if ((hContact == NULL) && ((INT_PTR)szModule < 0x100)) {
dbv.type = (BYTE)szModule;
- switch ((int)szModule) {
+ switch ((INT_PTR)szModule) {
case DBVT_BYTE:
dbv.cVal = (BYTE)szSetting;
break;
@@ -62,7 +62,7 @@ static void SetValue(CIcqProto* ppro, HWND hwndDlg, int idCtrl, MCONTACT hContac
dbv.wVal = (WORD)szSetting;
break;
case DBVT_DWORD:
- dbv.dVal = (DWORD)szSetting;
+ dbv.dVal = (UINT_PTR)szSetting;
break;
case DBVT_ASCIIZ:
dbv.pszVal = pstr = szSetting;
diff --git a/protocols/IcqOscarJ/src/utilities.cpp b/protocols/IcqOscarJ/src/utilities.cpp
index 3fa2e718c1..6ad5193126 100644
--- a/protocols/IcqOscarJ/src/utilities.cpp
+++ b/protocols/IcqOscarJ/src/utilities.cpp
@@ -978,8 +978,7 @@ int CIcqProto::IsMetaInfoChanged(MCONTACT hContact)
res = 3; // threshold exceeded
}
}
- else
- res = 4; // no timestamp found
+ else res = 4; // no timestamp found
}
return res;
@@ -989,7 +988,7 @@ int CIcqProto::IsMetaInfoChanged(MCONTACT hContact)
void __cdecl CIcqProto::SetStatusNoteThread(void *pDelay)
{
if (pDelay)
- SleepEx((DWORD)pDelay, TRUE);
+ SleepEx((UINT_PTR)pDelay, TRUE);
mir_cslockfull l(cookieMutex);
diff --git a/protocols/MSN/src/msn_chat.cpp b/protocols/MSN/src/msn_chat.cpp
index 8d7d959364..40bbb74948 100644
--- a/protocols/MSN/src/msn_chat.cpp
+++ b/protocols/MSN/src/msn_chat.cpp
@@ -336,7 +336,7 @@ static void ChatInviteSend(HANDLE hItem, HWND hwndList, STRLIST &str, CMsnProto
if (buf[0]) str.insert(mir_t2a(buf));
}
else {
- MsnContact *msc = ppro->Lists_Get((MCONTACT)hItem);
+ MsnContact *msc = ppro->Lists_Get((UINT_PTR)hItem);
if (msc) {
char szContact[MSN_MAX_EMAIL_LEN];
@@ -404,7 +404,7 @@ INT_PTR CALLBACK DlgInviteToChat(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
switch (nmc->hdr.code) {
case CLN_NEWCONTACT:
if (param && (nmc->flags & (CLNF_ISGROUP | CLNF_ISINFO)) == 0)
- ChatValidateContact((MCONTACT)nmc->hItem, nmc->hdr.hwndFrom, param->ppro);
+ ChatValidateContact((UINT_PTR)nmc->hItem, nmc->hdr.hwndFrom, param->ppro);
break;
case CLN_LISTREBUILT:
diff --git a/protocols/MSN/src/msn_lists.cpp b/protocols/MSN/src/msn_lists.cpp
index d6881c3dbd..2afcc94d86 100644
--- a/protocols/MSN/src/msn_lists.cpp
+++ b/protocols/MSN/src/msn_lists.cpp
@@ -553,7 +553,7 @@ INT_PTR CALLBACK DlgProcMsnServLists(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
switch (nmc->hdr.code) {
case CLN_NEWCONTACT:
if ((nmc->flags & (CLNF_ISGROUP | CLNF_ISINFO)) == 0)
- SetContactIcons((MCONTACT)nmc->hItem, nmc->hdr.hwndFrom, proto);
+ SetContactIcons((UINT_PTR)nmc->hItem, nmc->hdr.hwndFrom, proto);
break;
case CLN_LISTREBUILT:
diff --git a/protocols/Sametime/src/sametime_proto.cpp b/protocols/Sametime/src/sametime_proto.cpp
index 27fbb51cf4..1e568c1a31 100644
--- a/protocols/Sametime/src/sametime_proto.cpp
+++ b/protocols/Sametime/src/sametime_proto.cpp
@@ -226,8 +226,6 @@ int CSametimeProto::SendMsg(MCONTACT hContact, int, const char* msg)
debugLog(_T("CSametimeProto::SendMsg() hContact=[%x]"), hContact);
char *proto = GetContactProto(hContact);
- int ret;
-
if (!proto || mir_strcmp(proto, m_szModuleName) != 0 || db_get_w(hContact, m_szModuleName, "Status", ID_STATUS_OFFLINE) == ID_STATUS_OFFLINE) {
TFakeAckParams* tfap = (TFakeAckParams*)mir_alloc(sizeof(TFakeAckParams));
tfap->proto = this;
@@ -240,7 +238,7 @@ int CSametimeProto::SendMsg(MCONTACT hContact, int, const char* msg)
if (!msg)
return 0;
- ret = (int)SendMessageToUser(hContact, msg);
+ int ret = (INT_PTR)SendMessageToUser(hContact, msg);
TFakeAckParams *tfap = (TFakeAckParams*)mir_alloc(sizeof(TFakeAckParams));
tfap->proto = this;
diff --git a/protocols/Sametime/src/sametime_session.cpp b/protocols/Sametime/src/sametime_session.cpp
index 74fede1541..abd9a0b508 100644
--- a/protocols/Sametime/src/sametime_session.cpp
+++ b/protocols/Sametime/src/sametime_session.cpp
@@ -106,9 +106,9 @@ void __cdecl SessionStateChange(mwSession* session, mwSessionState state, gpoint
break;
case mwSession_STOPPING:
- if ((int)info) {// & ERR_FAILURE) {
- proto->showPopup((int)info);
- }
+ if ((INT_PTR)info)
+ proto->showPopup((INT_PTR)info);
+
proto->SessionStopping();
break;
@@ -475,8 +475,8 @@ WORD CSametimeProto::GetClientVersion()
if (!session) return 0;
WORD retval = 0;
- retval = (int)mwSession_getProperty(session, mwSession_CLIENT_VER_MAJOR) << 8;
- retval |= (int)mwSession_getProperty(session, mwSession_CLIENT_VER_MINOR);
+ retval = (UINT_PTR)mwSession_getProperty(session, mwSession_CLIENT_VER_MAJOR) << 8;
+ retval |= (UINT_PTR)mwSession_getProperty(session, mwSession_CLIENT_VER_MINOR);
return retval;
}
@@ -485,8 +485,8 @@ WORD CSametimeProto::GetServerVersion()
if (!session) return 0;
WORD retval = 0;
- retval = (int)mwSession_getProperty(session, mwSession_SERVER_VER_MAJOR) << 8;
- retval |= (int)mwSession_getProperty(session, mwSession_SERVER_VER_MINOR);
+ retval = (UINT_PTR)mwSession_getProperty(session, mwSession_SERVER_VER_MAJOR) << 8;
+ retval |= (UINT_PTR)mwSession_getProperty(session, mwSession_SERVER_VER_MINOR);
return retval;
}
diff --git a/protocols/Sametime/src/userlist.cpp b/protocols/Sametime/src/userlist.cpp
index 6db619e1d5..eb4a67fecc 100644
--- a/protocols/Sametime/src/userlist.cpp
+++ b/protocols/Sametime/src/userlist.cpp
@@ -653,7 +653,7 @@ void CSametimeProto::UserRecvAwayMessage(MCONTACT hContact)
void mwResolve_handler_callback(mwServiceResolve* srvc, guint32 id, guint32 code, GList* results, gpointer data)
{
CSametimeProto* proto = getProtoFromMwServiceResolve(srvc);
- BOOL advanced = (BOOL)data;
+ BOOL advanced = (INT_PTR)data;
MYCUSTOMSEARCHRESULTS mcsr;
memset(&mcsr, 0, sizeof(mcsr));
diff --git a/protocols/Steam/src/steam_contacts.cpp b/protocols/Steam/src/steam_contacts.cpp
index c8e17b7aec..4fee4049ac 100644
--- a/protocols/Steam/src/steam_contacts.cpp
+++ b/protocols/Steam/src/steam_contacts.cpp
@@ -522,7 +522,7 @@ void CSteamProto::OnGotUserSummaries(const NETLIBHTTPREQUEST *response)
void CSteamProto::OnGotAvatar(const NETLIBHTTPREQUEST *response, void *arg)
{
PROTO_AVATAR_INFORMATION ai = { 0 };
- ai.hContact = (MCONTACT)arg;
+ ai.hContact = (UINT_PTR)arg;
GetDbAvatarInfo(ai);
if (response == NULL || response->resultCode != HTTP_CODE_OK)
@@ -582,7 +582,7 @@ void CSteamProto::OnFriendRemoved(const NETLIBHTTPREQUEST *response, void *arg)
{
if (response == NULL || response->resultCode != HTTP_CODE_OK || lstrcmpiA(response->pData, "true"))
{
- MCONTACT hContact = (MCONTACT)arg;
+ MCONTACT hContact = (UINT_PTR)arg;
ptrA who(getStringA(hContact, "SteamID"));
debugLogA("CSteamProto::OnFriendRemoved: failed to remove friend %s", who);
diff --git a/protocols/Steam/src/steam_proto.cpp b/protocols/Steam/src/steam_proto.cpp
index efe610c209..113c5f47b5 100644
--- a/protocols/Steam/src/steam_proto.cpp
+++ b/protocols/Steam/src/steam_proto.cpp
@@ -343,7 +343,7 @@ void __cdecl CSteamProto::GetAwayMsgThread(void *arg)
// Maybe not needed, but better to be sure that this won't happen faster than core handling return value of GetAwayMsg()
Sleep(50);
- MCONTACT hContact = (MCONTACT)arg;
+ MCONTACT hContact = (UINT_PTR)arg;
CMString message(db_get_tsa(hContact, "CList", "StatusMsg"));
// if contact has no status message, get xstatus message
diff --git a/protocols/Tlen/src/tlen_thread.cpp b/protocols/Tlen/src/tlen_thread.cpp
index 6803b74876..3a736cc836 100644
--- a/protocols/Tlen/src/tlen_thread.cpp
+++ b/protocols/Tlen/src/tlen_thread.cpp
@@ -163,7 +163,7 @@ void __cdecl TlenServerThread(ThreadData *info)
// Should be better with modeless.
onlinePassword[0] = (char) -1;
hEventPasswdDlg = CreateEvent(NULL, FALSE, FALSE, NULL);
- QueueUserAPC(TlenPasswordCreateDialogApcProc, hMainThread, (DWORD) jidStr);
+ QueueUserAPC(TlenPasswordCreateDialogApcProc, hMainThread, (UINT_PTR)jidStr);
WaitForSingleObject(hEventPasswdDlg, INFINITE);
CloseHandle(hEventPasswdDlg);
diff --git a/protocols/Tlen/src/tlen_voice.cpp b/protocols/Tlen/src/tlen_voice.cpp
index e0a5f48a7f..899495fad8 100644
--- a/protocols/Tlen/src/tlen_voice.cpp
+++ b/protocols/Tlen/src/tlen_voice.cpp
@@ -136,7 +136,7 @@ static int TlenVoicePlaybackStart(TLEN_VOICE_CONTROL *control)
control->proto->debugLogA("Playback device ID #%u: %s\r\n", iSelDev, wic.szPname);
}
- MMRESULT mmres = waveOutOpen(&control->hWaveOut, iSelDev, &wfm, (DWORD_PTR)&TlenVoicePlaybackCallback, (DWORD)control, CALLBACK_FUNCTION);
+ MMRESULT mmres = waveOutOpen(&control->hWaveOut, iSelDev, &wfm, (UINT_PTR)&TlenVoicePlaybackCallback, (UINT_PTR)control, CALLBACK_FUNCTION);
if (mmres != MMSYSERR_NOERROR) {
control->proto->debugLogA("TlenVoiceStart FAILED!");
return 1;
diff --git a/protocols/Tox/src/tox_chatrooms.cpp b/protocols/Tox/src/tox_chatrooms.cpp
index 00145f635f..a0363afd5f 100644
--- a/protocols/Tox/src/tox_chatrooms.cpp
+++ b/protocols/Tox/src/tox_chatrooms.cpp
@@ -308,7 +308,7 @@ INT_PTR CALLBACK CToxProto::ChatRoomInviteProc(HWND hwndDlg, UINT msg, WPARAM wP
case CLN_NEWCONTACT:
if ((nmc->flags & (CLNF_ISGROUP | CLNF_ISINFO)) == 0)
{
- param->proto->ChatValidateContact(nmc->hdr.hwndFrom, param->invitedContacts, (MCONTACT)nmc->hItem);
+ param->proto->ChatValidateContact(nmc->hdr.hwndFrom, param->invitedContacts, (UINT_PTR)nmc->hItem);
}
break;
diff --git a/protocols/Tox/src/tox_messages.cpp b/protocols/Tox/src/tox_messages.cpp
index b52bcbbe8a..79aaf06710 100644
--- a/protocols/Tox/src/tox_messages.cpp
+++ b/protocols/Tox/src/tox_messages.cpp
@@ -114,7 +114,7 @@ int CToxProto::OnPreCreateMessage(WPARAM, LPARAM lParam)
/* STATUS MESSAGE */
void CToxProto::GetStatusMessageAsync(void* arg)
{
- MCONTACT hContact = (MCONTACT)arg;
+ MCONTACT hContact = (UINT_PTR)arg;
int32_t friendNumber = GetToxFriendNumber(hContact);
if (friendNumber == UINT32_MAX)
diff --git a/protocols/VKontakte/src/misc.cpp b/protocols/VKontakte/src/misc.cpp
index bb57d1b3ee..67dec9e9cd 100644
--- a/protocols/VKontakte/src/misc.cpp
+++ b/protocols/VKontakte/src/misc.cpp
@@ -283,7 +283,7 @@ MCONTACT CVkProto::FindChat(LONG dwUserid)
bool CVkProto::CheckMid(LIST<void> &lList, int guid)
{
for (int i = lList.getCount() - 1; i >= 0; i--)
- if ((int)lList[i] == guid) {
+ if ((INT_PTR)lList[i] == guid) {
lList.remove(i);
return true;
}
@@ -549,7 +549,7 @@ void CVkProto::ApplyCookies(AsyncHttpRequest *pReq)
void __cdecl CVkProto::DBAddAuthRequestThread(void *p)
{
- MCONTACT hContact = (MCONTACT)p;
+ MCONTACT hContact = (UINT_PTR)p;
if (hContact == NULL || hContact == INVALID_CONTACT_ID || !IsOnline())
return;
@@ -696,7 +696,7 @@ void CVkProto::SetMirVer(MCONTACT hContact, int platform)
void CVkProto::ContactTypingThread(void *p)
{
debugLogA("CVkProto::ContactTypingThread");
- MCONTACT hContact = (MCONTACT)p;
+ MCONTACT hContact = (UINT_PTR)p;
CallService(MS_PROTO_CONTACTISTYPING, hContact, 5);
Sleep(5500);
CallService(MS_PROTO_CONTACTISTYPING, hContact);
diff --git a/protocols/VKontakte/src/vk_avatars.cpp b/protocols/VKontakte/src/vk_avatars.cpp
index d11bfa8258..9ce6447f36 100644
--- a/protocols/VKontakte/src/vk_avatars.cpp
+++ b/protocols/VKontakte/src/vk_avatars.cpp
@@ -23,19 +23,19 @@ void CVkProto::OnReceiveAvatar(NETLIBHTTPREQUEST *reply, AsyncHttpRequest* pReq)
return;
PROTO_AVATAR_INFORMATION ai = { 0 };
- GetAvatarFileName((MCONTACT)pReq->pUserInfo, ai.filename, _countof(ai.filename));
+ GetAvatarFileName((UINT_PTR)pReq->pUserInfo, ai.filename, _countof(ai.filename));
ai.format = ProtoGetBufferFormat(reply->pData);
FILE *out = _tfopen(ai.filename, _T("wb"));
if (out == NULL) {
- ProtoBroadcastAck((MCONTACT)pReq->pUserInfo, ACKTYPE_AVATAR, ACKRESULT_FAILED, &ai);
+ ProtoBroadcastAck((UINT_PTR)pReq->pUserInfo, ACKTYPE_AVATAR, ACKRESULT_FAILED, &ai);
return;
}
fwrite(reply->pData, 1, reply->dataLength, out);
fclose(out);
- setByte((MCONTACT)pReq->pUserInfo, "NeedNewAvatar", 0);
- ProtoBroadcastAck((MCONTACT)pReq->pUserInfo, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, &ai);
+ setByte((UINT_PTR)pReq->pUserInfo, "NeedNewAvatar", 0);
+ ProtoBroadcastAck((UINT_PTR)pReq->pUserInfo, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, &ai);
}
INT_PTR CVkProto::SvcGetAvatarCaps(WPARAM wParam, LPARAM lParam)
diff --git a/protocols/VKontakte/src/vk_captcha.cpp b/protocols/VKontakte/src/vk_captcha.cpp
index 8b98806e67..4067a4e392 100644
--- a/protocols/VKontakte/src/vk_captcha.cpp
+++ b/protocols/VKontakte/src/vk_captcha.cpp
@@ -48,7 +48,7 @@ static INT_PTR CALLBACK CaptchaFormDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam
case IDC_WHITERECT:
case IDC_INSTRUCTION:
case IDC_TITLE:
- return (BOOL)GetStockObject(WHITE_BRUSH);
+ return (INT_PTR)GetStockObject(WHITE_BRUSH);
}
return NULL;
diff --git a/protocols/VKontakte/src/vk_files.cpp b/protocols/VKontakte/src/vk_files.cpp
index 0f1cf72577..a64c8680df 100644
--- a/protocols/VKontakte/src/vk_files.cpp
+++ b/protocols/VKontakte/src/vk_files.cpp
@@ -372,7 +372,7 @@ void CVkProto::OnReciveUploadFile(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pR
<< TCHAR_PARAM("attachment", Attachment)
<< VER_API;
pMsgReq->AddHeader("Content-Type", "application/x-www-form-urlencoded");
- pMsgReq->pUserInfo = new CVkSendMsgParam(fup->hContact, -1, (int)pReq->pUserInfo);
+ pMsgReq->pUserInfo = new CVkSendMsgParam(fup->hContact, -1, (INT_PTR)pReq->pUserInfo);
Push(pMsgReq);
} \ No newline at end of file
diff --git a/protocols/VKontakte/src/vk_thread.cpp b/protocols/VKontakte/src/vk_thread.cpp
index e490908188..672ec3c9e3 100644
--- a/protocols/VKontakte/src/vk_thread.cpp
+++ b/protocols/VKontakte/src/vk_thread.cpp
@@ -453,7 +453,7 @@ void CVkProto::OnReceiveUserInfo(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pRe
if (jnResponse["freeoffline"].as_bool())
for (int i = 0; i < arContacts.getCount(); i++) {
- hContact = (MCONTACT)arContacts[i];
+ hContact = (UINT_PTR)arContacts[i];
LONG userID = getDword(hContact, "ID", -1);
if (userID == m_myUserId || userID == VK_FEED_USER)
continue;
@@ -544,7 +544,7 @@ void CVkProto::OnReceiveFriends(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq
if (bCleanContacts)
for (int i = 0; i < arContacts.getCount(); i++) {
- MCONTACT hContact = (MCONTACT)arContacts[i];
+ MCONTACT hContact = (UINT_PTR)arContacts[i];
LONG userID = getDword(hContact, "ID", -1);
if (userID == m_myUserId || userID == VK_FEED_USER)
continue;