From: Mark D. <the...@us...> - 2005-07-26 04:34:46
|
Update of /cvsroot/gaim/gaim/src/protocols/oscar In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23828/src/protocols/oscar Modified Files: aim.h chat.c ft.c im.c locate.c oscar.c service.c tlv.c Log Message: Get rid of a bunch of gcc4 compile warnings in oscar. Here's what I'm doing: -For random bits of binary data, use guchar * -For textual data (not necessarily utf8), use gchar * This seems to be what glib and gtk do Index: aim.h =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/oscar/aim.h,v retrieving revision 1.164 retrieving revision 1.165 diff -u -d -p -r1.164 -r1.165 --- aim.h 24 Jul 2005 19:45:58 -0000 1.164 +++ aim.h 26 Jul 2005 04:34:36 -0000 1.165 @@ -9,12 +9,10 @@ #ifndef __AIM_H__ #define __AIM_H__ -#define FAIM_VERSION_MAJOR 0 -#define FAIM_VERSION_MINOR 99 -#define FAIM_VERSION_MINORMINOR 1 +#include "faimconfig.h" +#include "aim_cbtypes.h" -#include <faimconfig.h> -#include <aim_cbtypes.h> +#include "internal.h" #include <stdio.h> #include <string.h> @@ -691,7 +689,7 @@ struct aim_chat_roominfo { #define AIM_IMFLAGS_BUDDYREQ 0x0010 /* buddy icon requested */ #define AIM_IMFLAGS_HASICON 0x0020 /* already has icon */ #define AIM_IMFLAGS_SUBENC_MACINTOSH 0x0040 /* damn that Steve Jobs! */ -#define AIM_IMFLAGS_CUSTOMFEATURES 0x0080 /* features field present */ +#define AIM_IMFLAGS_CUSTOMFEATURES 0x0080 /* features field present */ #define AIM_IMFLAGS_EXTDATA 0x0100 #define AIM_IMFLAGS_X 0x0200 #define AIM_IMFLAGS_MULTIPART 0x0400 /* ->mpmsg section valid */ @@ -708,7 +706,7 @@ struct aim_chat_roominfo { typedef struct aim_mpmsg_section_s { fu16_t charset; fu16_t charsubset; - fu8_t *data; + gchar *data; fu16_t datalen; struct aim_mpmsg_section_s *next; } aim_mpmsg_section_t; @@ -719,7 +717,7 @@ typedef struct aim_mpmsg_s { } aim_mpmsg_t; faim_export int aim_mpmsg_init(aim_session_t *sess, aim_mpmsg_t *mpm); -faim_export int aim_mpmsg_addraw(aim_session_t *sess, aim_mpmsg_t *mpm, fu16_t charset, fu16_t charsubset, const fu8_t *data, fu16_t datalen); +faim_export int aim_mpmsg_addraw(aim_session_t *sess, aim_mpmsg_t *mpm, fu16_t charset, fu16_t charsubset, const gchar *data, fu16_t datalen); faim_export int aim_mpmsg_addascii(aim_session_t *sess, aim_mpmsg_t *mpm, const char *ascii); faim_export int aim_mpmsg_addunicode(aim_session_t *sess, aim_mpmsg_t *mpm, const fu16_t *unicode, fu16_t unicodelen); faim_export void aim_mpmsg_free(aim_session_t *sess, aim_mpmsg_t *mpm); @@ -787,7 +785,7 @@ struct aim_incomingim_ch1_args { fu32_t icbmflags; /* some flags apply only to ->msg, not all mpmsg */ /* Only provided if message has a human-readable section */ - fu8_t *msg; + gchar *msg; int msglen; /* Only provided if AIM_IMFLAGS_HASICON is set */ @@ -861,7 +859,7 @@ struct aim_incomingim_ch4_args { fu32_t uin; /* Of the sender of the ICBM */ fu8_t type; fu8_t flags; - fu8_t *msg; /* Reason for auth request, deny, or accept */ + gchar *msg; /* Reason for auth request, deny, or accept */ int msglen; }; @@ -888,37 +886,37 @@ struct aim_incomingim_ch4_args { /* ft.c */ struct aim_fileheader_t { #if 0 - char magic[4]; /* 0 */ - fu16_t hdrlen; /* 4 */ - fu16_t hdrtype; /* 6 */ + char magic[4]; /* 0 */ + fu16_t hdrlen; /* 4 */ + fu16_t hdrtype; /* 6 */ #endif - char bcookie[8]; /* 8 */ - fu16_t encrypt; /* 16 */ - fu16_t compress; /* 18 */ - fu16_t totfiles; /* 20 */ - fu16_t filesleft; /* 22 */ - fu16_t totparts; /* 24 */ - fu16_t partsleft; /* 26 */ - fu32_t totsize; /* 28 */ - fu32_t size; /* 32 */ - fu32_t modtime; /* 36 */ - fu32_t checksum; /* 40 */ - fu32_t rfrcsum; /* 44 */ - fu32_t rfsize; /* 48 */ - fu32_t cretime; /* 52 */ - fu32_t rfcsum; /* 56 */ - fu32_t nrecvd; /* 60 */ - fu32_t recvcsum; /* 64 */ - fu8_t idstring[32]; /* 68 */ - fu8_t flags; /* 100 */ - fu8_t lnameoffset; /* 101 */ - fu8_t lsizeoffset; /* 102 */ - char dummy[69]; /* 103 */ - char macfileinfo[16]; /* 172 */ - fu16_t nencode; /* 188 */ - fu16_t nlanguage; /* 190 */ - char name[64]; /* 192 */ - /* 256 */ + guchar bcookie[8]; /* 8 */ + fu16_t encrypt; /* 16 */ + fu16_t compress; /* 18 */ + fu16_t totfiles; /* 20 */ + fu16_t filesleft; /* 22 */ + fu16_t totparts; /* 24 */ + fu16_t partsleft; /* 26 */ + fu32_t totsize; /* 28 */ + fu32_t size; /* 32 */ + fu32_t modtime; /* 36 */ + fu32_t checksum; /* 40 */ + fu32_t rfrcsum; /* 44 */ + fu32_t rfsize; /* 48 */ + fu32_t cretime; /* 52 */ + fu32_t rfcsum; /* 56 */ + fu32_t nrecvd; /* 60 */ + fu32_t recvcsum; /* 64 */ + char idstring[32]; /* 68 */ + fu8_t flags; /* 100 */ + fu8_t lnameoffset; /* 101 */ + fu8_t lsizeoffset; /* 102 */ + guchar dummy[69]; /* 103 */ + guchar macfileinfo[16]; /* 172 */ + fu16_t nencode; /* 188 */ + fu16_t nlanguage; /* 190 */ + char name[64]; /* 192 */ + /* 256 */ }; struct aim_oft_info { @@ -940,7 +938,7 @@ faim_export int aim_handlerendconnect(ai faim_export int aim_odc_send_typing(aim_session_t *sess, aim_conn_t *conn, int typing); faim_export int aim_odc_send_im(aim_session_t *sess, aim_conn_t *conn, const char *msg, int len, int encoding, int isawaymsg); faim_export const char *aim_odc_getsn(aim_conn_t *conn); -faim_export const char *aim_odc_getcookie(aim_conn_t *conn); +faim_export const guchar *aim_odc_getcookie(aim_conn_t *conn); faim_export aim_conn_t *aim_odc_getconn(aim_session_t *sess, const char *sn); faim_export aim_conn_t *aim_odc_initiate(aim_session_t *sess, const char *sn, int listenfd, const fu8_t *localip, fu16_t port, const fu8_t *mycookie); @@ -1087,7 +1085,7 @@ faim_export aim_userinfo_t *aim_locate_f faim_export void aim_locate_dorequest(aim_session_t *sess); /* 0x0002 */ faim_export int aim_locate_reqrights(aim_session_t *sess); -/* 0x0004 */ faim_export int aim_locate_setprofile(aim_session_t *sess, const char *profile_encoding, const fu8_t *profile, const int profile_len, const char *awaymsg_encoding, const fu8_t *awaymsg, const int awaymsg_len); +/* 0x0004 */ faim_export int aim_locate_setprofile(aim_session_t *sess, const char *profile_encoding, const gchar *profile, const int profile_len, const char *awaymsg_encoding, const gchar *awaymsg, const int awaymsg_len); /* 0x0004 */ faim_export int aim_locate_setcaps(aim_session_t *sess, fu32_t caps); /* 0x0005 */ faim_export int aim_locate_getinfo(aim_session_t *sess, const char *, fu16_t); /* 0x0009 */ faim_export int aim_locate_setdirinfo(aim_session_t *sess, const char *first, const char *middle, const char *last, const char *maiden, const char *nickname, const char *street, const char *city, const char *state, const char *zip, int country, fu16_t privacy); @@ -1132,7 +1130,7 @@ struct aim_chat_exchangeinfo { #define AIM_CHATFLAGS_NOREFLECT 0x0001 #define AIM_CHATFLAGS_AWAY 0x0002 -faim_export int aim_chat_send_im(aim_session_t *sess, aim_conn_t *conn, fu16_t flags, const fu8_t *msg, int msglen, const char *encoding, const char *language); +faim_export int aim_chat_send_im(aim_session_t *sess, aim_conn_t *conn, fu16_t flags, const gchar *msg, int msglen, const char *encoding, const char *language); faim_export int aim_chat_join(aim_session_t *sess, aim_conn_t *conn, fu16_t exchange, const char *roomname, fu16_t instance); faim_export int aim_chat_attachname(aim_conn_t *conn, fu16_t exchange, const char *roomname, fu16_t instance); faim_export char *aim_chat_getname(aim_conn_t *conn); Index: chat.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/oscar/chat.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -p -r1.25 -r1.26 --- chat.c 9 Jul 2005 19:26:48 -0000 1.25 +++ chat.c 26 Jul 2005 04:34:36 -0000 1.26 @@ -320,7 +320,7 @@ static int userlistchange(aim_session_t * * XXX convert this to use tlvchains */ -faim_export int aim_chat_send_im(aim_session_t *sess, aim_conn_t *conn, fu16_t flags, const fu8_t *msg, int msglen, const char *encoding, const char *language) +faim_export int aim_chat_send_im(aim_session_t *sess, aim_conn_t *conn, fu16_t flags, const gchar *msg, int msglen, const char *encoding, const char *language) { int i; aim_frame_t *fr; @@ -376,7 +376,7 @@ faim_export int aim_chat_send_im(aim_ses /* * SubTLV: Type 1: Message */ - aim_tlvlist_add_raw(&itl, 0x0001, msglen, msg); + aim_tlvlist_add_raw(&itl, 0x0001, msglen, (guchar *)msg); /* * SubTLV: Type 2: Encoding Index: ft.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/oscar/ft.c,v retrieving revision 1.65 retrieving revision 1.66 diff -u -d -p -r1.65 -r1.66 --- ft.c 19 Jul 2005 03:51:54 -0000 1.65 +++ ft.c 26 Jul 2005 04:34:36 -0000 1.66 @@ -394,7 +394,7 @@ faim_export int aim_odc_send_im(aim_sess aimbs_put16(hdrbs, 0x393e); aimbs_put16(hdrbs, 0xcac8); #endif - aimbs_putraw(hdrbs, msg, len); + aimbs_putraw(hdrbs, (guchar *)msg, len); aim_tx_enqueue(sess, fr); @@ -429,7 +429,7 @@ faim_export const char *aim_odc_getsn(ai * @param conn The ODC connection. * @return The cookie, an 8 byte unterminated string, or NULL if there was an anomaly. */ -faim_export const char *aim_odc_getcookie(aim_conn_t *conn) +faim_export const guchar *aim_odc_getcookie(aim_conn_t *conn) { struct aim_odc_intdata *intdata; @@ -789,7 +789,7 @@ static struct aim_fileheader_t *aim_oft_ fh->rfcsum = aimbs_get32(bs); fh->nrecvd = aimbs_get32(bs); fh->recvcsum = aimbs_get32(bs); - aimbs_getrawbuf(bs, fh->idstring, 32); + aimbs_getrawbuf(bs, (guchar *)fh->idstring, 32); fh->flags = aimbs_get8(bs); fh->lnameoffset = aimbs_get8(bs); fh->lsizeoffset = aimbs_get8(bs); @@ -797,7 +797,7 @@ static struct aim_fileheader_t *aim_oft_ aimbs_getrawbuf(bs, fh->macfileinfo, 16); fh->nencode = aimbs_get16(bs); fh->nlanguage = aimbs_get16(bs); - aimbs_getrawbuf(bs, fh->name, 64); /* XXX - filenames longer than 64B */ + aimbs_getrawbuf(bs, (guchar *)fh->name, 64); /* XXX - filenames longer than 64B */ fh->name[63] = '\0'; return fh; @@ -838,7 +838,7 @@ static int aim_oft_buildheader(aim_bstre aimbs_put32(bs, fh->rfcsum); aimbs_put32(bs, fh->nrecvd); aimbs_put32(bs, fh->recvcsum); - aimbs_putraw(bs, fh->idstring, 32); + aimbs_putraw(bs, (const guchar *)fh->idstring, 32); aimbs_put8(bs, fh->flags); aimbs_put8(bs, fh->lnameoffset); aimbs_put8(bs, fh->lsizeoffset); @@ -846,7 +846,7 @@ static int aim_oft_buildheader(aim_bstre aimbs_putraw(bs, fh->macfileinfo, 16); aimbs_put16(bs, fh->nencode); aimbs_put16(bs, fh->nlanguage); - aimbs_putraw(bs, fh->name, 64); /* XXX - filenames longer than 64B */ + aimbs_putraw(bs, (const guchar *)fh->name, 64); /* XXX - filenames longer than 64B */ return 0; } Index: im.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/oscar/im.c,v retrieving revision 1.72 retrieving revision 1.73 diff -u -d -p -r1.72 -r1.73 --- im.c 24 Jul 2005 20:41:53 -0000 1.72 +++ im.c 26 Jul 2005 04:34:36 -0000 1.73 @@ -324,7 +324,7 @@ faim_export int aim_im_sendch1_ext(aim_s aimbs_put16(&fr->data, sec->datalen + 4); aimbs_put16(&fr->data, sec->charset); aimbs_put16(&fr->data, sec->charsubset); - aimbs_putraw(&fr->data, sec->data, sec->datalen); + aimbs_putraw(&fr->data, (guchar *)sec->data, sec->datalen); } } else { @@ -340,7 +340,7 @@ faim_export int aim_im_sendch1_ext(aim_s aimbs_put16(&fr->data, args->charsubset); /* Message. Not terminated */ - aimbs_putraw(&fr->data, args->msg, args->msglen); + aimbs_putraw(&fr->data, (guchar *)args->msg, args->msglen); } /* Set the Autoresponse flag */ @@ -1200,7 +1200,7 @@ faim_export int aim_mpmsg_init(aim_sessi return 0; } -static int mpmsg_addsection(aim_session_t *sess, aim_mpmsg_t *mpm, fu16_t charset, fu16_t charsubset, fu8_t *data, fu16_t datalen) +static int mpmsg_addsection(aim_session_t *sess, aim_mpmsg_t *mpm, fu16_t charset, fu16_t charsubset, gchar *data, fu16_t datalen) { aim_mpmsg_section_t *sec; @@ -1228,9 +1228,9 @@ static int mpmsg_addsection(aim_session_ return 0; } -faim_export int aim_mpmsg_addraw(aim_session_t *sess, aim_mpmsg_t *mpm, fu16_t charset, fu16_t charsubset, const fu8_t *data, fu16_t datalen) +faim_export int aim_mpmsg_addraw(aim_session_t *sess, aim_mpmsg_t *mpm, fu16_t charset, fu16_t charsubset, const gchar *data, fu16_t datalen) { - fu8_t *dup; + gchar *dup; if (!(dup = malloc(datalen))) return -1; @@ -1247,9 +1247,9 @@ faim_export int aim_mpmsg_addraw(aim_ses /* XXX - should provide a way of saying ISO-8859-1 specifically */ faim_export int aim_mpmsg_addascii(aim_session_t *sess, aim_mpmsg_t *mpm, const char *ascii) { - fu8_t *dup; + gchar *dup; - if (!(dup = (fu8_t *)strdup(ascii))) + if (!(dup = strdup(ascii))) return -1; if (mpmsg_addsection(sess, mpm, 0x0000, 0x0000, dup, strlen(ascii)) == -1) { @@ -1262,14 +1262,14 @@ faim_export int aim_mpmsg_addascii(aim_s faim_export int aim_mpmsg_addunicode(aim_session_t *sess, aim_mpmsg_t *mpm, const fu16_t *unicode, fu16_t unicodelen) { - fu8_t *buf; + gchar *buf; aim_bstream_t bs; int i; if (!(buf = malloc(unicodelen * 2))) return -1; - aim_bstream_init(&bs, buf, unicodelen * 2); + aim_bstream_init(&bs, (guchar *)buf, unicodelen * 2); /* We assume unicode is in /host/ byte order -- convert to network */ for (i = 0; i < unicodelen; i++) @@ -1325,7 +1325,7 @@ static int incomingim_ch1_parsemsgs(aim_ while (aim_bstream_empty(&mbs)) { fu16_t msglen, flag1, flag2; - fu8_t *msgbuf; + gchar *msgbuf; aimbs_get8(&mbs); /* 01 */ aimbs_get8(&mbs); /* 01 */ @@ -1358,7 +1358,7 @@ static int incomingim_ch1_parsemsgs(aim_ * the received messages are given in network byte order. * */ - msgbuf = aimbs_getraw(&mbs, msglen); + msgbuf = (gchar *)aimbs_getraw(&mbs, msglen); mpmsg_addsection(sess, &args->mpmsg, flag1, flag2, msgbuf, msglen); } /* while */ @@ -1964,7 +1964,7 @@ static int incomingim_ch4(aim_session_t args.type = aimbs_getle8(&meat); args.flags = aimbs_getle8(&meat); args.msglen = aimbs_getle16(&meat); - args.msg = aimbs_getraw(&meat, args.msglen); + args.msg = (gchar *)aimbs_getraw(&meat, args.msglen); if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype))) ret = userfunc(sess, rx, channel, userinfo, &args); @@ -2140,7 +2140,7 @@ static int missedcall(aim_session_t *ses * AIM_TRANSFER_DENY_NOTSUPPORTED -- "client does not support" * AIM_TRANSFER_DENY_DECLINE -- "client has declined transfer" * AIM_TRANSFER_DENY_NOTACCEPTING -- "client is not accepting transfers" - * + * */ faim_export int aim_im_denytransfer(aim_session_t *sess, const char *sender, const fu8_t *cookie, fu16_t code) { @@ -2185,7 +2185,8 @@ static int clientautoresp(aim_session_t aim_rxcallback_t userfunc; fu16_t channel, reason; char *sn; - fu8_t *ck, snlen; + guchar *ck; + guint8 snlen; ck = aimbs_getraw(bs, 8); channel = aimbs_get16(bs); Index: locate.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/oscar/locate.c,v retrieving revision 1.35 retrieving revision 1.36 diff -u -d -p -r1.35 -r1.36 --- locate.c 23 Jun 2005 02:24:22 -0000 1.35 +++ locate.c 26 Jul 2005 04:34:36 -0000 1.36 @@ -963,21 +963,21 @@ static int rights(aim_session_t *sess, a * profile_encoding and awaymsg_encoding MUST be set if profile or * away are set, respectively, and their value may or may not be * restricted to a few choices. I am currently aware of: - * + * * us-ascii Just that * unicode-2-0 UCS2-BE - * + * * profile_len and awaymsg_len MUST be set similarly, and they MUST * be the length of their respective strings in bytes. * * To get the previous behavior of awaymsg == "" un-setting the away * message, set awaymsg non-NULL and awaymsg_len to 0 (this is the * obvious equivalent). - * + * */ faim_export int aim_locate_setprofile(aim_session_t *sess, - const char *profile_encoding, const fu8_t *profile, const int profile_len, - const char *awaymsg_encoding, const fu8_t *awaymsg, const int awaymsg_len) + const char *profile_encoding, const gchar *profile, const int profile_len, + const char *awaymsg_encoding, const gchar *awaymsg, const int awaymsg_len) { aim_conn_t *conn; aim_frame_t *fr; @@ -1005,7 +1005,7 @@ faim_export int aim_locate_setprofile(ai } snprintf(encoding, strlen(defencoding) + strlen(profile_encoding), defencoding, profile_encoding); aim_tlvlist_add_str(&tl, 0x0001, encoding); - aim_tlvlist_add_raw(&tl, 0x0002, profile_len, profile); + aim_tlvlist_add_raw(&tl, 0x0002, profile_len, (const guchar *)profile); free(encoding); } @@ -1025,7 +1025,7 @@ faim_export int aim_locate_setprofile(ai } snprintf(encoding, strlen(defencoding) + strlen(awaymsg_encoding), defencoding, awaymsg_encoding); aim_tlvlist_add_str(&tl, 0x0003, encoding); - aim_tlvlist_add_raw(&tl, 0x0004, awaymsg_len, awaymsg); + aim_tlvlist_add_raw(&tl, 0x0004, awaymsg_len, (const guchar *)awaymsg); free(encoding); } else aim_tlvlist_add_noval(&tl, 0x0004); Index: oscar.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/oscar/oscar.c,v retrieving revision 1.761 retrieving revision 1.762 diff -u -d -p -r1.761 -r1.762 --- oscar.c 24 Jul 2005 20:41:53 -0000 1.761 +++ oscar.c 26 Jul 2005 04:34:36 -0000 1.762 @@ -297,7 +297,7 @@ static int oscar_sendfile_done (aim_se static gboolean gaim_icon_timerfunc(gpointer data); static void oscar_callback(gpointer data, gint source, GaimInputCondition condition); -static void oscar_direct_im_initiate(GaimConnection *gc, const char *who, const char *cookie); +static void oscar_direct_im_initiate(GaimConnection *gc, const char *who, const guchar *cookie); static void oscar_set_info(GaimConnection *gc, const char *text); static void recent_buddies_cb(const char *name, GaimPrefType type, gpointer value, gpointer data); static void oscar_xfer_init_recv(GaimXfer *xfer); @@ -415,7 +415,7 @@ oscar_encoding_to_utf8(const char *encod } static gchar * -gaim_plugin_oscar_convert_to_utf8(const fu8_t *data, fu16_t datalen, const char *charsetstr, gboolean fallback) +gaim_plugin_oscar_convert_to_utf8(const gchar *data, gsize datalen, const char *charsetstr, gboolean fallback) { gchar *ret = NULL; GError *err = NULL; @@ -454,7 +454,7 @@ gaim_plugin_oscar_convert_to_utf8(const * charsetstr1 is always set to what the correct encoding should be. */ static gchar * -gaim_plugin_oscar_decode_im_part(GaimAccount *account, const char *sourcesn, fu16_t charset, fu16_t charsubset, fu8_t *data, fu16_t datalen) +gaim_plugin_oscar_decode_im_part(GaimAccount *account, const char *sourcesn, fu16_t charset, fu16_t charsubset, const gchar *data, gsize datalen) { gchar *ret = NULL; const gchar *charsetstr1, *charsetstr2; @@ -1009,9 +1009,9 @@ static void oscar_odc_callback(gpointer oscar_direct_im_disconnect(od, dim); return; } else { - fu8_t cookie[8]; + guchar cookie[8]; char *who = g_strdup(dim->name); - const char *tmp = aim_odc_getcookie(dim->conn); + const guchar *tmp = aim_odc_getcookie(dim->conn); memcpy(cookie, tmp, 8); oscar_direct_im_destroy(od, dim); @@ -1038,9 +1038,9 @@ static void oscar_odc_callback(gpointer oscar_direct_im_disconnect(od, dim); return; } else { - fu8_t cookie[8]; + guchar cookie[8]; char *who = g_strdup(dim->name); - const char *tmp = aim_odc_getcookie(dim->conn); + const guchar *tmp = aim_odc_getcookie(dim->conn); memcpy(cookie, tmp, 8); oscar_direct_im_destroy(od, dim); @@ -1498,7 +1498,7 @@ static void oscar_cancel_direct_im(struc * * note that cookie is an 8 byte string that isn't NULL terminated */ -static void oscar_direct_im_initiate(GaimConnection *gc, const char *who, const char *cookie) { +static void oscar_direct_im_initiate(GaimConnection *gc, const char *who, const guchar *cookie) { OscarData *od; struct oscar_direct_im *dim; int listenfd; @@ -2141,7 +2141,7 @@ static void oscar_xfer_cancel_recv(GaimX od->file_transfers = g_slist_remove(od->file_transfers, xfer); } -static void oscar_xfer_ack_recv(GaimXfer *xfer, const char *buffer, size_t size) +static void oscar_xfer_ack_recv(GaimXfer *xfer, const guchar *buffer, size_t size) { struct aim_oft_info *oft_info = xfer->data; @@ -2211,7 +2211,7 @@ static void oscar_xfer_cancel_send(GaimX od->file_transfers = g_slist_remove(od->file_transfers, xfer); } -static void oscar_xfer_ack_send(GaimXfer *xfer, const char *buffer, size_t size) +static void oscar_xfer_ack_send(GaimXfer *xfer, const guchar *buffer, size_t size) { struct aim_oft_info *oft_info = xfer->data; @@ -3188,7 +3188,7 @@ static int gaim_parse_oncoming(aim_sessi } static void gaim_check_comment(OscarData *od, const char *str) { - if ((str == NULL) || strcmp(str, ck)) + if ((str == NULL) || strcmp(str, (const char *)ck)) aim_locate_setcaps(od->sess, caps_aim); else aim_locate_setcaps(od->sess, caps_aim | AIM_CAPS_SECUREIM); @@ -3443,7 +3443,7 @@ static int incomingim_chan1(aim_session_ struct stat st; if (!g_stat(iconfile, &st)) { - char *buf = g_malloc(st.st_size); + guchar *buf = g_malloc(st.st_size); file = g_fopen(iconfile, "rb"); if (file) { /* XXX - Use g_file_get_contents() */ @@ -3467,8 +3467,8 @@ static int incomingim_chan1(aim_session_ message = g_string_new(""); curpart = args->mpmsg.parts; while (curpart != NULL) { - tmp = gaim_plugin_oscar_decode_im_part(account, userinfo->sn, curpart->charset, curpart->charsubset, - curpart->data, curpart->datalen); + tmp = gaim_plugin_oscar_decode_im_part(account, userinfo->sn, curpart->charset, + curpart->charsubset, curpart->data, curpart->datalen); if (tmp != NULL) { g_string_append(message, tmp); g_free(tmp); @@ -4162,7 +4162,7 @@ static int gaim_parse_misses(aim_session return 1; } -static int gaim_parse_clientauto_ch2(aim_session_t *sess, const char *who, fu16_t reason, const char *cookie) { +static int gaim_parse_clientauto_ch2(aim_session_t *sess, const char *who, fu16_t reason, const guchar *cookie) { GaimConnection *gc = sess->aux_data; OscarData *od = gc->proto_data; @@ -4237,7 +4237,7 @@ static int gaim_parse_clientauto(aim_ses reason = (fu16_t)va_arg(ap, unsigned int); if (chan == 0x0002) { /* File transfer declined */ - char *cookie = va_arg(ap, char *); + guchar *cookie = va_arg(ap, guchar *); return gaim_parse_clientauto_ch2(sess, who, reason, cookie); } else if (chan == 0x0004) { /* ICQ message */ fu32_t state = 0; @@ -4799,7 +4799,7 @@ static gboolean gaim_icon_timerfunc(gpoi if (iconfile == NULL) { aim_ssi_delicon(od->sess); } else if (!g_stat(iconfile, &st)) { - char *buf = g_malloc(st.st_size); + guchar *buf = g_malloc(st.st_size); FILE *file = g_fopen(iconfile, "rb"); if (file) { /* XXX - Use g_file_get_contents()? */ @@ -5645,7 +5645,7 @@ static int oscar_send_im(GaimConnection if (iconfile && !g_stat(iconfile, &st)) { FILE *file = g_fopen(iconfile, "rb"); if (file) { - char *buf = g_malloc(st.st_size); + guchar *buf = g_malloc(st.st_size); /* XXX - Use g_file_get_contents()? */ fread(buf, 1, st.st_size, file); fclose(file); @@ -6872,7 +6872,7 @@ static int oscar_icon_req(aim_session_t va_list ap; fu16_t type; fu8_t flags = 0, length = 0; - char *md5 = NULL; + guchar *md5 = NULL; va_start(ap, fr); @@ -6883,7 +6883,7 @@ static int oscar_icon_req(aim_session_t case 0x0001: { flags = va_arg(ap, int); length = va_arg(ap, int); - md5 = va_arg(ap, char *); + md5 = va_arg(ap, guchar *); if (flags == 0x41) { if (!aim_getconn_type(od->sess, AIM_CONN_TYPE_ICON) && !od->iconconnecting) { @@ -6896,7 +6896,7 @@ static int oscar_icon_req(aim_session_t if (iconfile == NULL) { aim_ssi_delicon(od->sess); } else if (!g_stat(iconfile, &st)) { - char *buf = g_malloc(st.st_size); + guchar *buf = g_malloc(st.st_size); FILE *file = g_fopen(iconfile, "rb"); if (file) { /* XXX - Use g_file_get_contents()? */ @@ -7427,11 +7427,11 @@ static void oscar_set_icon(GaimConnectio if (iconfile == NULL) { aim_ssi_delicon(od->sess); } else if (!g_stat(iconfile, &st)) { - char *buf = g_malloc(st.st_size); + guchar *buf = g_malloc(st.st_size); file = g_fopen(iconfile, "rb"); if (file) { md5_state_t *state; - char md5[16]; + guchar md5[16]; /* XXX - Use g_file_get_contents()? */ int len = fread(buf, 1, st.st_size, file); fclose(file); Index: service.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/oscar/service.c,v retrieving revision 1.31 retrieving revision 1.32 diff -u -d -p -r1.31 -r1.32 --- service.c 9 Jun 2005 04:33:52 -0000 1.31 +++ service.c 26 Jul 2005 04:34:37 -0000 1.32 @@ -161,7 +161,7 @@ static int redirect(aim_session_t *sess, redir.group = aim_tlv_get16(tlvlist, 0x000d, 1); redir.ip = aim_tlv_getstr(tlvlist, 0x0005, 1); redir.cookielen = aim_tlv_gettlv(tlvlist, 0x0006, 1)->length; - redir.cookie = aim_tlv_getstr(tlvlist, 0x0006, 1); + redir.cookie = (guchar *)aim_tlv_getstr(tlvlist, 0x0006, 1); /* Fetch original SNAC so we can get csi if needed */ origsnac = aim_remsnac(sess, snac->id); Index: tlv.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/oscar/tlv.c,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -p -r1.27 -r1.28 --- tlv.c 9 Jun 2005 04:47:18 -0000 1.27 +++ tlv.c 26 Jul 2005 04:34:37 -0000 1.28 @@ -92,7 +92,7 @@ faim_internal aim_tlvlist_t *aim_tlvlist return NULL; } if (cur->tlv->length > 0) { - cur->tlv->value = aimbs_getraw(bs, length); + cur->tlv->value = aimbs_getraw(bs, length); if (!cur->tlv->value) { freetlv(&cur->tlv); free(cur); @@ -646,8 +646,8 @@ faim_internal int aim_tlvlist_replace_ra } /** - * Substitute a TLV of a given type with a new TLV of the same type. If - * you attempt to replace a TLV that does not exist, this function will + * Substitute a TLV of a given type with a new TLV of the same type. If + * you attempt to replace a TLV that does not exist, this function will * just add a new TLV as if you called aim_tlvlist_add_str(). * * @param list Desination chain (%NULL pointer if empty). @@ -657,12 +657,12 @@ faim_internal int aim_tlvlist_replace_ra */ faim_internal int aim_tlvlist_replace_str(aim_tlvlist_t **list, const fu16_t type, const char *str) { - return aim_tlvlist_replace_raw(list, type, strlen(str), str); + return aim_tlvlist_replace_raw(list, type, strlen(str), (const guchar *)str); } /** - * Substitute a TLV of a given type with a new TLV of the same type. If - * you attempt to replace a TLV that does not exist, this function will + * Substitute a TLV of a given type with a new TLV of the same type. If + * you attempt to replace a TLV that does not exist, this function will * just add a new TLV as if you called aim_tlvlist_add_raw(). * * @param list Desination chain (%NULL pointer if empty). @@ -675,8 +675,8 @@ faim_internal int aim_tlvlist_replace_no } /** - * Substitute a TLV of a given type with a new TLV of the same type. If - * you attempt to replace a TLV that does not exist, this function will + * Substitute a TLV of a given type with a new TLV of the same type. If + * you attempt to replace a TLV that does not exist, this function will * just add a new TLV as if you called aim_tlvlist_add_raw(). * * @param list Desination chain (%NULL pointer if empty). @@ -844,8 +844,8 @@ faim_internal int aim_tlv_getlength(aim_ * @param list Source TLV chain. * @param type TLV type to search for. * @param nth Index of TLV to return. - * @return The value of the TLV you were looking for, or NULL if one could - * not be found. This is a dynamic buffer and must be freed by the + * @return The value of the TLV you were looking for, or NULL if one could + * not be found. This is a dynamic buffer and must be freed by the * caller. */ faim_internal char *aim_tlv_getstr(aim_tlvlist_t *list, const fu16_t type, const int nth) |