summaryrefslogtreecommitdiff
path: root/libpurple/protocols
diff options
context:
space:
mode:
Diffstat (limited to 'libpurple/protocols')
-rw-r--r--libpurple/protocols/gg/account.h2
-rw-r--r--libpurple/protocols/gg/libgadu-events.c4
-rw-r--r--libpurple/protocols/gg/pubdir-prpl.c5
-rw-r--r--libpurple/protocols/gg/utils.c4
-rw-r--r--libpurple/protocols/gg/utils.h2
-rw-r--r--libpurple/protocols/irc/parse.c2
-rw-r--r--libpurple/protocols/jabber/auth_scram.c2
-rw-r--r--libpurple/protocols/jabber/jabber.c2
-rw-r--r--libpurple/protocols/jabber/jutil.c10
-rw-r--r--libpurple/protocols/jabber/presence.c2
-rw-r--r--libpurple/protocols/jabber/si.c8
-rw-r--r--libpurple/protocols/msn/command.c2
-rw-r--r--libpurple/protocols/msn/command.h2
-rw-r--r--libpurple/protocols/msn/directconn.c6
-rw-r--r--libpurple/protocols/msn/history.c2
-rw-r--r--libpurple/protocols/msn/nexus.c8
-rw-r--r--libpurple/protocols/msn/nexus.h2
-rw-r--r--libpurple/protocols/msn/notification.c4
-rw-r--r--libpurple/protocols/msn/p2p.c4
-rw-r--r--libpurple/protocols/msn/servconn.c7
-rw-r--r--libpurple/protocols/msn/slplink.c4
-rw-r--r--libpurple/protocols/msn/slpmsg.h2
-rw-r--r--libpurple/protocols/msn/slpmsg_part.c2
-rw-r--r--libpurple/protocols/msn/tlv.c2
-rw-r--r--libpurple/protocols/msn/transaction.c2
-rw-r--r--libpurple/protocols/msn/transaction.h2
-rw-r--r--libpurple/protocols/myspace/myspace.c8
-rw-r--r--libpurple/protocols/myspace/persist.h4
-rw-r--r--libpurple/protocols/myspace/user.c6
-rw-r--r--libpurple/protocols/novell/nmrtf.c2
-rw-r--r--libpurple/protocols/oscar/bstream.c7
-rw-r--r--libpurple/protocols/oscar/family_feedbag.c2
-rw-r--r--libpurple/protocols/oscar/oscar.c2
-rw-r--r--libpurple/protocols/oscar/oscar.h8
-rw-r--r--libpurple/protocols/oscar/tlv.c6
-rw-r--r--libpurple/protocols/oscar/util.c2
-rw-r--r--libpurple/protocols/silc/buddy.c2
-rw-r--r--libpurple/protocols/silc/chat.c22
-rw-r--r--libpurple/protocols/silc/ops.c2
-rw-r--r--libpurple/protocols/silc/pk.c2
-rw-r--r--libpurple/protocols/yahoo/libymsg.c4
-rw-r--r--libpurple/protocols/yahoo/libymsg.h2
-rw-r--r--libpurple/protocols/yahoo/util.c4
-rw-r--r--libpurple/protocols/yahoo/yahoo_packet.c4
-rw-r--r--libpurple/protocols/yahoo/yahoo_packet.h2
-rw-r--r--libpurple/protocols/yahoo/ycht.c2
-rw-r--r--libpurple/protocols/zephyr/ZReadAscii.c2
-rw-r--r--libpurple/protocols/zephyr/ZVariables.c2
-rw-r--r--libpurple/protocols/zephyr/Zinternal.c4
-rw-r--r--libpurple/protocols/zephyr/internal.h2
-rw-r--r--libpurple/protocols/zephyr/zephyr.c6
51 files changed, 107 insertions, 96 deletions
diff --git a/libpurple/protocols/gg/account.h b/libpurple/protocols/gg/account.h
index d5fee8d826..4a0bf04521 100644
--- a/libpurple/protocols/gg/account.h
+++ b/libpurple/protocols/gg/account.h
@@ -37,7 +37,7 @@ typedef struct
gchar *id;
gpointer data;
size_t size;
- int length;
+ guint length;
} ggp_account_token;
/**
diff --git a/libpurple/protocols/gg/libgadu-events.c b/libpurple/protocols/gg/libgadu-events.c
index f697f90c05..d29d3c8ef6 100644
--- a/libpurple/protocols/gg/libgadu-events.c
+++ b/libpurple/protocols/gg/libgadu-events.c
@@ -35,7 +35,7 @@
void ggp_events_user_data(PurpleConnection *gc, struct gg_event_user_data *data)
{
- int user_idx;
+ guint user_idx;
gboolean is_update;
purple_debug_info("gg", "GG_EVENT_USER_DATA [type=%d, user_count=%"
@@ -54,7 +54,7 @@ void ggp_events_user_data(PurpleConnection *gc, struct gg_event_user_data *data)
struct gg_event_user_data_user *data_user =
&data->users[user_idx];
uin_t uin = data_user->uin;
- int attr_idx;
+ guint attr_idx;
gboolean got_avatar = FALSE;
for (attr_idx = 0; attr_idx < data_user->attr_count; attr_idx++)
{
diff --git a/libpurple/protocols/gg/pubdir-prpl.c b/libpurple/protocols/gg/pubdir-prpl.c
index 1fe8792556..35ecf4b6a6 100644
--- a/libpurple/protocols/gg/pubdir-prpl.c
+++ b/libpurple/protocols/gg/pubdir-prpl.c
@@ -150,7 +150,7 @@ static const gchar *ggp_pubdir_provinces[] =
"zachodniopomorskie",
};
-static int ggp_pubdir_provinces_count = sizeof(ggp_pubdir_provinces)/sizeof(gchar*);
+static gsize ggp_pubdir_provinces_count = sizeof(ggp_pubdir_provinces)/sizeof(gchar*);
/******************************************************************************/
@@ -812,7 +812,8 @@ static void ggp_pubdir_set_info_dialog(PurpleConnection *gc, int records_count,
PurpleRequestFields *fields;
PurpleRequestFieldGroup *group;
PurpleRequestField *field;
- int default_gender, i;
+ int default_gender;
+ gsize i;
const ggp_pubdir_record *record;
purple_debug_info("gg", "ggp_pubdir_set_info_dialog (record: %d)\n",
diff --git a/libpurple/protocols/gg/utils.c b/libpurple/protocols/gg/utils.c
index 71aefa8b4c..ba3575aee9 100644
--- a/libpurple/protocols/gg/utils.c
+++ b/libpurple/protocols/gg/utils.c
@@ -114,7 +114,7 @@ guint64 ggp_microtime(void)
gchar * ggp_utf8_strndup(const gchar *str, gsize n)
{
- int raw_len = strlen(str);
+ size_t raw_len = strlen(str);
gchar *end_ptr;
if (str == NULL)
return NULL;
@@ -206,7 +206,7 @@ const gchar * ggp_ipv4_to_str(uint32_t raw_ip)
return buff;
}
-GList * ggp_list_truncate(GList *list, gint length, GDestroyNotify free_func)
+GList * ggp_list_truncate(GList *list, guint length, GDestroyNotify free_func)
{
while (g_list_length(list) > length)
{
diff --git a/libpurple/protocols/gg/utils.h b/libpurple/protocols/gg/utils.h
index e6bd466379..80d2d9da51 100644
--- a/libpurple/protocols/gg/utils.h
+++ b/libpurple/protocols/gg/utils.h
@@ -87,7 +87,7 @@ gchar * ggp_strjoin_list(const gchar *separator, GList *list);
const gchar * ggp_ipv4_to_str(uint32_t raw_ip);
-GList * ggp_list_truncate(GList *list, gint length, GDestroyNotify free_func);
+GList * ggp_list_truncate(GList *list, guint length, GDestroyNotify free_func);
gchar * ggp_free_if_equal(gchar *str, const gchar *pattern);
diff --git a/libpurple/protocols/irc/parse.c b/libpurple/protocols/irc/parse.c
index 043fbeec12..5fb5980f24 100644
--- a/libpurple/protocols/irc/parse.c
+++ b/libpurple/protocols/irc/parse.c
@@ -384,7 +384,7 @@ char *irc_mirc2html(const char *string)
do {
end = strpbrk(cur, "\002\003\007\017\026\037");
- decoded = g_string_append_len(decoded, cur, end ? end - cur : strlen(cur));
+ decoded = g_string_append_len(decoded, cur, (end ? (goffset)(end - cur) : strlen(cur)));
cur = end ? end : cur + strlen(cur);
switch (*cur) {
diff --git a/libpurple/protocols/jabber/auth_scram.c b/libpurple/protocols/jabber/auth_scram.c
index 5b4d2fc9c2..5fe6bf9539 100644
--- a/libpurple/protocols/jabber/auth_scram.c
+++ b/libpurple/protocols/jabber/auth_scram.c
@@ -34,7 +34,7 @@ static const JabberScramHash hashes[] = {
static const JabberScramHash *mech_to_hash(const char *mech)
{
- int i;
+ gsize i;
g_return_val_if_fail(mech != NULL && *mech != '\0', NULL);
diff --git a/libpurple/protocols/jabber/jabber.c b/libpurple/protocols/jabber/jabber.c
index cac1466bbd..85ee7984d2 100644
--- a/libpurple/protocols/jabber/jabber.c
+++ b/libpurple/protocols/jabber/jabber.c
@@ -580,7 +580,7 @@ int jabber_prpl_send_raw(PurpleConnection *gc, const char *buf, int len)
*/
jabber_send_raw(js, buf, len);
- return (len < 0 ? strlen(buf) : len);
+ return (len < 0 ? (int)strlen(buf) : len);
}
void jabber_send_signal_cb(PurpleConnection *pc, xmlnode **packet,
diff --git a/libpurple/protocols/jabber/jutil.c b/libpurple/protocols/jabber/jutil.c
index ba3e1c757c..b02e220197 100644
--- a/libpurple/protocols/jabber/jutil.c
+++ b/libpurple/protocols/jabber/jutil.c
@@ -673,7 +673,7 @@ static const struct {
const char *
jabber_buddy_state_get_name(const JabberBuddyState state)
{
- int i;
+ gsize i;
for (i = 0; i < G_N_ELEMENTS(jabber_statuses); ++i)
if (jabber_statuses[i].state == state)
return _(jabber_statuses[i].readable);
@@ -684,7 +684,7 @@ jabber_buddy_state_get_name(const JabberBuddyState state)
JabberBuddyState
jabber_buddy_status_id_get_state(const char *id)
{
- int i;
+ gsize i;
if (!id)
return JABBER_BUDDY_STATE_UNKNOWN;
@@ -697,7 +697,7 @@ jabber_buddy_status_id_get_state(const char *id)
JabberBuddyState jabber_buddy_show_get_state(const char *id)
{
- int i;
+ gsize i;
g_return_val_if_fail(id != NULL, JABBER_BUDDY_STATE_UNKNOWN);
@@ -713,7 +713,7 @@ JabberBuddyState jabber_buddy_show_get_state(const char *id)
const char *
jabber_buddy_state_get_show(JabberBuddyState state)
{
- int i;
+ gsize i;
for (i = 0; i < G_N_ELEMENTS(jabber_statuses); ++i)
if (state == jabber_statuses[i].state)
return jabber_statuses[i].show;
@@ -724,7 +724,7 @@ jabber_buddy_state_get_show(JabberBuddyState state)
const char *
jabber_buddy_state_get_status_id(JabberBuddyState state)
{
- int i;
+ gsize i;
for (i = 0; i < G_N_ELEMENTS(jabber_statuses); ++i)
if (state == jabber_statuses[i].state)
return jabber_statuses[i].status_id;
diff --git a/libpurple/protocols/jabber/presence.c b/libpurple/protocols/jabber/presence.c
index 23cd3adef3..4421514a5b 100644
--- a/libpurple/protocols/jabber/presence.c
+++ b/libpurple/protocols/jabber/presence.c
@@ -63,7 +63,7 @@ static const struct {
static JabberPresenceType
str_to_presence_type(const char *type)
{
- int i;
+ gsize i;
if (type == NULL)
return JABBER_PRESENCE_AVAILABLE;
diff --git a/libpurple/protocols/jabber/si.c b/libpurple/protocols/jabber/si.c
index a01209955f..f36b28f060 100644
--- a/libpurple/protocols/jabber/si.c
+++ b/libpurple/protocols/jabber/si.c
@@ -449,7 +449,7 @@ jabber_si_xfer_bytestreams_send_read_again_cb(gpointer data, gint source,
close(source);
purple_xfer_cancel_remote(xfer);
return;
- } else if(jsx->rxlen - 5 < jsx->rxqueue[4] + 2) {
+ } else if(jsx->rxlen - 5 < (size_t)jsx->rxqueue[4] + 2) {
/* Upper-bound of 257 (jsx->rxlen = 5, jsx->rxqueue[4] = 0xFF) */
unsigned short to_read = jsx->rxqueue[4] + 2 - (jsx->rxlen - 5);
purple_debug_info("jabber", "reading %u bytes for DST.ADDR + port num (trying to read %hu now)\n",
@@ -468,7 +468,7 @@ jabber_si_xfer_bytestreams_send_read_again_cb(gpointer data, gint source,
}
/* Have we not read all of DST.ADDR and the following 2-byte port number? */
- if(jsx->rxlen - 5 < jsx->rxqueue[4] + 2)
+ if(jsx->rxlen - 5 < (size_t)jsx->rxqueue[4] + 2)
return;
purple_input_remove(purple_xfer_get_watcher(xfer));
@@ -588,7 +588,7 @@ jabber_si_xfer_bytestreams_send_read_cb(gpointer data, gint source,
memcpy(jsx->rxqueue + jsx->rxlen, buffer, len);
jsx->rxlen += len;
return;
- } else if(jsx->rxlen - 2 < jsx->rxqueue[1]) {
+ } else if(jsx->rxlen - 2 < (size_t)jsx->rxqueue[1]) {
/* Has a maximum value of 255 (jsx->rxlen = 2, jsx->rxqueue[1] = 0xFF) */
unsigned short to_read = jsx->rxqueue[1] - (jsx->rxlen - 2);
purple_debug_info("jabber", "reading %u bytes for auth methods (trying to read %hu now)\n",
@@ -606,7 +606,7 @@ jabber_si_xfer_bytestreams_send_read_cb(gpointer data, gint source,
}
/* Have we not read all the auth. method bytes? */
- if(jsx->rxlen -2 < jsx->rxqueue[1])
+ if(jsx->rxlen -2 < (size_t)jsx->rxqueue[1])
return;
purple_debug_info("jabber", "checking to make sure we're socks FIVE\n");
diff --git a/libpurple/protocols/msn/command.c b/libpurple/protocols/msn/command.c
index 36f7c3005f..0be77b4630 100644
--- a/libpurple/protocols/msn/command.c
+++ b/libpurple/protocols/msn/command.c
@@ -57,7 +57,7 @@ msn_command_from_string(const char *string)
if (cmd->params != NULL)
{
- int c;
+ guint c;
for (c = 0; cmd->params[c] && cmd->params[c][0]; c++);
cmd->param_count = c;
diff --git a/libpurple/protocols/msn/command.h b/libpurple/protocols/msn/command.h
index 481a807883..d5d2d3a75d 100644
--- a/libpurple/protocols/msn/command.h
+++ b/libpurple/protocols/msn/command.h
@@ -41,7 +41,7 @@ struct _MsnCommand
char *command;
char **params;
- int param_count;
+ guint param_count;
guint ref_count;
diff --git a/libpurple/protocols/msn/directconn.c b/libpurple/protocols/msn/directconn.c
index 2da4178fff..f68e973f06 100644
--- a/libpurple/protocols/msn/directconn.c
+++ b/libpurple/protocols/msn/directconn.c
@@ -406,7 +406,7 @@ msn_dc_send_cb(gpointer data, gint fd, PurpleInputCondition cond)
dc->progress = TRUE;
dc->msg_pos += bytes_sent;
- if (dc->msg_pos == p->length) {
+ if ((guint32)dc->msg_pos == p->length) {
if (p->sent_cb != NULL)
p->sent_cb(p);
@@ -671,7 +671,7 @@ msn_dc_recv_cb(gpointer data, gint fd, PurpleInputCondition cond)
}
/* Wait for the whole packet to arrive */
- if (dc->in_pos < 4 + packet_length)
+ if ((guint32)dc->in_pos < 4 + packet_length)
return;
switch (msn_dc_process_packet(dc, packet_length)) {
@@ -685,7 +685,7 @@ msn_dc_recv_cb(gpointer data, gint fd, PurpleInputCondition cond)
}
- if (dc->in_pos > packet_length + 4) {
+ if ((guint32)dc->in_pos > packet_length + 4) {
g_memmove(dc->in_buffer, dc->in_buffer + 4 + packet_length, dc->in_pos - packet_length - 4);
}
diff --git a/libpurple/protocols/msn/history.c b/libpurple/protocols/msn/history.c
index 82488ce102..2b23af5ba1 100644
--- a/libpurple/protocols/msn/history.c
+++ b/libpurple/protocols/msn/history.c
@@ -68,7 +68,7 @@ void
msn_history_add(MsnHistory *history, MsnTransaction *trans)
{
GQueue *queue;
- int max_elems;
+ gsize max_elems;
g_return_if_fail(history != NULL);
g_return_if_fail(trans != NULL);
diff --git a/libpurple/protocols/msn/nexus.c b/libpurple/protocols/msn/nexus.c
index 5a8aafc43d..576fbf6c14 100644
--- a/libpurple/protocols/msn/nexus.c
+++ b/libpurple/protocols/msn/nexus.c
@@ -56,7 +56,7 @@ MsnNexus *
msn_nexus_new(MsnSession *session)
{
MsnNexus *nexus;
- int i;
+ gsize i;
nexus = g_new0(MsnNexus, 1);
nexus->session = session;
@@ -74,7 +74,7 @@ msn_nexus_new(MsnSession *session)
void
msn_nexus_destroy(MsnNexus *nexus)
{
- int i;
+ gsize i;
for (i = 0; i < nexus->token_len; i++) {
g_hash_table_destroy(nexus->tokens[i].token);
g_free(nexus->tokens[i].secret);
@@ -262,7 +262,7 @@ nexus_parse_token(MsnNexus *nexus, int id, xmlnode *node)
return FALSE;
id = atol(id_str + 7) - 1; /* 'Compact#' or 'PPToken#' */
- if (id >= nexus->token_len)
+ if (id < 0 || (gsize)id >= nexus->token_len)
return FALSE; /* Where did this come from? */
}
@@ -374,7 +374,7 @@ msn_nexus_connect(MsnNexus *nexus)
char *password_xml;
GString *domains;
char *request;
- int i;
+ gsize i;
purple_debug_info("msn", "Starting Windows Live ID authentication\n");
msn_session_set_login_step(session, MSN_LOGIN_STEP_GET_COOKIE);
diff --git a/libpurple/protocols/msn/nexus.h b/libpurple/protocols/msn/nexus.h
index d824b8f624..f6150780e9 100644
--- a/libpurple/protocols/msn/nexus.h
+++ b/libpurple/protocols/msn/nexus.h
@@ -206,7 +206,7 @@ struct _MsnNexus
char *cipher;
char *secret;
MsnTicketToken *tokens;
- int token_len;
+ gsize token_len;
};
void msn_nexus_connect(MsnNexus *nexus);
diff --git a/libpurple/protocols/msn/notification.c b/libpurple/protocols/msn/notification.c
index 20e9f83d4a..969e6af088 100644
--- a/libpurple/protocols/msn/notification.c
+++ b/libpurple/protocols/msn/notification.c
@@ -240,7 +240,7 @@ ver_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
MsnTransaction *trans;
PurpleAccount *account;
gboolean protocol_supported = FALSE;
- int proto_ver;
+ guint proto_ver;
size_t i;
session = cmdproc->session;
@@ -249,7 +249,7 @@ ver_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
session->protocol_ver = 0;
for (i = 1; i < cmd->param_count; i++)
{
- if (sscanf(cmd->params[i], "MSNP%d", &proto_ver) == 1) {
+ if (sscanf(cmd->params[i], "MSNP%u", &proto_ver) == 1) {
if (proto_ver >= WLM_MIN_PROTOCOL
&& proto_ver <= WLM_MAX_PROTOCOL
&& proto_ver > session->protocol_ver) {
diff --git a/libpurple/protocols/msn/p2p.c b/libpurple/protocols/msn/p2p.c
index 9b028e27bd..4d6649181e 100644
--- a/libpurple/protocols/msn/p2p.c
+++ b/libpurple/protocols/msn/p2p.c
@@ -133,7 +133,9 @@ msn_p2p_header_from_wire(MsnP2PInfo *info, const char *wire, size_t max_len)
header->opcode = msn_pop8(wire);
header->message_len = msn_pop16be(wire);
header->base_id = msn_pop32be(wire);
- if (header->header_len + header->message_len + P2P_PACKET_FOOTER_SIZE > max_len) {
+ if ((gsize)header->header_len + header->message_len +
+ P2P_PACKET_FOOTER_SIZE > max_len)
+ {
/* Invalid header and data length */
len = 0;
break;
diff --git a/libpurple/protocols/msn/servconn.c b/libpurple/protocols/msn/servconn.c
index 3fd625ba6c..8a2eb3e463 100644
--- a/libpurple/protocols/msn/servconn.c
+++ b/libpurple/protocols/msn/servconn.c
@@ -386,7 +386,7 @@ msn_servconn_write(MsnServConn *servconn, const char *buf, size_t len)
if (ret < 0 && errno == EAGAIN)
ret = 0;
- if (ret >= 0 && ret < len) {
+ if (ret >= 0 && (size_t)ret < len) {
if (servconn->tx_handler == 0)
servconn->tx_handler = purple_input_add(
servconn->fd, PURPLE_INPUT_WRITE,
@@ -461,9 +461,12 @@ MsnServConn *msn_servconn_process_data(MsnServConn *servconn)
if (servconn->payload_len)
{
- if (servconn->payload_len > servconn->rx_len)
+ if (servconn->rx_len < 0 || servconn->payload_len >
+ (gsize)servconn->rx_len)
+ {
/* The payload is still not complete. */
break;
+ }
cur_len = servconn->payload_len;
end += cur_len;
diff --git a/libpurple/protocols/msn/slplink.c b/libpurple/protocols/msn/slplink.c
index d01a6989ec..436bb0d5e1 100644
--- a/libpurple/protocols/msn/slplink.c
+++ b/libpurple/protocols/msn/slplink.c
@@ -289,7 +289,7 @@ msn_slplink_send_msgpart(MsnSlpLink *slplink, MsnSlpMessage *slpmsg)
{
MsnSlpMessagePart *part;
MsnP2PInfo *info;
- long long real_size;
+ gsize real_size;
size_t len = 0;
guint64 offset;
@@ -422,7 +422,7 @@ msn_slplink_send_ack(MsnSlpLink *slplink, MsnP2PInfo *info)
}
static MsnSlpMessage *
-msn_slplink_message_find(MsnSlpLink *slplink, long session_id, long id)
+msn_slplink_message_find(MsnSlpLink *slplink, guint32 session_id, long id)
{
GList *e;
diff --git a/libpurple/protocols/msn/slpmsg.h b/libpurple/protocols/msn/slpmsg.h
index fb045e7c3a..4fa3b85bc7 100644
--- a/libpurple/protocols/msn/slpmsg.h
+++ b/libpurple/protocols/msn/slpmsg.h
@@ -57,7 +57,7 @@ struct _MsnSlpMessage
* This is the size of buffer, unless this is an outgoing file transfer,
* in which case this is the size of the file.
*/
- long long size;
+ gsize size;
GList *parts; /**< A list with the SlpMsgParts */
diff --git a/libpurple/protocols/msn/slpmsg_part.c b/libpurple/protocols/msn/slpmsg_part.c
index dfff1f5c24..add959a73a 100644
--- a/libpurple/protocols/msn/slpmsg_part.c
+++ b/libpurple/protocols/msn/slpmsg_part.c
@@ -172,7 +172,7 @@ msn_slpmsgpart_ack(MsnSlpMessagePart *part, void *data)
{
MsnSlpMessage *slpmsg;
guint64 offset;
- long long real_size;
+ gsize real_size;
slpmsg = data;
diff --git a/libpurple/protocols/msn/tlv.c b/libpurple/protocols/msn/tlv.c
index 48400f35ac..ed505305ed 100644
--- a/libpurple/protocols/msn/tlv.c
+++ b/libpurple/protocols/msn/tlv.c
@@ -339,7 +339,7 @@ msn_tlvlist_write(GSList *list, size_t *out_len)
for (; list; list = g_slist_next(list)) {
msn_tlv_t *tlv = (msn_tlv_t *)list->data;
- if (G_UNLIKELY(tlv->length + 2 > bytes_left)) {
+ if (G_UNLIKELY((gsize)tlv->length + 2 > bytes_left)) {
buf = g_realloc(buf, total_len + 256);
bytes_left += 256;
total_len += 256;
diff --git a/libpurple/protocols/msn/transaction.c b/libpurple/protocols/msn/transaction.c
index e77b13553b..57f3464553 100644
--- a/libpurple/protocols/msn/transaction.c
+++ b/libpurple/protocols/msn/transaction.c
@@ -158,7 +158,7 @@ msn_transaction_unqueue(MsnTransaction *trans, MsnCmdProc *cmdproc)
void
msn_transaction_set_payload(MsnTransaction *trans,
- const char *payload, int payload_len)
+ const char *payload, gsize payload_len)
{
g_return_if_fail(trans != NULL);
g_return_if_fail(payload != NULL);
diff --git a/libpurple/protocols/msn/transaction.h b/libpurple/protocols/msn/transaction.h
index 7d4764145e..10fe8fc0c3 100644
--- a/libpurple/protocols/msn/transaction.h
+++ b/libpurple/protocols/msn/transaction.h
@@ -75,7 +75,7 @@ char *msn_transaction_to_string(MsnTransaction *trans);
void msn_transaction_queue_cmd(MsnTransaction *trans, MsnCommand *cmd);
void msn_transaction_unqueue_cmd(MsnTransaction *trans, MsnCmdProc *cmdproc);
void msn_transaction_set_payload(MsnTransaction *trans,
- const char *payload, int payload_len);
+ const char *payload, gsize payload_len);
void msn_transaction_set_data(MsnTransaction *trans, void *data);
void msn_transaction_set_data_free(MsnTransaction *trans, GDestroyNotify fn);
void msn_transaction_set_saveable(MsnTransaction *trans, gboolean saveable);
diff --git a/libpurple/protocols/myspace/myspace.c b/libpurple/protocols/myspace/myspace.c
index f4c82a898d..8ac44c247a 100644
--- a/libpurple/protocols/myspace/myspace.c
+++ b/libpurple/protocols/myspace/myspace.c
@@ -1035,7 +1035,7 @@ msim_add_contact_from_server_cb(MsimSession *session, const MsimMessage *user_lo
/* TODO: use 'Position' in contact_info to take into account where buddy is */
purple_blist_add_buddy(buddy, NULL, group, NULL /* insertion point */);
- if (strtol(username, NULL, 10) == uid) {
+ if (strtoul(username, NULL, 10) == uid) {
/*
* This user has not set their username! Set their server
* alias to their display name so that we don't see a bunch
@@ -2979,13 +2979,15 @@ gboolean
msim_send_raw(MsimSession *session, const gchar *msg)
{
size_t len;
+ int sent;
g_return_val_if_fail(msg != NULL, FALSE);
purple_debug_info("msim", "msim_send_raw: writing <%s>\n", msg);
len = strlen(msg);
- return msim_send_really_raw(session->gc, msg, len) == len;
+ sent = msim_send_really_raw(session->gc, msg, len);
+ return sent > 0 && (size_t)sent == len;
}
static GHashTable *
@@ -3470,7 +3472,7 @@ msim_uri_handler(const gchar *proto, const gchar *cmd, GHashTable *params)
l = purple_accounts_get_all();
while (l) {
if (purple_account_is_connected(l->data) &&
- (uid == 0 || purple_account_get_int(l->data, "uid", 0) == uid)) {
+ (uid == 0 || (guint)purple_account_get_int(l->data, "uid", 0) == uid)) {
account = l->data;
break;
}
diff --git a/libpurple/protocols/myspace/persist.h b/libpurple/protocols/myspace/persist.h
index 09712c9143..1f59685f7f 100644
--- a/libpurple/protocols/myspace/persist.h
+++ b/libpurple/protocols/myspace/persist.h
@@ -42,8 +42,8 @@
/** Define a set of _DSN and _LID constants for a persistance request. */
#define MSIM_PERSIST_DSN_LID(name,dsn,lid) \
- static const int name##_DSN = dsn; \
- static const int name##_LID = lid;
+ static const guint name##_DSN = dsn; \
+ static const guint name##_LID = lid;
/* Can't do this, errors:
* persist.h:51:3: error: '#' is not followed by a macro parameter
diff --git a/libpurple/protocols/myspace/user.c b/libpurple/protocols/myspace/user.c
index 37acd895df..a0775a1af1 100644
--- a/libpurple/protocols/myspace/user.c
+++ b/libpurple/protocols/myspace/user.c
@@ -628,8 +628,8 @@ static void msim_username_is_set_cb(MsimSession *session, const MsimMessage *use
const gchar *errmsg;
MsimMessage *body;
- guint rid;
- gint cmd,dsn,lid,code;
+ guint rid, dsn, lid;
+ gint cmd, code;
/* \persistr\\cmd\258\dsn\9\uid\204084363\lid\14\rid\369\body\UserName=TheAlbinoRhino1.Code=0\final\ */
purple_debug_info("msim","username_is_set made\n");
@@ -656,7 +656,7 @@ static void msim_username_is_set_cb(MsimSession *session, const MsimMessage *use
msim_msg_free(body);
purple_debug_info("msim_username_is_set_cb",
- "cmd = %d, dsn = %d, lid = %d, code = %d, username = %s\n",
+ "cmd = %d, dsn = %u, lid = %u, code = %d, username = %s\n",
cmd, dsn, lid, code, username);
if (cmd == (MSIM_CMD_BIT_REPLY | MSIM_CMD_PUT)
diff --git a/libpurple/protocols/novell/nmrtf.c b/libpurple/protocols/novell/nmrtf.c
index f7d858bf97..0a0caf48b3 100644
--- a/libpurple/protocols/novell/nmrtf.c
+++ b/libpurple/protocols/novell/nmrtf.c
@@ -507,7 +507,7 @@ rtf_parse_keyword(NMRtfContext *ctx)
int param = 0;
char keyword[30];
char parameter[20];
- int i;
+ gsize i;
keyword[0] = '\0';
parameter[0] = '\0';
diff --git a/libpurple/protocols/oscar/bstream.c b/libpurple/protocols/oscar/bstream.c
index 31acac2724..7023fe7cd2 100644
--- a/libpurple/protocols/oscar/bstream.c
+++ b/libpurple/protocols/oscar/bstream.c
@@ -49,8 +49,11 @@ void byte_stream_destroy(ByteStream *bs)
g_free(bs->data);
}
-int byte_stream_bytes_left(ByteStream *bs)
+size_t byte_stream_bytes_left(ByteStream *bs)
{
+ g_return_val_if_fail(bs != NULL, 0);
+ g_return_val_if_fail(bs->len < bs->offset, 0);
+
return bs->len - bs->offset;
}
@@ -79,7 +82,7 @@ void byte_stream_rewind(ByteStream *bs)
int byte_stream_advance(ByteStream *bs, int n)
{
g_return_val_if_fail(byte_stream_curpos(bs) + n >= 0, 0);
- g_return_val_if_fail(n <= byte_stream_bytes_left(bs), 0);
+ g_return_val_if_fail((gsize)n <= byte_stream_bytes_left(bs), 0);
bs->offset += n;
return n;
diff --git a/libpurple/protocols/oscar/family_feedbag.c b/libpurple/protocols/oscar/family_feedbag.c
index 4332c9c43c..e0786e50fa 100644
--- a/libpurple/protocols/oscar/family_feedbag.c
+++ b/libpurple/protocols/oscar/family_feedbag.c
@@ -107,7 +107,7 @@ aim_ssi_type_to_string(guint16 type)
{ 0x0020, "ICQ-MDir" },
{ 0x0029, "Facebook" },
};
- int i;
+ size_t i;
for (i = 0; i < G_N_ELEMENTS(type_strings); i++) {
if (type_strings[i].type == type) {
return type_strings[i].string;
diff --git a/libpurple/protocols/oscar/oscar.c b/libpurple/protocols/oscar/oscar.c
index f80e975f66..9a8ecda387 100644
--- a/libpurple/protocols/oscar/oscar.c
+++ b/libpurple/protocols/oscar/oscar.c
@@ -893,7 +893,7 @@ purple_parse_auth_resp(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...)
PurpleConnection *gc = od->gc;
PurpleAccount *account = purple_connection_get_account(gc);
char *host; int port;
- int i;
+ gsize i;
FlapConnection *newconn;
va_list ap;
struct aim_authresp_info *info;
diff --git a/libpurple/protocols/oscar/oscar.h b/libpurple/protocols/oscar/oscar.h
index 9ca180b747..7da1d44b16 100644
--- a/libpurple/protocols/oscar/oscar.h
+++ b/libpurple/protocols/oscar/oscar.h
@@ -603,8 +603,8 @@ struct chat_connection
int id;
PurpleConnection *gc;
PurpleConversation *conv;
- int maxlen;
- int maxvis;
+ guint16 maxlen;
+ guint16 maxvis;
};
/*
@@ -1073,7 +1073,7 @@ GSList *aim_tlvlist_readlen(ByteStream *bs, guint16 len);
GSList *aim_tlvlist_copy(GSList *orig);
int aim_tlvlist_count(GSList *list);
-int aim_tlvlist_size(GSList *list);
+size_t aim_tlvlist_size(GSList *list);
int aim_tlvlist_cmp(GSList *one, GSList *two);
int aim_tlvlist_write(ByteStream *bs, GSList **list);
void aim_tlvlist_free(GSList *list);
@@ -1215,7 +1215,7 @@ void aim_genericreq_l(OscarData *od, FlapConnection *conn, guint16 family, guint
int byte_stream_new(ByteStream *bs, size_t len);
int byte_stream_init(ByteStream *bs, guint8 *data, size_t len);
void byte_stream_destroy(ByteStream *bs);
-int byte_stream_bytes_left(ByteStream *bs);
+size_t byte_stream_bytes_left(ByteStream *bs);
int byte_stream_curpos(ByteStream *bs);
int byte_stream_setpos(ByteStream *bs, size_t off);
void byte_stream_rewind(ByteStream *bs);
diff --git a/libpurple/protocols/oscar/tlv.c b/libpurple/protocols/oscar/tlv.c
index c732e7554c..8383d18481 100644
--- a/libpurple/protocols/oscar/tlv.c
+++ b/libpurple/protocols/oscar/tlv.c
@@ -267,10 +267,10 @@ int aim_tlvlist_count(GSList *list)
* @return The number of bytes that would be needed to
* write the passed TLV chain to a data buffer.
*/
-int aim_tlvlist_size(GSList *list)
+size_t aim_tlvlist_size(GSList *list)
{
GSList *cur;
- int size;
+ size_t size;
if (list == NULL)
return 0;
@@ -658,7 +658,7 @@ void aim_tlvlist_remove(GSList **list, const guint16 type)
*/
int aim_tlvlist_write(ByteStream *bs, GSList **list)
{
- int goodbuflen;
+ size_t goodbuflen;
GSList *cur;
aim_tlv_t *tlv;
diff --git a/libpurple/protocols/oscar/util.c b/libpurple/protocols/oscar/util.c
index 1fa176e382..abdad3546d 100644
--- a/libpurple/protocols/oscar/util.c
+++ b/libpurple/protocols/oscar/util.c
@@ -62,7 +62,7 @@ static const char * const msgerrreason[] = {
N_("Queue full"),
N_("Not while on AOL")
};
-static const int msgerrreasonlen = G_N_ELEMENTS(msgerrreason);
+static const gsize msgerrreasonlen = G_N_ELEMENTS(msgerrreason);
const char *oscar_get_msgerr_reason(size_t reason)
{
diff --git a/libpurple/protocols/silc/buddy.c b/libpurple/protocols/silc/buddy.c
index b9facf55bc..ad9dc050c2 100644
--- a/libpurple/protocols/silc/buddy.c
+++ b/libpurple/protocols/silc/buddy.c
@@ -750,7 +750,7 @@ silcpurple_add_buddy_save(SilcBool success, void *context)
char filename[512], filename2[512], *fingerprint = NULL, *tmp;
SilcUInt32 len;
SilcHash hash;
- int i;
+ gsize i;
if (!success) {
/* The user did not trust the public key. */
diff --git a/libpurple/protocols/silc/chat.c b/libpurple/protocols/silc/chat.c
index 623aff7f49..764f0fcf7f 100644
--- a/libpurple/protocols/silc/chat.c
+++ b/libpurple/protocols/silc/chat.c
@@ -680,14 +680,14 @@ static void
silcpurple_chat_ulimit_cb(SilcPurpleChatInput s, const char *limit)
{
SilcChannelEntry channel;
- int ulimit = 0;
+ guint ulimit = 0;
channel = silc_client_get_channel(s->sg->client, s->sg->conn,
(char *)s->channel);
if (!channel)
return;
if (limit)
- ulimit = atoi(limit);
+ ulimit = strtoul(limit, NULL, 10);
if (!limit || !(*limit) || *limit == '0') {
if (limit && ulimit == channel->user_limit) {
@@ -1120,7 +1120,7 @@ void silcpurple_chat_invite(PurpleConnection *gc, int id, const char *msg,
SilcPurplePrvgrp prv;
for (l = sg->grps; l; l = l->next)
- if (((SilcPurplePrvgrp)l->data)->id == id)
+ if (((SilcPurplePrvgrp)l->data)->id == (gulong)id)
break;
if (!l)
return;
@@ -1131,7 +1131,7 @@ void silcpurple_chat_invite(PurpleConnection *gc, int id, const char *msg,
/* Find channel by id */
silc_hash_table_list(conn->local_entry->channels, &htl);
while (silc_hash_table_get(&htl, NULL, (void *)&chu)) {
- if (SILC_PTR_TO_32(chu->channel->context) == id ) {
+ if (SILC_PTR_TO_32(chu->channel->context) == (gulong)id ) {
found = TRUE;
break;
}
@@ -1165,7 +1165,7 @@ void silcpurple_chat_leave(PurpleConnection *gc, int id)
SilcChannelEntry channel;
for (l = sg->grps; l; l = l->next)
- if (((SilcPurplePrvgrp)l->data)->id == id)
+ if (((SilcPurplePrvgrp)l->data)->id == (gulong)id)
break;
if (!l)
return;
@@ -1185,7 +1185,7 @@ void silcpurple_chat_leave(PurpleConnection *gc, int id)
/* Find channel by id */
silc_hash_table_list(conn->local_entry->channels, &htl);
while (silc_hash_table_get(&htl, NULL, (void *)&chu)) {
- if (SILC_PTR_TO_32(chu->channel->context) == id ) {
+ if (SILC_PTR_TO_32(chu->channel->context) == (gulong)id ) {
found = TRUE;
break;
}
@@ -1202,7 +1202,7 @@ void silcpurple_chat_leave(PurpleConnection *gc, int id)
/* Leave from private groups on this channel as well */
for (l = sg->grps; l; l = l->next)
- if (((SilcPurplePrvgrp)l->data)->chid == id) {
+ if (((SilcPurplePrvgrp)l->data)->chid == (gulong)id) {
prv = l->data;
silc_client_del_channel_private_key(client, conn,
chu->channel,
@@ -1266,7 +1266,7 @@ int silcpurple_chat_send(PurpleConnection *gc, int id, const char *msg,
SilcPurplePrvgrp prv;
for (l = sg->grps; l; l = l->next)
- if (((SilcPurplePrvgrp)l->data)->id == id)
+ if (((SilcPurplePrvgrp)l->data)->id == (gulong)id)
break;
if (!l) {
g_free(tmp);
@@ -1286,7 +1286,7 @@ int silcpurple_chat_send(PurpleConnection *gc, int id, const char *msg,
/* Find channel by id */
silc_hash_table_list(conn->local_entry->channels, &htl);
while (silc_hash_table_get(&htl, NULL, (void *)&chu)) {
- if (SILC_PTR_TO_32(chu->channel->context) == id ) {
+ if (SILC_PTR_TO_32(chu->channel->context) == (gulong)id ) {
found = TRUE;
break;
}
@@ -1357,7 +1357,7 @@ void silcpurple_chat_set_topic(PurpleConnection *gc, int id, const char *topic)
SilcPurplePrvgrp prv;
for (l = sg->grps; l; l = l->next)
- if (((SilcPurplePrvgrp)l->data)->id == id)
+ if (((SilcPurplePrvgrp)l->data)->id == (gulong)id)
break;
if (!l)
return;
@@ -1368,7 +1368,7 @@ void silcpurple_chat_set_topic(PurpleConnection *gc, int id, const char *topic)
/* Find channel by id */
silc_hash_table_list(conn->local_entry->channels, &htl);
while (silc_hash_table_get(&htl, NULL, (void *)&chu)) {
- if (SILC_PTR_TO_32(chu->channel->context) == id ) {
+ if (SILC_PTR_TO_32(chu->channel->context) == (gulong)id ) {
found = TRUE;
break;
}
diff --git a/libpurple/protocols/silc/ops.c b/libpurple/protocols/silc/ops.c
index f0d14987d6..c1b7337733 100644
--- a/libpurple/protocols/silc/ops.c
+++ b/libpurple/protocols/silc/ops.c
@@ -456,7 +456,6 @@ silc_notify(SilcClient client, SilcClientConnection conn,
SilcNotifyType notify;
PurpleBuddy *b;
SilcDList list;
- int i;
va_start(va, type);
memset(buf, 0, sizeof(buf));
@@ -852,6 +851,7 @@ silc_notify(SilcClient client, SilcClientConnection conn,
if (public_key) {
GSList *buddies;
const char *f;
+ gsize i;
pk = silc_pkcs_public_key_encode(public_key, &pk_len);
if (!pk)
diff --git a/libpurple/protocols/silc/pk.c b/libpurple/protocols/silc/pk.c
index 306a310638..d3dbc373d3 100644
--- a/libpurple/protocols/silc/pk.c
+++ b/libpurple/protocols/silc/pk.c
@@ -122,7 +122,7 @@ void silcpurple_verify_public_key(SilcClient client, SilcClientConnection conn,
SilcVerifyPublicKey completion, void *context)
{
PurpleConnection *gc = client->application;
- int i;
+ gsize i;
char file[256], filename[256], filename2[256], *ipf, *hostf = NULL;
char *fingerprint, *babbleprint;
struct passwd *pw;
diff --git a/libpurple/protocols/yahoo/libymsg.c b/libpurple/protocols/yahoo/libymsg.c
index d4fc646efc..74bc7b97fc 100644
--- a/libpurple/protocols/yahoo/libymsg.c
+++ b/libpurple/protocols/yahoo/libymsg.c
@@ -2339,11 +2339,13 @@ static void yahoo_process_addbuddy(PurpleConnection *gc, struct yahoo_packet *pk
static void yahoo_p2p_write_pkt(gint source, struct yahoo_packet *pkt)
{
size_t pkt_len;
+ gssize written;
guchar *raw_packet;
/*build the raw packet and send it to the host*/
pkt_len = yahoo_packet_build(pkt, 0, 0, 0, &raw_packet);
- if(write(source, raw_packet, pkt_len) != pkt_len)
+ written = write(source, raw_packet, pkt_len);
+ if (written < 0 || (gsize)written != pkt_len)
purple_debug_warning("yahoo","p2p: couldn't write to the source\n");
g_free(raw_packet);
}
diff --git a/libpurple/protocols/yahoo/libymsg.h b/libpurple/protocols/yahoo/libymsg.h
index fce89b3d54..5f1fc9b17a 100644
--- a/libpurple/protocols/yahoo/libymsg.h
+++ b/libpurple/protocols/yahoo/libymsg.h
@@ -129,7 +129,7 @@ enum yahoo_status {
YAHOO_STATUS_WEBLOGIN = 0x5a55aa55,
YAHOO_STATUS_OFFLINE = 0x5a55aa56, /* don't ask */
YAHOO_STATUS_TYPING = 0x16,
- YAHOO_STATUS_DISCONNECTED = 0xffffffff /* in ymsg 15. doesnt mean the normal sense of 'disconnected' */
+ YAHOO_STATUS_DISCONNECTED = -1 /* 0xffffffff; in ymsg 15. doesnt mean the normal sense of 'disconnected' */
};
/*
diff --git a/libpurple/protocols/yahoo/util.c b/libpurple/protocols/yahoo/util.c
index 23c1b81de4..3790d0149f 100644
--- a/libpurple/protocols/yahoo/util.c
+++ b/libpurple/protocols/yahoo/util.c
@@ -522,7 +522,7 @@ char *yahoo_codes_to_html(const char *x)
size_t x_len;
xmlnode *html, *cur;
GString *cdata = g_string_new(NULL);
- int i, j;
+ guint i, j;
gboolean no_more_gt_brackets = FALSE;
const char *match;
gchar *xmlstr1, *xmlstr2, *esc;
@@ -778,7 +778,7 @@ char *yahoo_html_to_codes(const char *src)
GSList *tags = NULL;
size_t src_len;
- int i, j;
+ guint i, j;
GString *dest;
char *esc;
gboolean no_more_gt_brackets = FALSE;
diff --git a/libpurple/protocols/yahoo/yahoo_packet.c b/libpurple/protocols/yahoo/yahoo_packet.c
index a2a4fa0803..605009a681 100644
--- a/libpurple/protocols/yahoo/yahoo_packet.c
+++ b/libpurple/protocols/yahoo/yahoo_packet.c
@@ -139,7 +139,7 @@ void yahoo_packet_read(struct yahoo_packet *pkt, const guchar *data, int len)
char key[64];
const guchar *delimiter;
gboolean accept;
- int x;
+ guint x;
struct yahoo_pair *pair;
while (pos + 1 < len)
@@ -370,7 +370,7 @@ int yahoo_packet_send(struct yahoo_packet *pkt, YahooData *yd)
return ret;
}
- if (ret < len) {
+ if ((gsize)ret < len) {
if (yd->txhandler == 0)
yd->txhandler = purple_input_add(yd->fd, PURPLE_INPUT_WRITE,
yahoo_packet_send_can_write, yd);
diff --git a/libpurple/protocols/yahoo/yahoo_packet.h b/libpurple/protocols/yahoo/yahoo_packet.h
index f214351b26..6fdbd3438b 100644
--- a/libpurple/protocols/yahoo/yahoo_packet.h
+++ b/libpurple/protocols/yahoo/yahoo_packet.h
@@ -121,7 +121,7 @@ struct yahoo_pair {
struct yahoo_packet {
guint16 service;
- guint32 status;
+ gint32 status;
guint32 id;
GSList *hash;
};
diff --git a/libpurple/protocols/yahoo/ycht.c b/libpurple/protocols/yahoo/ycht.c
index 22f3142116..c6dc7b80cd 100644
--- a/libpurple/protocols/yahoo/ycht.c
+++ b/libpurple/protocols/yahoo/ycht.c
@@ -490,7 +490,7 @@ static void ycht_pending(gpointer data, gint source, PurpleInputCondition cond)
while (1) {
YchtPkt *pkt;
int pos = 0;
- int pktlen;
+ guint pktlen;
guint service;
guint version;
gint status;
diff --git a/libpurple/protocols/zephyr/ZReadAscii.c b/libpurple/protocols/zephyr/ZReadAscii.c
index 879ddb3c5f..bef0bc3db5 100644
--- a/libpurple/protocols/zephyr/ZReadAscii.c
+++ b/libpurple/protocols/zephyr/ZReadAscii.c
@@ -10,7 +10,7 @@
#include "internal.h"
-#define Z_cnvt_xtoi(c) ((temp=(c)-'0'),(temp<10)?temp:((temp-='A'-'9'-1),(temp<16)?temp:-1))
+#define Z_cnvt_xtoi(c) ((temp=(c)-'0'),(temp<10)?(int)temp:((temp-='A'-'9'-1),(temp<16)?(int)temp:-1))
Code_t ZReadAscii(ptr, len, field, num)
char *ptr;
diff --git a/libpurple/protocols/zephyr/ZVariables.c b/libpurple/protocols/zephyr/ZVariables.c
index d651f152b4..138f73542d 100644
--- a/libpurple/protocols/zephyr/ZVariables.c
+++ b/libpurple/protocols/zephyr/ZVariables.c
@@ -206,7 +206,7 @@ static int varline(bfr, var)
#define max(a,b) ((a > b) ? (a) : (b))
#endif
- if (g_ascii_strncasecmp(bfr, var, max(strlen(var), cp - bfr)))
+ if (g_ascii_strncasecmp(bfr, var, max(strlen(var), (gsize)(cp - bfr))))
return(0); /* var is not the var in
bfr ==> no match */
diff --git a/libpurple/protocols/zephyr/Zinternal.c b/libpurple/protocols/zephyr/Zinternal.c
index 6075eb420f..9c5a06b441 100644
--- a/libpurple/protocols/zephyr/Zinternal.c
+++ b/libpurple/protocols/zephyr/Zinternal.c
@@ -206,7 +206,7 @@ static struct _Z_InputQ *Z_SearchQueue(ZUnique_Id_t *uid, ZNotice_Kind_t kind)
if (ZCompareUID(uid, &qptr->uid) && qptr->kind == kind)
return (qptr);
next = qptr->next;
- if (qptr->timep && (qptr->timep+Z_NOTICETIMELIMIT < tv.tv_sec))
+ if (qptr->timep && ((time_t)qptr->timep+Z_NOTICETIMELIMIT < tv.tv_sec))
Z_RemQueue(qptr);
qptr = next;
}
@@ -648,7 +648,7 @@ Code_t Z_FormatAuthHeader(notice, buffer, buffer_len, len, cert_routine)
Code_t Z_FormatRawHeader(notice, buffer, buffer_len, len, cstart, cend)
ZNotice_t *notice;
char *buffer;
- int buffer_len;
+ gsize buffer_len;
int *len;
char **cstart, **cend;
{
diff --git a/libpurple/protocols/zephyr/internal.h b/libpurple/protocols/zephyr/internal.h
index 14c06b1703..0a0648d88a 100644
--- a/libpurple/protocols/zephyr/internal.h
+++ b/libpurple/protocols/zephyr/internal.h
@@ -105,7 +105,7 @@ void Z_RemQueue __P((struct _Z_InputQ *));
Code_t Z_AddNoticeToEntry __P((struct _Z_InputQ*, ZNotice_t*, int));
Code_t Z_FormatAuthHeader __P((ZNotice_t *, char *, int, int *, Z_AuthProc));
Code_t Z_FormatHeader __P((ZNotice_t *, char *, int, int *, Z_AuthProc));
-Code_t Z_FormatRawHeader __P((ZNotice_t *, char*, int,
+Code_t Z_FormatRawHeader __P((ZNotice_t *, char*, gsize,
int*, char **, char **));
Code_t Z_ReadEnqueue __P((void));
Code_t Z_ReadWait __P((void));
diff --git a/libpurple/protocols/zephyr/zephyr.c b/libpurple/protocols/zephyr/zephyr.c
index 9106df85b1..da304e257f 100644
--- a/libpurple/protocols/zephyr/zephyr.c
+++ b/libpurple/protocols/zephyr/zephyr.c
@@ -2090,8 +2090,7 @@ static int zephyr_send_im(PurpleConnection * gc, const char *who, const char *im
static char* zephyr_tzc_escape_msg(const char *message)
{
- int pos = 0;
- int pos2 = 0;
+ gsize pos = 0, pos2 = 0;
char *newmsg;
if (message && *message) {
@@ -2122,8 +2121,7 @@ static char* zephyr_tzc_escape_msg(const char *message)
char* zephyr_tzc_deescape_str(const char *message)
{
- int pos = 0;
- int pos2 = 0;
+ gsize pos = 0, pos2 = 0;
char *newmsg;
if (message && *message) {