pidgin/android/libpurple

Fix most of warnings for gtk2 and linux

2013-04-15, Tomasz Wasilczyk
ef97228bc5f0
Parents 8b4a41b6fe60
Children 7e3ea8475aad
Fix most of warnings for gtk2 and linux
--- a/finch/gntnotify.c Sun Apr 14 21:45:09 2013 +0200
+++ b/finch/gntnotify.c Mon Apr 15 00:48:17 2013 +0200
@@ -88,13 +88,13 @@
* PurpleNotifyType. Also, the if() followed by the
* inner switch doesn't make much sense.
*/
- if (type == PURPLE_NOTIFY_FORMATTED) {
+ if ((int)type == (int)PURPLE_NOTIFY_FORMATTED) {
int width = -1, height = -1;
char *plain = (char*)secondary;
msg = gnt_text_view_new();
gnt_text_view_set_flag(GNT_TEXT_VIEW(msg), GNT_TEXT_VIEW_TOP_ALIGN | GNT_TEXT_VIEW_NO_SCROLL);
- switch (type) {
- case PURPLE_NOTIFY_FORMATTED:
+ switch ((int)type) {
+ case (int)PURPLE_NOTIFY_FORMATTED:
plain = purple_markup_strip_html(secondary);
if (gnt_util_parse_xhtml_to_textview(secondary, GNT_TEXT_VIEW(msg)))
break;
--- a/finch/libgnt/gntwm.c Sun Apr 14 21:45:09 2013 +0200
+++ b/finch/libgnt/gntwm.c Mon Apr 15 00:48:17 2013 +0200
@@ -767,14 +767,16 @@
if ((now & A_COLOR) != (old & A_COLOR) ||
(now & A_REVERSE) != (old & A_REVERSE))
{
- int ret;
short fgp, bgp, r, g, b;
struct
{
int r, g, b;
} fg, bg;
- ret = pair_content(PAIR_NUMBER(now & A_COLOR), &fgp, &bgp);
+ if (pair_content(PAIR_NUMBER(now & A_COLOR), &fgp, &bgp) != OK) {
+ fgp = -1;
+ bgp = -1;
+ }
if (fgp == -1)
fgp = COLOR_BLACK;
if (bgp == -1)
@@ -785,9 +787,13 @@
fgp = bgp;
bgp = tmp;
}
- ret = color_content(fgp, &r, &g, &b);
+ if (color_content(fgp, &r, &g, &b) != OK) {
+ r = g = b = 0;
+ }
fg.r = r; fg.b = b; fg.g = g;
- ret = color_content(bgp, &r, &g, &b);
+ if (color_content(bgp, &r, &g, &b) != OK) {
+ r = g = b = 255;
+ }
bg.r = r; bg.b = b; bg.g = g;
#define ADJUST(x) (x = x * 255 / 1000)
ADJUST(fg.r);
@@ -1135,13 +1141,11 @@
{
static GntWidget *clip;
gchar *text;
- int maxx, maxy;
if (clip) {
gnt_widget_destroy(clip);
clip = NULL;
return TRUE;
}
- getmaxyx(stdscr, maxy, maxx);
text = gnt_get_clipboard_string();
clip = gnt_hwindow_new(FALSE);
GNT_WIDGET_SET_FLAGS(clip, GNT_WIDGET_TRANSIENT);
--- a/libpurple/plugins/perl/common/BuddyList.xs Sun Apr 14 21:45:09 2013 +0200
+++ b/libpurple/plugins/perl/common/BuddyList.xs Mon Apr 15 00:48:17 2013 +0200
@@ -6,7 +6,8 @@
chat_components_foreach(gpointer key, gpointer value, gpointer user_data)
{
HV *hv = user_data;
- hv_store(hv, key, strlen(key), newSVpv(value, 0), 0);
+ if (hv_store(hv, key, strlen(key), newSVpv(value, 0), 0) == NULL)
+ purple_debug_error("perl", "hv_store failed\n");
}
MODULE = Purple::BuddyList PACKAGE = Purple PREFIX = purple_
--- a/libpurple/plugins/perl/common/Certificate.xs Sun Apr 14 21:45:09 2013 +0200
+++ b/libpurple/plugins/perl/common/Certificate.xs Mon Apr 15 00:48:17 2013 +0200
@@ -232,7 +232,6 @@
Purple::Certificate::Verifier verifier
const gchar* subject_name
AV* cert_chain
- CV *cb
SV *cb_data
PREINIT:
GList *l = NULL;
--- a/libpurple/plugins/perl/common/Util.xs Sun Apr 14 21:45:09 2013 +0200
+++ b/libpurple/plugins/perl/common/Util.xs Mon Apr 15 00:48:17 2013 +0200
@@ -3,7 +3,8 @@
static void markup_find_tag_foreach(GQuark key_id, char *data, HV *hv) {
const char *key = NULL;
key = g_quark_to_string(key_id);
- hv_store(hv, key, strlen(key), newSVpv(data, 0), 0);
+ if (hv_store(hv, key, strlen(key), newSVpv(data, 0), 0) == NULL)
+ purple_debug_error("perl", "hv_store failed\n");
}
MODULE = Purple::Util PACKAGE = Purple::Util PREFIX = purple_
--- a/libpurple/plugins/perl/perl-common.c Sun Apr 14 21:45:09 2013 +0200
+++ b/libpurple/plugins/perl/perl-common.c Mon Apr 15 00:48:17 2013 +0200
@@ -83,7 +83,8 @@
stash = gv_stashpv(stash_name, 1);
hv = newHV();
- hv_store(hv, "_purple", 7, create_sv_ptr(object), 0);
+ if (hv_store(hv, "_purple", 7, create_sv_ptr(object), 0) == NULL)
+ purple_debug_error("perl", "hv_store failed\n");
return sv_bless(newRV_noinc((SV *)hv), stash);
}
--- a/libpurple/plugins/ssl/ssl-gnutls.c Sun Apr 14 21:45:09 2013 +0200
+++ b/libpurple/plugins/ssl/ssl-gnutls.c Mon Apr 15 00:48:17 2013 +0200
@@ -34,7 +34,7 @@
typedef struct
{
- gnutls_session session;
+ gnutls_session_t session;
guint handshake_handler;
guint handshake_timer;
} PurpleSslGnutlsData;
@@ -284,9 +284,9 @@
g_list_free(peers);
{
- const gnutls_datum *cert_list;
+ const gnutls_datum_t *cert_list;
unsigned int cert_list_size = 0;
- gnutls_session session=gnutls_data->session;
+ gnutls_session_t session=gnutls_data->session;
int i;
cert_list =
@@ -303,7 +303,7 @@
gchar tbuf[256];
gsize tsz=sizeof(tbuf);
gchar * tasc = NULL;
- gnutls_x509_crt cert;
+ gnutls_x509_crt_t cert;
gnutls_x509_crt_init(&cert);
gnutls_x509_crt_import (cert, &cert_list[i],
@@ -519,7 +519,7 @@
/* Forward declarations are fun! */
static PurpleCertificate *
-x509_import_from_datum(const gnutls_datum dt, gnutls_x509_crt_fmt mode);
+x509_import_from_datum(const gnutls_datum_t dt, gnutls_x509_crt_fmt_t mode);
/* indeed! */
static gboolean
x509_certificate_signed_by(PurpleCertificate * crt,
@@ -537,7 +537,7 @@
GList * peer_certs = NULL;
/* List of raw certificates as given by GnuTLS */
- const gnutls_datum *cert_list;
+ const gnutls_datum_t *cert_list;
unsigned int cert_list_size = 0;
unsigned int i;
@@ -585,7 +585,7 @@
/** Refcounted GnuTLS certificate data instance */
typedef struct {
gint refcount;
- gnutls_x509_crt crt;
+ gnutls_x509_crt_t crt;
} x509_crtdata_t;
/** Helper functions for reference counting */
@@ -617,7 +617,7 @@
/** Helper macro to retrieve the GnuTLS crt_t from a PurpleCertificate */
#define X509_GET_GNUTLS_DATA(pcrt) ( ((x509_crtdata_t *) (pcrt->data))->crt)
-/** Transforms a gnutls_datum containing an X.509 certificate into a Certificate instance under the x509_gnutls scheme
+/** Transforms a gnutls_datum_t containing an X.509 certificate into a Certificate instance under the x509_gnutls scheme
*
* @param dt Datum to transform
* @param mode GnuTLS certificate format specifier (GNUTLS_X509_FMT_PEM for
@@ -627,7 +627,7 @@
* @return A newly allocated Certificate structure of the x509_gnutls scheme
*/
static PurpleCertificate *
-x509_import_from_datum(const gnutls_datum dt, gnutls_x509_crt_fmt mode)
+x509_import_from_datum(const gnutls_datum_t dt, gnutls_x509_crt_fmt_t mode)
{
/* Internal certificate data structure */
x509_crtdata_t *certdat;
@@ -662,7 +662,7 @@
PurpleCertificate *crt; /* Certificate being constructed */
gchar *buf; /* Used to load the raw file data */
gsize buf_sz; /* Size of the above */
- gnutls_datum dt; /* Struct to pass down to GnuTLS */
+ gnutls_datum_t dt; /* Struct to pass down to GnuTLS */
purple_debug_info("gnutls",
"Attempting to load X.509 certificate from %s\n",
@@ -705,7 +705,7 @@
gchar *begin, *end;
GSList *crts = NULL;
gsize buf_sz; /* Size of the above */
- gnutls_datum dt; /* Struct to pass down to GnuTLS */
+ gnutls_datum_t dt; /* Struct to pass down to GnuTLS */
purple_debug_info("gnutls",
"Attempting to load X.509 certificates from %s\n",
@@ -751,7 +751,7 @@
static gboolean
x509_export_certificate(const gchar *filename, PurpleCertificate *crt)
{
- gnutls_x509_crt crt_dat; /* GnuTLS cert struct */
+ gnutls_x509_crt_t crt_dat; /* GnuTLS cert struct */
int ret;
gchar * out_buf; /* Data to output */
size_t out_size; /* Output size */
@@ -857,8 +857,8 @@
x509_certificate_signed_by(PurpleCertificate * crt,
PurpleCertificate * issuer)
{
- gnutls_x509_crt crt_dat;
- gnutls_x509_crt issuer_dat;
+ gnutls_x509_crt_t crt_dat;
+ gnutls_x509_crt_t issuer_dat;
unsigned int verify; /* used to store result from GnuTLS verifier */
int ret;
gchar *crt_id = NULL;
@@ -963,7 +963,7 @@
{
size_t hashlen = 20; /* SHA1 hashes are 20 bytes */
size_t tmpsz = hashlen; /* Throw-away variable for GnuTLS to stomp on*/
- gnutls_x509_crt crt_dat;
+ gnutls_x509_crt_t crt_dat;
GByteArray *hash; /**< Final hash container */
guchar hashbuf[hashlen]; /**< Temporary buffer to contain hash */
@@ -990,7 +990,7 @@
static gchar *
x509_cert_dn (PurpleCertificate *crt)
{
- gnutls_x509_crt cert_dat;
+ gnutls_x509_crt_t cert_dat;
gchar *dn = NULL;
size_t dn_size;
@@ -1023,7 +1023,7 @@
static gchar *
x509_issuer_dn (PurpleCertificate *crt)
{
- gnutls_x509_crt cert_dat;
+ gnutls_x509_crt_t cert_dat;
gchar *dn = NULL;
size_t dn_size;
@@ -1057,7 +1057,7 @@
static gchar *
x509_common_name (PurpleCertificate *crt)
{
- gnutls_x509_crt cert_dat;
+ gnutls_x509_crt_t cert_dat;
gchar *cn = NULL;
size_t cn_size;
int ret;
@@ -1100,7 +1100,7 @@
static gboolean
x509_check_name (PurpleCertificate *crt, const gchar *name)
{
- gnutls_x509_crt crt_dat;
+ gnutls_x509_crt_t crt_dat;
g_return_val_if_fail(crt, FALSE);
g_return_val_if_fail(crt->scheme == &x509_gnutls, FALSE);
@@ -1118,7 +1118,7 @@
static gboolean
x509_times (PurpleCertificate *crt, time_t *activation, time_t *expiration)
{
- gnutls_x509_crt crt_dat;
+ gnutls_x509_crt_t crt_dat;
/* GnuTLS time functions return this on error */
const time_t errval = (time_t) (-1);
gboolean success = TRUE;
@@ -1145,7 +1145,7 @@
static GByteArray *
x509_get_der_data(PurpleCertificate *crt)
{
- gnutls_x509_crt crt_dat;
+ gnutls_x509_crt_t crt_dat;
GByteArray *data;
size_t len;
int ret;
--- a/libpurple/protocols/bonjour/jabber.c Sun Apr 14 21:45:09 2013 +0200
+++ b/libpurple/protocols/bonjour/jabber.c Mon Apr 15 00:48:17 2013 +0200
@@ -149,7 +149,6 @@
xmlnode *body_node, *html_node, *events_node;
PurpleConnection *gc = purple_account_get_connection(purple_buddy_get_account(pb));
gchar *body = NULL;
- gboolean composing_event = FALSE;
body_node = xmlnode_get_child(message_node, "body");
html_node = xmlnode_get_child(message_node, "html");
@@ -161,8 +160,10 @@
events_node = xmlnode_get_child_with_namespace(message_node, "x", "jabber:x:event");
if (events_node != NULL) {
+#if 0
if (xmlnode_get_child(events_node, "composing") != NULL)
composing_event = TRUE;
+#endif
if (xmlnode_get_child(events_node, "id") != NULL) {
/* The user is just typing */
/* TODO: Deal with typing notification */
--- a/libpurple/protocols/jabber/jingle/jingle.c Sun Apr 14 21:45:09 2013 +0200
+++ b/libpurple/protocols/jabber/jingle/jingle.c Mon Apr 15 00:48:17 2013 +0200
@@ -455,8 +455,7 @@
"password", G_TYPE_STRING, password,
"relay-type", G_TYPE_STRING, relay_type,
NULL);
- purple_debug_info("jabber", "created gst_structure %" GST_PTR_FORMAT "\n",
- turn_setup);
+ purple_debug_info("jabber", "created gst_structure %p\n", turn_setup);
if (turn_setup) {
memset(&value, 0, sizeof(GValue));
g_value_init(&value, GST_TYPE_STRUCTURE);
--- a/libpurple/protocols/myspace/user.c Sun Apr 14 21:45:09 2013 +0200
+++ b/libpurple/protocols/myspace/user.c Mon Apr 15 00:48:17 2013 +0200
@@ -630,14 +630,16 @@
MsimMessage *body;
guint rid;
- gint cmd,dsn,uid,lid,code;
+ gint cmd,dsn,lid,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");
cmd = msim_msg_get_integer(userinfo, "cmd");
dsn = msim_msg_get_integer(userinfo, "dsn");
- uid = msim_msg_get_integer(userinfo, "uid");
+#if 0
+ gint uid = msim_msg_get_integer(userinfo, "uid");
+#endif
lid = msim_msg_get_integer(userinfo, "lid");
body = msim_msg_get_dictionary(userinfo, "body");
errmsg = _("An error occurred while trying to set the username. "
--- a/libpurple/protocols/oscar/family_auth.c Sun Apr 14 21:45:09 2013 +0200
+++ b/libpurple/protocols/oscar/family_auth.c Mon Apr 15 00:48:17 2013 +0200
@@ -584,7 +584,6 @@
{
FlapConnection *conn;
FlapFrame *frame;
- aim_snacid_t snacid;
int len;
if (!od || !(conn = flap_connection_getbytype_all(od, SNAC_FAMILY_AUTH)) || !securid)
@@ -594,7 +593,7 @@
frame = flap_frame_new(od, 0x02, 10+2+len);
- snacid = aim_cachesnac(od, SNAC_FAMILY_AUTH, SNAC_SUBTYPE_AUTH_SECURID_RESPONSE, 0x0000, NULL, 0);
+ /* aim_snacid_t snacid = */aim_cachesnac(od, SNAC_FAMILY_AUTH, SNAC_SUBTYPE_AUTH_SECURID_RESPONSE, 0x0000, NULL, 0);
aim_putsnac(&frame->data, SNAC_FAMILY_AUTH, SNAC_SUBTYPE_AUTH_SECURID_RESPONSE, 0);
byte_stream_put16(&frame->data, len);
--- a/libpurple/protocols/oscar/family_bart.c Sun Apr 14 21:45:09 2013 +0200
+++ b/libpurple/protocols/oscar/family_bart.c Mon Apr 15 00:48:17 2013 +0200
@@ -73,12 +73,10 @@
{
int ret = 0;
aim_rxcallback_t userfunc;
- guint16 something, somethingelse;
- guint8 onemorething;
- something = byte_stream_get16(bs);
- somethingelse = byte_stream_get16(bs);
- onemorething = byte_stream_get8(bs);
+ byte_stream_get16(bs);
+ byte_stream_get16(bs);
+ byte_stream_get8(bs);
if ((userfunc = aim_callhandler(od, snac->family, snac->subtype)))
ret = userfunc(od, conn, frame);
@@ -139,7 +137,7 @@
int ret = 0;
aim_rxcallback_t userfunc;
char *bn;
- guint16 flags, iconlen;
+ guint16 iconlen;
guint8 iconcsumtype, iconcsumlen, *iconcsum, *icon;
bn = byte_stream_getstr(bs, byte_stream_get8(bs));
@@ -149,7 +147,7 @@
g_free(bn);
return 1;
}
- flags = byte_stream_get16(bs);
+ byte_stream_get16(bs); /* flags */
iconcsumtype = byte_stream_get8(bs);
iconcsumlen = byte_stream_get8(bs);
iconcsum = byte_stream_getraw(bs, iconcsumlen);
--- a/libpurple/protocols/oscar/family_chatnav.c Sun Apr 14 21:45:09 2013 +0200
+++ b/libpurple/protocols/oscar/family_chatnav.c Mon Apr 15 00:48:17 2013 +0200
@@ -224,11 +224,8 @@
* 2 Exchange creation allowed
*
*/
- if (aim_tlv_gettlv(innerlist, 0x00d5, 1)) {
- guint8 createperms;
-
- createperms = aim_tlv_get8(innerlist, 0x00d5, 1);
- }
+ if (aim_tlv_gettlv(innerlist, 0x00d5, 1))
+ aim_tlv_get8(innerlist, 0x00d5, 1); /* createperms */
/*
* Type 0x00d6: Character Set (First Time)
--- a/libpurple/protocols/oscar/family_icbm.c Sun Apr 14 21:45:09 2013 +0200
+++ b/libpurple/protocols/oscar/family_icbm.c Mon Apr 15 00:48:17 2013 +0200
@@ -1810,13 +1810,12 @@
*/
static int msgack(OscarData *od, FlapConnection *conn, aim_module_t *mod, FlapFrame *frame, aim_modsnac_t *snac, ByteStream *bs)
{
- guint16 ch;
guchar *cookie;
char *bn;
int ret = 0;
cookie = byte_stream_getraw(bs, 8);
- ch = byte_stream_get16(bs);
+ byte_stream_get16(bs); /* ch */
bn = byte_stream_getstr(bs, byte_stream_get8(bs));
purple_debug_info("oscar", "Sent message to %s.\n", bn);
--- a/libpurple/protocols/oscar/family_locate.c Sun Apr 14 21:45:09 2013 +0200
+++ b/libpurple/protocols/oscar/family_locate.c Mon Apr 15 00:48:17 2013 +0200
@@ -958,8 +958,7 @@
/*
* My instance number.
*/
- guint8 instance_number;
- instance_number = byte_stream_get8(bs);
+ byte_stream_get8(bs);
} else if (type == 0x0019) {
/*
--- a/libpurple/protocols/oscar/family_oservice.c Sun Apr 14 21:45:09 2013 +0200
+++ b/libpurple/protocols/oscar/family_oservice.c Mon Apr 15 00:48:17 2013 +0200
@@ -764,6 +764,9 @@
/* This is frivolous. (Thank you SmarterChild.) */
vercount = byte_stream_bytes_left(bs)/4;
+
+ /* XXX: vercount probably should be used for reading versions. */
+ (void)vercount;
versions = byte_stream_getraw(bs, byte_stream_bytes_left(bs));
g_free(versions);
--- a/libpurple/protocols/oscar/oscar.c Sun Apr 14 21:45:09 2013 +0200
+++ b/libpurple/protocols/oscar/oscar.c Mon Apr 15 00:48:17 2013 +0200
@@ -2128,11 +2128,11 @@
PurpleAccount *account = purple_connection_get_account(gc);
char *buf;
va_list ap;
- guint16 chan, nummissed, reason;
+ guint16 nummissed, reason;
aim_userinfo_t *userinfo;
va_start(ap, fr);
- chan = (guint16)va_arg(ap, unsigned int);
+ va_arg(ap, unsigned int); /* guint16 chan */
userinfo = va_arg(ap, aim_userinfo_t *);
nummissed = (guint16)va_arg(ap, unsigned int);
reason = (guint16)va_arg(ap, unsigned int);
@@ -2615,12 +2615,12 @@
PurpleConnection *gc = od->gc;
va_list ap;
char *bn;
- guint8 iconcsumtype, *iconcsum, *icon;
+ guint8 *iconcsum, *icon;
guint16 iconcsumlen, iconlen;
va_start(ap, fr);
bn = va_arg(ap, char *);
- iconcsumtype = va_arg(ap, int);
+ va_arg(ap, int); /* iconcsumtype */
iconcsum = va_arg(ap, guint8 *);
iconcsumlen = va_arg(ap, int);
icon = va_arg(ap, guint8 *);
@@ -2925,14 +2925,13 @@
gchar *text;
va_list ap;
char *msg, *url;
- guint16 wid, hei, delay;
va_start(ap, fr);
msg = va_arg(ap, char *);
url = va_arg(ap, char *);
- wid = (guint16) va_arg(ap, int);
- hei = (guint16) va_arg(ap, int);
- delay = (guint16) va_arg(ap, int);
+ va_arg(ap, int); /* guint16 wid */
+ va_arg(ap, int); /* guint16 hei */
+ va_arg(ap, int); /* guint16 delay */
va_end(ap);
text = g_strdup_printf("%s<br><a href=\"%s\">%s</a>", msg, url, url);
@@ -3845,8 +3844,6 @@
guint32 tmp;
PurpleStoredImage *img;
va_list ap;
- guint16 fmtver, numitems;
- guint32 timestamp;
guint16 deny_entry_type = aim_ssi_getdenyentrytype(od);
gc = od->gc;
@@ -3854,9 +3851,9 @@
account = purple_connection_get_account(gc);
va_start(ap, fr);
- fmtver = (guint16)va_arg(ap, int);
- numitems = (guint16)va_arg(ap, int);
- timestamp = va_arg(ap, guint32);
+ va_arg(ap, int); /* guint16 fmtver */
+ va_arg(ap, int); /* guint16 numitems */
+ va_arg(ap, guint32); /* timestamp */
va_end(ap);
/* Don't attempt to re-request our buddy list later */
@@ -4236,14 +4233,14 @@
static int purple_ssi_authgiven(OscarData *od, FlapConnection *conn, FlapFrame *fr, ...) {
PurpleConnection *gc = od->gc;
va_list ap;
- char *bn, *msg;
+ char *bn;
gchar *dialog_msg, *nombre;
struct name_data *data;
PurpleBuddy *buddy;
va_start(ap, fr);
bn = va_arg(ap, char *);
- msg = va_arg(ap, char *);
+ va_arg(ap, char *); /* msg */
va_end(ap);
purple_debug_info("oscar",
--- a/libpurple/protocols/sametime/sametime.c Sun Apr 14 21:45:09 2013 +0200
+++ b/libpurple/protocols/sametime/sametime.c Mon Apr 15 00:48:17 2013 +0200
@@ -433,13 +433,10 @@
static void mw_session_io_close(struct mwSession *session) {
struct mwPurplePluginData *pd;
- PurpleConnection *gc;
pd = mwSession_getClientData(session);
g_return_if_fail(pd != NULL);
- gc = pd->gc;
-
if(pd->outpa) {
purple_input_remove(pd->outpa);
pd->outpa = 0;
@@ -1337,13 +1334,11 @@
static void blist_node_menu_cb(PurpleBlistNode *node,
GList **menu, struct mwPurplePluginData *pd) {
const char *owner;
- PurpleGroup *group;
PurpleAccount *acct;
PurpleMenuAction *act;
/* we only want groups */
if(! PURPLE_BLIST_NODE_IS_GROUP(node)) return;
- group = (PurpleGroup *) node;
acct = purple_connection_get_account(pd->gc);
g_return_if_fail(acct != NULL);
@@ -1354,6 +1349,7 @@
#if 0
/* if there's anyone in the group for this acct, offer to invite
them all to a conference */
+ group = (PurpleGroup *) node;
if(purple_group_on_account(group, acct)) {
act = purple_menu_action_new(_("Invite Group to Conference..."),
PURPLE_CALLBACK(blist_menu_group_invite),
@@ -2026,21 +2022,12 @@
static void mw_conf_peer_joined(struct mwConference *conf,
struct mwLoginInfo *peer) {
- struct mwServiceConference *srvc;
- struct mwSession *session;
- struct mwPurplePluginData *pd;
- PurpleConnection *gc;
PurpleConvChat *g_conf;
const char *n = mwConference_getName(conf);
DEBUG_INFO("%s joined conf %s\n", NSTR(peer->user_id), NSTR(n));
- srvc = mwConference_getService(conf);
- session = mwService_getSession(MW_SERVICE(srvc));
- pd = mwSession_getClientData(session);
- gc = pd->gc;
-
g_conf = mwConference_getClientData(conf);
g_return_if_fail(g_conf != NULL);
@@ -2052,21 +2039,12 @@
static void mw_conf_peer_parted(struct mwConference *conf,
struct mwLoginInfo *peer) {
- struct mwServiceConference *srvc;
- struct mwSession *session;
- struct mwPurplePluginData *pd;
- PurpleConnection *gc;
PurpleConvChat *g_conf;
const char *n = mwConference_getName(conf);
DEBUG_INFO("%s left conf %s\n", NSTR(peer->user_id), NSTR(n));
- srvc = mwConference_getService(conf);
- session = mwService_getSession(MW_SERVICE(srvc));
- pd = mwSession_getClientData(session);
- gc = pd->gc;
-
g_conf = mwConference_getClientData(conf);
g_return_if_fail(g_conf != NULL);
@@ -3052,21 +3030,12 @@
static void mw_place_peerJoined(struct mwPlace *place,
const struct mwIdBlock *peer) {
- struct mwServicePlace *srvc;
- struct mwSession *session;
- struct mwPurplePluginData *pd;
- PurpleConnection *gc;
PurpleConversation *gconf;
const char *n = mwPlace_getName(place);
DEBUG_INFO("%s joined place %s\n", NSTR(peer->user), NSTR(n));
- srvc = mwPlace_getService(place);
- session = mwService_getSession(MW_SERVICE(srvc));
- pd = mwSession_getClientData(session);
- gc = pd->gc;
-
gconf = mwPlace_getClientData(place);
g_return_if_fail(gconf != NULL);
@@ -3077,21 +3046,12 @@
static void mw_place_peerParted(struct mwPlace *place,
const struct mwIdBlock *peer) {
- struct mwServicePlace *srvc;
- struct mwSession *session;
- struct mwPurplePluginData *pd;
- PurpleConnection *gc;
PurpleConversation *gconf;
const char *n = mwPlace_getName(place);
DEBUG_INFO("%s left place %s\n", NSTR(peer->user), NSTR(n));
- srvc = mwPlace_getService(place);
- session = mwService_getSession(MW_SERVICE(srvc));
- pd = mwSession_getClientData(session);
- gc = pd->gc;
-
gconf = mwPlace_getClientData(place);
g_return_if_fail(gconf != NULL);
@@ -5041,6 +5001,7 @@
const char *filename;
gsize filesize;
FILE *fp;
+ char *remote_user = NULL;
struct mwIdBlock idb = { NULL, NULL };
@@ -5051,9 +5012,11 @@
pd = purple_connection_get_protocol_data(gc);
srvc = pd->srvc_ft;
+ remote_user = g_strdup(purple_xfer_get_remote_user(xfer));
+
filename = purple_xfer_get_local_filename(xfer);
filesize = purple_xfer_get_size(xfer);
- idb.user = purple_xfer_get_remote_user(xfer);
+ idb.user = remote_user;
purple_xfer_update_progress(xfer);
@@ -5064,6 +5027,7 @@
filename, g_strerror(errno));
purple_xfer_error(purple_xfer_get_type(xfer), acct, purple_xfer_get_remote_user(xfer), msg);
g_free(msg);
+ g_free(remote_user);
return;
}
fclose(fp);
@@ -5080,6 +5044,7 @@
purple_xfer_set_protocol_data(xfer, ft);
mwFileTransfer_offer(ft);
+ g_free(remote_user);
}
--- a/libpurple/protocols/yahoo/libymsg.c Sun Apr 14 21:45:09 2013 +0200
+++ b/libpurple/protocols/yahoo/libymsg.c Mon Apr 15 00:48:17 2013 +0200
@@ -1775,7 +1775,6 @@
struct yahoo_auth_data *auth_data = user_data;
PurpleConnection *gc = auth_data->gc;
YahooData *yd = purple_connection_get_protocol_data(gc);
- gboolean try_login_on_error = FALSE;
purple_debug_info("yahoo","Authentication: In yahoo_auth16_stage2\n");
@@ -1860,7 +1859,9 @@
default:
/* if we have everything we need, why not try to login irrespective of response */
if((crumb != NULL) && (yd->cookie_y != NULL) && (yd->cookie_t != NULL)) {
+#if 0
try_login_on_error = TRUE;
+#endif
break;
}
error_reason = g_strdup(_("Unknown error"));
@@ -2048,7 +2049,6 @@
static void yahoo_process_auth(PurpleConnection *gc, struct yahoo_packet *pkt)
{
char *seed = NULL;
- char *sn = NULL;
GSList *l = pkt->hash;
int m = 0;
gchar *buf;
@@ -2057,8 +2057,7 @@
struct yahoo_pair *pair = l->data;
if (pair->key == 94)
seed = pair->value;
- if (pair->key == 1)
- sn = pair->value;
+ /* (pair->key == 1) -> sn */
if (pair->key == 13)
m = atoi(pair->value);
l = l->next;
@@ -2121,7 +2120,6 @@
PurpleBuddy *b;
GSList *l;
gchar *who = NULL;
- gchar *me = NULL;
gchar buf[BUF_LONG];
gboolean ignore = TRUE;
gint status = 0;
@@ -2132,9 +2130,7 @@
case 0:
who = pair->value;
break;
- case 1:
- me = pair->value;
- break;
+ /* 1 -> me */
case 13:
/* 1 == ignore, 2 == unignore */
ignore = (strtol(pair->value, NULL, 10) == 1);
--- a/libpurple/protocols/yahoo/yahoo_filexfer.c Sun Apr 14 21:45:09 2013 +0200
+++ b/libpurple/protocols/yahoo/yahoo_filexfer.c Mon Apr 15 00:48:17 2013 +0200
@@ -740,7 +740,6 @@
char *message = NULL;
char *command = NULL;
char *imv = NULL;
- char *unknown = NULL;
/* Get all the necessary values from this new packet */
while(l != NULL)
@@ -767,7 +766,6 @@
imv = pair->value;
break;
case 64: /* Not sure, but it does vary with initialization of Doodle */
- unknown = pair->value; /* So, I'll keep it (for a little while atleast) */
break;
}
@@ -793,11 +791,9 @@
void yahoo_process_filetransfer(PurpleConnection *gc, struct yahoo_packet *pkt)
{
char *from = NULL;
- char *to = NULL;
char *msg = NULL;
char *url = NULL;
char *imv = NULL;
- long expires = 0;
PurpleXfer *xfer;
YahooData *yd;
struct yahoo_xfer_data *xfer_data;
@@ -815,8 +811,7 @@
case 4:
from = pair->value;
break;
- case 5:
- to = pair->value;
+ case 5: /* to */
break;
case 14:
msg = pair->value;
@@ -824,8 +819,7 @@
case 20:
url = pair->value;
break;
- case 38:
- expires = strtol(pair->value, NULL, 10);
+ case 38: /* expires = strtol(pair->value, NULL, 10); */
break;
case 27:
filename = pair->value;
@@ -1593,7 +1587,6 @@
void yahoo_process_filetrans_15(PurpleConnection *gc, struct yahoo_packet *pkt)
{
char *from = NULL;
- char *to = NULL;
char *imv = NULL;
long val_222 = 0L;
PurpleXfer *xfer;
@@ -1618,8 +1611,7 @@
case 4:
from = pair->value;
break;
- case 5:
- to = pair->value;
+ case 5: /* to */
break;
case 265:
xfer_peer_idstring = pair->value;
@@ -1773,15 +1765,12 @@
void yahoo_process_filetrans_info_15(PurpleConnection *gc, struct yahoo_packet *pkt)
{
- char *from = NULL;
- char *to = NULL;
char *url = NULL;
long val_249 = 0;
long val_66 = 0;
PurpleXfer *xfer;
YahooData *yd;
struct yahoo_xfer_data *xfer_data;
- char *filename = NULL;
char *xfer_peer_idstring = NULL;
char *xfer_idstring_for_relay = NULL;
GSList *l;
@@ -1794,17 +1783,14 @@
struct yahoo_pair *pair = l->data;
switch (pair->key) {
- case 4:
- from = pair->value;
+ case 4: /* from */
break;
- case 5:
- to = pair->value;
+ case 5: /* to */
break;
case 265:
xfer_peer_idstring = pair->value;
break;
- case 27:
- filename = pair->value;
+ case 27: /* filename */
break;
case 66:
val_66 = strtol(pair->value, NULL, 10);
--- a/libpurple/protocols/yahoo/yahoo_picture.c Sun Apr 14 21:45:09 2013 +0200
+++ b/libpurple/protocols/yahoo/yahoo_picture.c Mon Apr 15 00:48:17 2013 +0200
@@ -74,7 +74,7 @@
{
YahooData *yd;
GSList *l = pkt->hash;
- char *who = NULL, *us = NULL;
+ char *who = NULL;
gboolean got_icon_info = FALSE, send_icon_info = FALSE;
char *url = NULL;
int checksum = 0;
@@ -87,8 +87,7 @@
case 4:
who = pair->value;
break;
- case 5:
- us = pair->value;
+ case 5: /* us */
break;
case 13: {
int tmp;
--- a/libpurple/protocols/yahoo/yahoochat.c Sun Apr 14 21:45:09 2013 +0200
+++ b/libpurple/protocols/yahoo/yahoochat.c Mon Apr 15 00:48:17 2013 +0200
@@ -469,7 +469,6 @@
GList *roomies = NULL;
char *room = NULL;
char *topic = NULL;
- char *someid, *someotherid, *somebase64orhashosomething, *somenegativenumber;
if (pkt->status == -1) {
/* We can't join */
@@ -505,19 +504,15 @@
g_free(topic);
topic = yahoo_string_decode(gc, pair->value, TRUE);
break;
- case 128:
- someid = pair->value;
+ case 128: /* some id */
break;
case 108: /* number of joiners */
break;
- case 129:
- someotherid = pair->value;
+ case 129: /* some other id */
break;
- case 130:
- somebase64orhashosomething = pair->value;
+ case 130: /* some base64 or hash or something */
break;
- case 126:
- somenegativenumber = pair->value;
+ case 126: /* some negative number */
break;
case 13: /* this is 1. maybe its the type of room? (normal, user created, private, etc?) */
break;
--- a/libpurple/protocols/zephyr/ZParseNot.c Sun Apr 14 21:45:09 2013 +0200
+++ b/libpurple/protocols/zephyr/ZParseNot.c Mon Apr 15 00:48:17 2013 +0200
@@ -120,6 +120,9 @@
Z_debug ("ZParseNotice: bad packet from %s/%d (line %d)",
inet_ntoa (notice->z_uid.zuid_addr.s_addr),
notice->z_port, lineno);
+#else
+ /* We won't use lineno anywhere else, so let's silence a warning. */
+ (void)lineno;
#endif
#else
badpkt:
--- a/libpurple/protocols/zephyr/zephyr.c Sun Apr 14 21:45:09 2013 +0200
+++ b/libpurple/protocols/zephyr/zephyr.c Mon Apr 15 00:48:17 2013 +0200
@@ -831,14 +831,13 @@
int len;
char *stripped_sender;
int signature_length = strlen(notice.z_message);
- int message_has_no_body = 0;
PurpleMessageFlags flags = 0;
gchar *tmpescape;
/* Need to deal with 0 length messages to handle typing notification (OPCODE) ping messages */
/* One field zephyrs would have caused purple to crash */
if ( (notice.z_message_len == 0) || (signature_length >= notice.z_message_len - 1)) {
- message_has_no_body = 1;
+ /* message has no body */
len = 0;
purple_debug_info("zephyr","message_size %d %d %d\n",len,notice.z_message_len,signature_length);
buf3 = g_strdup("");
@@ -1083,7 +1082,12 @@
while (select(zephyr->fromtzc[ZEPHYR_FD_READ] + 1, &rfds, NULL, NULL, &tv)) {
selected = 1;
- read(zephyr->fromtzc[ZEPHYR_FD_READ], bufcur, 1);
+ if (read(zephyr->fromtzc[ZEPHYR_FD_READ], bufcur, 1) != 1) {
+ purple_debug_error("zephyr", "couldn't read\n");
+ purple_connection_error(purple_account_get_connection(zephyr->account), PURPLE_CONNECTION_ERROR_NETWORK_ERROR, "couldn't read");
+ free(buf);
+ return NULL;
+ }
bufcur++;
if ((bufcur - buf) > (bufsize - 1)) {
if ((buf = realloc(buf, bufsize * 2)) == NULL) {
@@ -1687,7 +1691,12 @@
FD_SET(zephyr->fromtzc[ZEPHYR_FD_READ], &rfds);
while (select_status > 0 &&
select(zephyr->fromtzc[ZEPHYR_FD_READ] + 1, &rfds, NULL, NULL, &tv) > 0) {
- read(zephyr->fromtzc[ZEPHYR_FD_READ], bufcur, 1);
+ if (read(zephyr->fromtzc[ZEPHYR_FD_READ], bufcur, 1) != 1) {
+ purple_debug_error("zephyr", "couldn't read\n");
+ purple_connection_error(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, "couldn't read");
+ free(buf);
+ return;
+ }
bufcur++;
if ((bufcur - buf) > (bufsize - 1)) {
if ((buf = realloc(buf, bufsize * 2)) == NULL) {
--- a/libpurple/proxy.c Sun Apr 14 21:45:09 2013 +0200
+++ b/libpurple/proxy.c Mon Apr 15 00:48:17 2013 +0200
@@ -979,13 +979,15 @@
major = strtol(p, &p, 10);
error = (major == 0) || (*p != '.');
if(!error) {
+ int minor;
p++;
- /* minor = */ strtol(p, &p, 10);
+ minor = strtol(p, &p, 10);
error = (*p != ' ');
if(!error) {
p++;
status = strtol(p, &p, 10);
error = (*p != ' ');
+ (void)minor; /* we don't need it's value */
}
}
}
--- a/pidgin/gtk3compat.h Sun Apr 14 21:45:09 2013 +0200
+++ b/pidgin/gtk3compat.h Mon Apr 15 00:48:17 2013 +0200
@@ -28,10 +28,15 @@
#if !GTK_CHECK_VERSION(3,2,0)
#define GTK_FONT_CHOOSER GTK_FONT_SELECTION_DIALOG
-#define gtk_font_chooser_dialog_new(x,y) gtk_font_selection_dialog_new(x)
#define gtk_font_chooser_get_font gtk_font_selection_dialog_get_font_name
#define gtk_font_chooser_set_font gtk_font_selection_dialog_set_font_name
+static inline GtkWidget * gtk_font_chooser_dialog_new(const gchar *title,
+ GtkWindow *parent)
+{
+ return gtk_font_selection_dialog_new(title);
+}
+
#if !GTK_CHECK_VERSION(3,0,0)
#define gdk_x11_window_get_xid GDK_WINDOW_XWINDOW
--- a/pidgin/gtkconv-theme.c Sun Apr 14 21:45:09 2013 +0200
+++ b/pidgin/gtkconv-theme.c Mon Apr 15 00:48:17 2013 +0200
@@ -461,9 +461,11 @@
pidgin_conv_theme_init(GTypeInstance *instance,
gpointer klass)
{
+#if 0
PidginConvThemePrivate *priv;
priv = PIDGIN_CONV_THEME_GET_PRIVATE(instance);
+#endif
}
static void
--- a/pidgin/gtkimhtml.c Sun Apr 14 21:45:09 2013 +0200
+++ b/pidgin/gtkimhtml.c Mon Apr 15 00:48:17 2013 +0200
@@ -1558,7 +1558,6 @@
static void gtk_imhtml_class_init (GtkIMHtmlClass *klass)
{
GtkWidgetClass *widget_class = (GtkWidgetClass *) klass;
- GtkBindingSet *binding_set;
GObjectClass *gobject_class;
gobject_class = (GObjectClass*) klass;
parent_class = g_type_class_ref(GTK_TYPE_TEXT_VIEW);
@@ -1714,6 +1713,7 @@
TRUE, G_PARAM_READABLE));
#if 0
+ GtkBindingSet *binding_set;
binding_set = gtk_binding_set_by_class (parent_class);
gtk_binding_entry_add_signal (binding_set, GDK_KEY_b, GDK_CONTROL_MASK, "format_function_toggle", 1, G_TYPE_INT, GTK_IMHTML_BOLD);
gtk_binding_entry_add_signal (binding_set, GDK_KEY_i, GDK_CONTROL_MASK, "format_function_toggle", 1, G_TYPE_INT, GTK_IMHTML_ITALIC);
--- a/pidgin/gtkprefs.c Sun Apr 14 21:45:09 2013 +0200
+++ b/pidgin/gtkprefs.c Mon Apr 15 00:48:17 2013 +0200
@@ -2954,7 +2954,6 @@
GtkWidget *dd;
GtkWidget *label;
GtkWidget *button;
- GtkWidget *select;
GtkWidget *menu;
GtkSizeGroup *sg;
@@ -2977,7 +2976,7 @@
gtk_size_group_add_widget(sg, dd);
gtk_misc_set_alignment(GTK_MISC(dd), 0, 0.5);
- select = pidgin_prefs_labeled_spin_button(vbox,
+ pidgin_prefs_labeled_spin_button(vbox,
_("_Minutes before becoming idle:"), "/purple/away/mins_before_away",
1, 24 * 60, sg);
--- a/pidgin/gtkrequest.c Sun Apr 14 21:45:09 2013 +0200
+++ b/pidgin/gtkrequest.c Mon Apr 15 00:48:17 2013 +0200
@@ -1649,8 +1649,10 @@
{
PidginRequestData *data;
GtkWidget *filesel;
+#ifdef _WIN32
const gchar *current_folder;
gboolean folder_set = FALSE;
+#endif
data = g_new0(PidginRequestData, 1);
data->type = PURPLE_REQUEST_FILE;
@@ -1674,24 +1676,26 @@
NULL);
gtk_dialog_set_default_response(GTK_DIALOG(filesel), GTK_RESPONSE_ACCEPT);
+ if ((filename != NULL) && (*filename != '\0')) {
+ if (savedialog)
+ gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(filesel), filename);
+ else if (g_file_test(filename, G_FILE_TEST_EXISTS))
+ gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(filesel), filename);
+ }
+
+#ifdef _WIN32
+
if (savedialog) {
current_folder = purple_prefs_get_path(PIDGIN_PREFS_ROOT "/filelocations/last_save_folder");
} else {
current_folder = purple_prefs_get_path(PIDGIN_PREFS_ROOT "/filelocations/last_open_folder");
}
- if ((filename != NULL) && (*filename != '\0')) {
- if (savedialog)
- gtk_file_chooser_set_current_name(GTK_FILE_CHOOSER(filesel), filename);
- else if (g_file_test(filename, G_FILE_TEST_EXISTS))
- gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(filesel), filename);
- }
if ((filename == NULL || *filename == '\0' || !g_file_test(filename, G_FILE_TEST_EXISTS)) &&
(current_folder != NULL) && (*current_folder != '\0')) {
folder_set = gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(filesel), current_folder);
}
-#ifdef _WIN32
if (!folder_set && (filename == NULL || *filename == '\0' || !g_file_test(filename, G_FILE_TEST_EXISTS))) {
char *my_documents = wpurple_get_special_folder(CSIDL_PERSONAL);