diff options
author | Rozhuk Ivan <rozhuk.im@gmail.com> | 2014-11-30 00:53:10 +0000 |
---|---|---|
committer | Rozhuk Ivan <rozhuk.im@gmail.com> | 2014-11-30 00:53:10 +0000 |
commit | ce2af47d41cc790df1b18d9e80295a38747de19f (patch) | |
tree | b9e75709ec7e75dada1c77a3ea70f1304091cae9 /protocols | |
parent | a5574d24bc8c0e94c8880c75f0fd27d08d30b98b (diff) |
code cleanup, x64 fix
git-svn-id: http://svn.miranda-ng.org/main/trunk@11163 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols')
21 files changed, 63 insertions, 63 deletions
diff --git a/protocols/EmLanProto/src/mlan.cpp b/protocols/EmLanProto/src/mlan.cpp index 669f873090..945a6a16b7 100644 --- a/protocols/EmLanProto/src/mlan.cpp +++ b/protocols/EmLanProto/src/mlan.cpp @@ -449,10 +449,10 @@ void CMLan::RecvMessageUrl(CCSDATA* ccs) db_event_add(ccs->hContact, &dbei); } -int CMLan::AddToContactList(u_int flags, EMPSEARCHRESULT* psr) +INT_PTR CMLan::AddToContactList(u_int flags, EMPSEARCHRESULT* psr) { if (psr->hdr.cbSize!=sizeof(EMPSEARCHRESULT)) - return (int)(HANDLE)NULL; + return 0; in_addr addr; addr.S_un.S_addr = psr->ipaddr; @@ -465,7 +465,7 @@ int CMLan::AddToContactList(u_int flags, EMPSEARCHRESULT* psr) db_set_w(contact,PROTONAME,"RemoteVersion", psr->ver ); } - return (int)contact; + return (INT_PTR)contact; } int CMLan::SendMessageUrl(CCSDATA* ccs, bool isUrl) diff --git a/protocols/EmLanProto/src/mlan.h b/protocols/EmLanProto/src/mlan.h index 71d4182dfa..d3f518b04d 100644 --- a/protocols/EmLanProto/src/mlan.h +++ b/protocols/EmLanProto/src/mlan.h @@ -58,7 +58,7 @@ public: int RecvAwayMsg(CCSDATA* ccs);
int SetAwayMsg(u_int status, char* msg);
- int AddToContactList(u_int flags, EMPSEARCHRESULT* psr);
+ INT_PTR AddToContactList(u_int flags, EMPSEARCHRESULT* psr);
int Search(const char* name);
void LoadSettings();
void SaveSettings();
diff --git a/protocols/IcqOscarJ/src/icq_rates.cpp b/protocols/IcqOscarJ/src/icq_rates.cpp index a77f49c90b..d71c0ada22 100644 --- a/protocols/IcqOscarJ/src/icq_rates.cpp +++ b/protocols/IcqOscarJ/src/icq_rates.cpp @@ -223,7 +223,7 @@ int rates::getLimitLevel(WORD wGroup, int nLevel) void rates::initAckPacket(icq_packet *pPacket)
{
- serverPacketInit(pPacket, 10 + nGroups * (int)sizeof(WORD));
+ serverPacketInit(pPacket, 10 + nGroups * sizeof(WORD));
packFNACHeader(pPacket, ICQ_SERVICE_FAMILY, ICQ_CLIENT_RATE_ACK);
for (WORD wGroup = 1; wGroup <= nGroups; wGroup++)
packWord(pPacket, wGroup);
diff --git a/protocols/IcqOscarJ/src/oscar_filetransfer.cpp b/protocols/IcqOscarJ/src/oscar_filetransfer.cpp index 7c7e093769..673d072561 100644 --- a/protocols/IcqOscarJ/src/oscar_filetransfer.cpp +++ b/protocols/IcqOscarJ/src/oscar_filetransfer.cpp @@ -2090,7 +2090,7 @@ void CIcqProto::oft_sendPeerInit(oscar_connection *oc) ft->wEncoding = 2; // ucs-2
WCHAR *pwsThisFile = make_unicode_string(pszThisFileName);
SAFE_FREE((void**)&pszThisFileName);
- ft->cbRawFileName = strlennull(pwsThisFile) * (int)sizeof(WCHAR) + 2;
+ ft->cbRawFileName = strlennull(pwsThisFile) * sizeof(WCHAR) + 2;
if (ft->cbRawFileName < 64)
ft->cbRawFileName = 64;
ft->rawFileName = (char*)SAFE_MALLOC(ft->cbRawFileName);
diff --git a/protocols/IcqOscarJ/src/stdpackets.cpp b/protocols/IcqOscarJ/src/stdpackets.cpp index 7f20732276..735dbabcd7 100644 --- a/protocols/IcqOscarJ/src/stdpackets.cpp +++ b/protocols/IcqOscarJ/src/stdpackets.cpp @@ -330,7 +330,7 @@ DWORD CIcqProto::icq_SendChannel1Message(DWORD dwUin, char *szUID, MCONTACT hCon DWORD CIcqProto::icq_SendChannel1MessageW(DWORD dwUin, char *szUID, MCONTACT hContact, WCHAR *pszText, cookie_message_data *pCookieData)
{
- WORD wMessageLen = strlennull(pszText) * (int)sizeof(WCHAR);
+ WORD wMessageLen = strlennull(pszText) * sizeof(WCHAR);
DWORD dwCookie = AllocateCookie(CKT_MESSAGE, 0, hContact, (void*)pCookieData);
WORD wPacketLength = (pCookieData->nAckType == ACKTYPE_SERVER) ? 26 : 22;
diff --git a/protocols/Sametime/src/glib/gnulib/vasnprintf.c b/protocols/Sametime/src/glib/gnulib/vasnprintf.c index c981059f95..d37027a670 100644 --- a/protocols/Sametime/src/glib/gnulib/vasnprintf.c +++ b/protocols/Sametime/src/glib/gnulib/vasnprintf.c @@ -137,7 +137,7 @@ print_long_long (char *buf, /* Build number */ pointer = bufferend = &buffer[sizeof(buffer) - 1]; *pointer-- = '\0'; - for (i = 1; i < (int)sizeof(buffer); i++) + for (i = 1; i < sizeof(buffer); i++) { *pointer-- = digits[number % base]; number /= base; diff --git a/protocols/SkypeClassic/src/skype.cpp b/protocols/SkypeClassic/src/skype.cpp index d9f8502980..52d08a6a45 100644 --- a/protocols/SkypeClassic/src/skype.cpp +++ b/protocols/SkypeClassic/src/skype.cpp @@ -1689,12 +1689,12 @@ void LaunchSkypeAndSetStatusThread(void *) { if (bLaunching) return;
bLaunching = TRUE;
LOG(("LaunchSkypeAndSetStatusThread started."));
- InterlockedExchange((long *)&SkypeStatus, (int)ID_STATUS_CONNECTING);
+ InterlockedExchange((long *)&SkypeStatus, ID_STATUS_CONNECTING);
ProtoBroadcastAck(SKYPE_PROTONAME, NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)oldStatus, SkypeStatus);
if (ConnectToSkypeAPI(skype_path, 1) != -1) {
pthread_create((pThreadFunc)SkypeSystemInit, NULL);
- //InterlockedExchange((long *)&SkypeStatus, (int)newStatus);
+ //InterlockedExchange((long *)&SkypeStatus, newStatus);
//ProtoBroadcastAck(SKYPE_PROTONAME, NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE) oldStatus, SkypeStatus);
SetUserStatus();
}
@@ -2251,17 +2251,17 @@ INT_PTR SkypeSetStatus(WPARAM wParam, LPARAM lParam) //if (!SkypeInitialized && !db_get_b(NULL, SKYPE_PROTONAME, "UnloadOnOffline", 0)) return 0;
// Workaround for Skype status-bug
- if ((int)wParam == ID_STATUS_OFFLINE) logoff_contacts(TRUE);
- if (SkypeStatus == (int)wParam) return 0;
+ if (wParam == ID_STATUS_OFFLINE) logoff_contacts(TRUE);
+ if (SkypeStatus == wParam) return 0;
oldStatus = SkypeStatus;
- if ((int)wParam == ID_STATUS_CONNECTING) return 0;
+ if (wParam == ID_STATUS_CONNECTING) return 0;
#ifdef MAPDND
- if ((int)wParam == ID_STATUS_OCCUPIED || (int)wParam == ID_STATUS_ONTHEPHONE) wParam = ID_STATUS_DND;
- if ((int)wParam == ID_STATUS_OUTTOLUNCH) wParam = ID_STATUS_NA;
+ if (wParam == ID_STATUS_OCCUPIED || wParam == ID_STATUS_ONTHEPHONE) wParam = ID_STATUS_DND;
+ if (wParam == ID_STATUS_OUTTOLUNCH) wParam = ID_STATUS_NA;
#endif
#ifdef MAPNA
- if ((int)wParam==ID_STATUS_NA) wParam = ID_STATUS_AWAY;
+ if (wParam==ID_STATUS_NA) wParam = ID_STATUS_AWAY;
#endif
RequestedStatus = MirandaStatusToSkype((int)wParam);
@@ -2269,12 +2269,12 @@ INT_PTR SkypeSetStatus(WPARAM wParam, LPARAM lParam) /*
if (SkypeStatus != ID_STATUS_OFFLINE)
{
- InterlockedExchange((long*)&SkypeStatus, (int)wParam);
+ InterlockedExchange((long*)&SkypeStatus, wParam);
ProtoBroadcastAck(SKYPE_PROTONAME, NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE) oldStatus, SkypeStatus);
}
*/
- if ((int)wParam == ID_STATUS_OFFLINE && UnloadOnOffline)
+ if (wParam == ID_STATUS_OFFLINE && UnloadOnOffline)
{
if (UseCustomCommand)
{
@@ -2809,7 +2809,7 @@ INT_PTR SkypeAddToListByEvent(WPARAM wParam, LPARAM) { {
MCONTACT hContact = add_contact(pBlob + sizeof(DWORD) + sizeof(HANDLE), LOWORD(wParam));
free(pBlob);
- if (hContact) return (int)hContact;
+ if (hContact) return (INT_PTR)hContact;
}
return 0;
}
diff --git a/protocols/SkypeClassic/src/skypeapi.cpp b/protocols/SkypeClassic/src/skypeapi.cpp index 7c560bf510..afbde43ec8 100644 --- a/protocols/SkypeClassic/src/skypeapi.cpp +++ b/protocols/SkypeClassic/src/skypeapi.cpp @@ -169,7 +169,7 @@ void sendThread(char *dummy) { // Go offline
logoff_contacts(FALSE);
oldstatus=SkypeStatus;
- InterlockedExchange((long *)&SkypeStatus, (int)ID_STATUS_OFFLINE);
+ InterlockedExchange((long *)&SkypeStatus, ID_STATUS_OFFLINE);
ProtoBroadcastAck(SKYPE_PROTONAME, NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE) oldstatus, SkypeStatus);
}
// Reconnect to Skype
diff --git a/protocols/Xfire/src/main.cpp b/protocols/Xfire/src/main.cpp index d89f87e923..df4a9686e3 100644 --- a/protocols/Xfire/src/main.cpp +++ b/protocols/Xfire/src/main.cpp @@ -1285,12 +1285,12 @@ INT_PTR GetXStatusIcon(WPARAM wParam, LPARAM lParam) { if (lParam == LR_SHARED)
{
if (wParam > 1)
- return (int)xgamelist.iconmngr.getGameIconFromId(wParam - 2); //icocache[(int)wParam-2].hicon;
+ return (INT_PTR)xgamelist.iconmngr.getGameIconFromId(wParam - 2); //icocache[(int)wParam-2].hicon;
}
else
{
if (wParam > 1)
- return (int)CopyIcon((HICON)xgamelist.iconmngr.getGameIconFromId(wParam - 2)/*icocache[(int)wParam-2].hicon*/);
+ return (INT_PTR)CopyIcon((HICON)xgamelist.iconmngr.getGameIconFromId(wParam - 2)/*icocache[(int)wParam-2].hicon*/);
}
return 0;
@@ -1421,8 +1421,8 @@ INT_PTR TMLoadIcon(WPARAM wParam, LPARAM lParam) {
if (LOWORD(wParam) == PLI_PROTOCOL) {
if (wParam & PLIF_ICOLIB)
- return (int)Skin_GetIcon("XFIRE_main");
- return (int)CopyIcon(Skin_GetIcon("XFIRE_main"));
+ return (INT_PTR)Skin_GetIcon("XFIRE_main");
+ return (INT_PTR)CopyIcon(Skin_GetIcon("XFIRE_main"));
}
return NULL;
}
diff --git a/protocols/Yahoo/src/avatar.cpp b/protocols/Yahoo/src/avatar.cpp index 063231212a..5e2f99ceca 100644 --- a/protocols/Yahoo/src/avatar.cpp +++ b/protocols/Yahoo/src/avatar.cpp @@ -48,7 +48,7 @@ int YAHOO_avt_hash(const char *key, DWORD len) /**************** Send Avatar ********************/
-void upload_avt(int id, int fd, int error, void *data)
+void upload_avt(int id, INT_PTR fd, int error, void *data)
{
struct yahoo_file_info *sf = (struct yahoo_file_info*) data;
unsigned long size = 0;
diff --git a/protocols/Yahoo/src/chat.cpp b/protocols/Yahoo/src/chat.cpp index 1130a248af..7b25099304 100644 --- a/protocols/Yahoo/src/chat.cpp +++ b/protocols/Yahoo/src/chat.cpp @@ -150,7 +150,7 @@ void ext_yahoo_chat_cat_xml(int id, const char *xml) {
}
-void ext_yahoo_chat_join(int id, const char *me, const char *room, const char * topic, YList *members, int fd)
+void ext_yahoo_chat_join(int id, const char *me, const char *room, const char * topic, YList *members, INT_PTR fd)
{
for (YList *l = members; l; l = l->next) free(l->data);
y_list_free(members);
diff --git a/protocols/Yahoo/src/file_transfer.cpp b/protocols/Yahoo/src/file_transfer.cpp index 4b2497574a..9d477785de 100644 --- a/protocols/Yahoo/src/file_transfer.cpp +++ b/protocols/Yahoo/src/file_transfer.cpp @@ -148,7 +148,7 @@ static void free_ft(y_filetransfer* ft) LOG(("[/free_ft]"));
}
-static void upload_file(int id, int fd, int error, void *data)
+static void upload_file(int id, INT_PTR fd, int error, void *data)
{
y_filetransfer *sf = (y_filetransfer*) data;
struct yahoo_file_info *fi = (struct yahoo_file_info *)sf->files->data;
@@ -281,7 +281,7 @@ static void upload_file(int id, int fd, int error, void *data) }
}
-static void dl_file(int id, int fd, int error, const char *filename, unsigned long size, void *data)
+static void dl_file(int id, INT_PTR fd, int error, const char *filename, unsigned long size, void *data)
{
y_filetransfer *sf = (y_filetransfer*) data;
struct yahoo_file_info *fi = (struct yahoo_file_info *)sf->files->data;
diff --git a/protocols/Yahoo/src/libyahoo2/libyahoo2.cpp b/protocols/Yahoo/src/libyahoo2/libyahoo2.cpp index 1b178f580e..aa365d8631 100644 --- a/protocols/Yahoo/src/libyahoo2/libyahoo2.cpp +++ b/protocols/Yahoo/src/libyahoo2/libyahoo2.cpp @@ -131,7 +131,7 @@ struct yahoo_input_data { struct yahoo_webcam_data *wcd; struct yahoo_search_state *ys; - int fd; + INT_PTR fd; enum yahoo_connection_type type; unsigned char *rxqueue; @@ -161,7 +161,7 @@ typedef struct { char *name; }value_string; -static int yahoo_send_data(int fd, const char *data, int len); +static int yahoo_send_data(INT_PTR fd, const char *data, int len); int yahoo_log_message(char * fmt, ...) { @@ -604,7 +604,7 @@ static struct yahoo_input_data * find_input_by_id_and_type(int id, enum yahoo_co return NULL; } -static struct yahoo_input_data * find_input_by_id_and_fd(int id, int fd) +static struct yahoo_input_data * find_input_by_id_and_fd(int id, INT_PTR fd) { YList *l; LOG(("find_input_by_id_and_fd")); @@ -1032,7 +1032,7 @@ static void yahoo_packet_free(struct yahoo_packet *pkt) FREE(pkt); } -static int yahoo_send_data(int fd, const char *data, int len) +static int yahoo_send_data(INT_PTR fd, const char *data, int len) { int ret; int e; @@ -1606,8 +1606,6 @@ static void yahoo_process_conference(struct yahoo_input_data *yid, struct yahoo_ if (pair->key == 14) /* decline/conf message */ msg = pair->value; - if (pair->key == 13) - ; if (pair->key == 16) /* error */ msg = pair->value; @@ -3606,7 +3604,7 @@ static void yahoo_process_yab_update(struct yahoo_input_data *yid, struct yahoo_ //YAHOO_CALLBACK(ext_yahoo_got_ping)(yid->yd->client_id, errormsg); } -static void _yahoo_webcam_get_server_connected(int fd, int error, void *d) +static void _yahoo_webcam_get_server_connected(INT_PTR fd, int error, void *d) { struct yahoo_input_data *yid = (struct yahoo_input_data *) d; char *who = yid->wcm->user; @@ -4266,7 +4264,7 @@ static int yahoo_get_webcam_data(struct yahoo_input_data *yid) return 0; } -int yahoo_write_ready(int id, int fd, void *data) +int yahoo_write_ready(int id, INT_PTR fd, void *data) { struct yahoo_input_data *yid = (struct yahoo_input_data *) data; int len; @@ -4502,7 +4500,7 @@ static void yahoo_process_search_connection(struct yahoo_input_data *yid, int ov } } -static void _yahoo_webcam_connected(int fd, int error, void *d) +static void _yahoo_webcam_connected(INT_PTR fd, int error, void *d) { struct yahoo_input_data *yid = (struct yahoo_input_data *) d; struct yahoo_webcam * wcm = yid->wcm; @@ -4658,7 +4656,7 @@ static void yahoo_process_webcam_master_connection(struct yahoo_input_data *yid, static void yahoo_process_webcam_connection(struct yahoo_input_data *yid, int over) { int id = yid->yd->client_id; - int fd = yid->fd; + INT_PTR fd = yid->fd; if (over) return; @@ -4678,7 +4676,7 @@ static void (*yahoo_process_connection[])(struct yahoo_input_data *, int over) = yahoo_process_search_connection }; -int yahoo_read_ready(int id, int fd, void *data) +int yahoo_read_ready(int id, INT_PTR fd, void *data) { struct yahoo_input_data *yid = (struct yahoo_input_data *) data; struct yahoo_server_settings *yss; @@ -4797,7 +4795,7 @@ struct connect_callback_data { int type; }; -static void yahoo_connected(int fd, int error, void *data) +static void yahoo_connected(INT_PTR fd, int error, void *data) { struct connect_callback_data *ccd = (struct connect_callback_data *) data; struct yahoo_data *yd = ccd->yd; @@ -5140,7 +5138,7 @@ void yahoo_get_list(int id) } } -static void _yahoo_http_connected(int id, int fd, int error, void *data) +static void _yahoo_http_connected(int id, INT_PTR fd, int error, void *data) { struct yahoo_input_data *yid = (struct yahoo_input_data *) data; if (fd <= 0) { @@ -6036,12 +6034,12 @@ struct send_file_data { void *user_data; }; -static void _yahoo_send_file_connected(int id, int fd, int error, void *data) +static void _yahoo_send_file_connected(int id, INT_PTR fd, int error, void *data) { struct yahoo_input_data *yid = find_input_by_id_and_type(id, YAHOO_CONNECTION_FT); struct send_file_data *sfd = (struct send_file_data *) data; struct yahoo_packet *pkt = sfd->pkt; - char buff[1024]; + unsigned char buff[1024]; if (fd <= 0) { sfd->callback(id, fd, error, sfd->user_data); @@ -6062,7 +6060,7 @@ static void _yahoo_send_file_connected(int id, int fd, int error, void *data) buff[2] = 0xc0; buff[3] = 0x80; - write(yid->fd, buff, 4); + write(yid->fd, (char*)buff, 4); /* YAHOO_CALLBACK(ext_yahoo_add_handler)(nyd->fd, YAHOO_INPUT_READ); */ diff --git a/protocols/Yahoo/src/libyahoo2/yahoo2.h b/protocols/Yahoo/src/libyahoo2/yahoo2.h index 475d82b6c3..958e83e472 100644 --- a/protocols/Yahoo/src/libyahoo2/yahoo2.h +++ b/protocols/Yahoo/src/libyahoo2/yahoo2.h @@ -183,8 +183,8 @@ void yahoo_get_url_handle(int id, const char *url, /* these should be called when input is available on a fd */
/* registered by ext_yahoo_add_handler */
/* if these return negative values, errno may be set */
-int yahoo_read_ready(int id, int fd, void *data);
-int yahoo_write_ready(int id, int fd, void *data);
+int yahoo_read_ready(int id, INT_PTR fd, void *data);
+int yahoo_write_ready(int id, INT_PTR fd, void *data);
/* utility functions. these do not hit the server */
enum yahoo_status yahoo_current_status(int id);
diff --git a/protocols/Yahoo/src/libyahoo2/yahoo2_callbacks.h b/protocols/Yahoo/src/libyahoo2/yahoo2_callbacks.h index b6a01346cb..f8d7eb1ad1 100644 --- a/protocols/Yahoo/src/libyahoo2/yahoo2_callbacks.h +++ b/protocols/Yahoo/src/libyahoo2/yahoo2_callbacks.h @@ -62,7 +62,7 @@ typedef enum { * callback_data - the callback_data passed to the ext_yahoo_connect_async
* function
*/
-typedef void (*yahoo_connect_callback)(int fd, int error, void *callback_data);
+typedef void (*yahoo_connect_callback)(INT_PTR fd, int error, void *callback_data);
/*
@@ -391,7 +391,7 @@ void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_cat_xml)(int id, const char *xml); * of yahoo_chat_member's) Must be freed by the client
* fd - the socket where the connection is coming from (for tracking)
*/
-void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_join)(int id, const char *me, const char *room, const char *topic, YList *members, int fd);
+void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_join)(int id, const char *me, const char *room, const char *topic, YList *members, INT_PTR fd);
/*
@@ -790,7 +790,7 @@ int YAHOO_CALLBACK_TYPE(ext_yahoo_log)(const char *fmt, ...); *
* Returns: a tag to be used when removing the handler
*/
-unsigned int YAHOO_CALLBACK_TYPE(ext_yahoo_add_handler)(int id, int fd, yahoo_input_condition cond, void *data);
+unsigned int YAHOO_CALLBACK_TYPE(ext_yahoo_add_handler)(int id, INT_PTR fd, yahoo_input_condition cond, void *data);
/*
diff --git a/protocols/Yahoo/src/libyahoo2/yahoo2_types.h b/protocols/Yahoo/src/libyahoo2/yahoo2_types.h index e0bcf9498c..245cc118fd 100644 --- a/protocols/Yahoo/src/libyahoo2/yahoo2_types.h +++ b/protocols/Yahoo/src/libyahoo2/yahoo2_types.h @@ -403,12 +403,12 @@ struct yahoo_found_contact { /*
* Function pointer to be passed to http get/post and send file
*/
-typedef void (*yahoo_get_fd_callback)(int id, int fd, int error, void *data);
+typedef void (*yahoo_get_fd_callback)(int id, INT_PTR fd, int error, void *data);
/*
* Function pointer to be passed to yahoo_get_url_handle
*/
-typedef void (*yahoo_get_url_handle_callback)(int id, int fd, int error,
+typedef void (*yahoo_get_url_handle_callback)(int id, INT_PTR fd, int error,
const char *filename, unsigned long size, void *data);
diff --git a/protocols/Yahoo/src/libyahoo2/yahoo_httplib.cpp b/protocols/Yahoo/src/libyahoo2/yahoo_httplib.cpp index c3543917f1..551c64fbe7 100644 --- a/protocols/Yahoo/src/libyahoo2/yahoo_httplib.cpp +++ b/protocols/Yahoo/src/libyahoo2/yahoo_httplib.cpp @@ -67,7 +67,7 @@ extern struct yahoo_callbacks *yc; extern enum yahoo_log_level log_level;
-int yahoo_tcp_readline(char *ptr, int maxlen, int fd)
+int yahoo_tcp_readline(char *ptr, int maxlen, INT_PTR fd)
{
int n, rc;
char c;
@@ -277,7 +277,7 @@ char *yahoo_xmldecode(const char *instr) return (str);
}
-typedef void (*http_connected)(int id, int fd, int error);
+typedef void (*http_connected)(int id, INT_PTR fd, int error);
struct callback_data {
int id;
@@ -286,7 +286,7 @@ struct callback_data { void *user_data;
};
-static void connect_complete(int fd, int error, void *data)
+static void connect_complete(INT_PTR fd, int error, void *data)
{
struct callback_data *ccd = (struct callback_data *) data;
@@ -376,7 +376,7 @@ struct url_data { void *user_data;
};
-static void yahoo_got_url_fd(int id, int fd, int error, void *data)
+static void yahoo_got_url_fd(int id, INT_PTR fd, int error, void *data)
{
char *tmp=NULL;
char buff[1024];
diff --git a/protocols/Yahoo/src/libyahoo2/yahoo_httplib.h b/protocols/Yahoo/src/libyahoo2/yahoo_httplib.h index 1698928928..1baea7cea8 100644 --- a/protocols/Yahoo/src/libyahoo2/yahoo_httplib.h +++ b/protocols/Yahoo/src/libyahoo2/yahoo_httplib.h @@ -32,7 +32,7 @@ char *yahoo_urlencode(const char *instr); char *yahoo_urldecode(const char *instr);
char *yahoo_xmldecode(const char *instr);
-int yahoo_tcp_readline(char *ptr, int maxlen, int fd);
+int yahoo_tcp_readline(char *ptr, int maxlen, INT_PTR fd);
void yahoo_http_post(int id, const char *url, const char *cookies, long size,
yahoo_get_fd_callback callback, void *data);
void yahoo_http_get(int id, const char *url, const char *cookies,
diff --git a/protocols/Yahoo/src/proto.h b/protocols/Yahoo/src/proto.h index 8b5616e462..1b7d1fd5c4 100644 --- a/protocols/Yahoo/src/proto.h +++ b/protocols/Yahoo/src/proto.h @@ -245,7 +245,7 @@ struct CYahooProto : public PROTO<CYahooProto> void set_status(int myyahooStatus, char *msg, int away);
void stealth(const char *buddy, int add);
- int ext_connect(const char *h, int p, int type);
+ INT_PTR ext_connect(const char *h, int p, int type);
int ext_connect_async(const char *host, int port, int type, yahoo_connect_callback callback, void *data);
void ext_send_http_request(enum yahoo_connection_type type, const char *method, const char *url, const char *cookies, long content_length, yahoo_get_fd_callback callback, void *callback_data);
diff --git a/protocols/Yahoo/src/yahoo.cpp b/protocols/Yahoo/src/yahoo.cpp index 0ac5740c41..7ecf6dc61f 100644 --- a/protocols/Yahoo/src/yahoo.cpp +++ b/protocols/Yahoo/src/yahoo.cpp @@ -1209,7 +1209,7 @@ void CYahooProto::ext_error(const char *err, int fatal, int num) extern HANDLE g_hNetlibUser;
-int CYahooProto::ext_connect(const char *h, int p, int type)
+INT_PTR CYahooProto::ext_connect(const char *h, int p, int type)
{
LOG(("[ext_connect] %s:%d type: %d", h, p, type));
@@ -1234,7 +1234,7 @@ int CYahooProto::ext_connect(const char *h, int p, int type) LOG(("[ext_connect] Got: %d", (int)con));
- return (int)con;
+ return (INT_PTR)con;
}
void CYahooProto::ext_send_http_request(enum yahoo_connection_type type, const char *method, const char *url,
@@ -1249,7 +1249,8 @@ void CYahooProto::ext_send_http_request(enum yahoo_connection_type type, const c */
NETLIBHTTPREQUEST nlhr={0};
NETLIBHTTPHEADER httpHeaders[5];
- int fd, error = 0;
+ int error = 0;
+ INT_PTR fd;
char host[255];
int port = 80, i=0;
char path[255];
@@ -1408,7 +1409,8 @@ void yahoo_callback(struct _conn *c, yahoo_input_condition cond) int CYahooProto::ext_connect_async(const char *host, int port, int type, yahoo_connect_callback callback, void *data)
{
- int err = 0, res;
+ int err = 0;
+ INT_PTR res;
LOG(("[ext_connect_async] %s:%d type: %d", host, port, type));
@@ -1604,7 +1606,7 @@ CYahooProto* __fastcall getProtoById( int id ) return NULL;
}
-unsigned int ext_yahoo_add_handler(int id, int fd, yahoo_input_condition cond, void *data)
+unsigned int ext_yahoo_add_handler(int id, INT_PTR fd, yahoo_input_condition cond, void *data)
{
CYahooProto* ppro = getProtoById( id );
if ( ppro )
diff --git a/protocols/Yahoo/src/yahoo.h b/protocols/Yahoo/src/yahoo.h index c99d1e13be..214c77fb43 100644 --- a/protocols/Yahoo/src/yahoo.h +++ b/protocols/Yahoo/src/yahoo.h @@ -88,7 +88,7 @@ extern int do_yahoo_debug; struct _conn {
unsigned int tag;
int id;
- int fd;
+ INT_PTR fd;
yahoo_input_condition cond;
void *data;
int remove;
|