summaryrefslogtreecommitdiff
path: root/protocols/Yahoo
diff options
context:
space:
mode:
authorRozhuk Ivan <rozhuk.im@gmail.com>2014-11-30 00:53:10 +0000
committerRozhuk Ivan <rozhuk.im@gmail.com>2014-11-30 00:53:10 +0000
commitce2af47d41cc790df1b18d9e80295a38747de19f (patch)
treeb9e75709ec7e75dada1c77a3ea70f1304091cae9 /protocols/Yahoo
parenta5574d24bc8c0e94c8880c75f0fd27d08d30b98b (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/Yahoo')
-rw-r--r--protocols/Yahoo/src/avatar.cpp2
-rw-r--r--protocols/Yahoo/src/chat.cpp2
-rw-r--r--protocols/Yahoo/src/file_transfer.cpp4
-rw-r--r--protocols/Yahoo/src/libyahoo2/libyahoo2.cpp30
-rw-r--r--protocols/Yahoo/src/libyahoo2/yahoo2.h4
-rw-r--r--protocols/Yahoo/src/libyahoo2/yahoo2_callbacks.h6
-rw-r--r--protocols/Yahoo/src/libyahoo2/yahoo2_types.h4
-rw-r--r--protocols/Yahoo/src/libyahoo2/yahoo_httplib.cpp8
-rw-r--r--protocols/Yahoo/src/libyahoo2/yahoo_httplib.h2
-rw-r--r--protocols/Yahoo/src/proto.h2
-rw-r--r--protocols/Yahoo/src/yahoo.cpp12
-rw-r--r--protocols/Yahoo/src/yahoo.h2
12 files changed, 39 insertions, 39 deletions
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;