/soc/2013/ankitkv/gobjectification: 7899f9edf4f1: Merged soc.201...

Ankit Vani a at nevitus.org
Sun Oct 20 08:49:49 EDT 2013


Changeset: 7899f9edf4f15d80ee9e78858f387cfe282ef672
Author:	 Ankit Vani <a at nevitus.org>
Date:	 2013-10-20 18:19 +0530
Branch:	 soc.2013.gobjectification.plugins
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/7899f9edf4f1

Description:

Merged soc.2013.gobjectification branch

diffstat:

 libpurple/ciphers/aescipher.c              |   2 +-
 libpurple/example/nullclient.c             |   2 ++
 libpurple/protocols/gg/edisc.c             |  10 +++++-----
 libpurple/protocols/irc/dcc_send.c         |   4 ++--
 libpurple/protocols/irc/parse.c            |   2 +-
 libpurple/protocols/jabber/si.c            |   2 +-
 libpurple/protocols/msn/nexus.c            |   2 +-
 libpurple/protocols/yahoo/yahoo_filexfer.c |   2 +-
 libpurple/util.c                           |   2 +-
 libpurple/xfer.c                           |   8 ++++----
 pidgin/gtkwebviewtoolbar.c                 |   4 ++--
 11 files changed, 21 insertions(+), 19 deletions(-)

diffs (213 lines):

diff --git a/libpurple/ciphers/aescipher.c b/libpurple/ciphers/aescipher.c
--- a/libpurple/ciphers/aescipher.c
+++ b/libpurple/ciphers/aescipher.c
@@ -372,7 +372,7 @@ purple_aes_cipher_nss_crypt(const guchar
 	purple_aes_cipher_nss_cleanup(&context);
 
 	outlen += outlen_tmp;
-	if (outlen != len) {
+	if (outlen != (int)len) {
 		purple_debug_error("cipher-aes",
 			"resulting length doesn't match: %d (expected: %lu)\n",
 			outlen, len);
diff --git a/libpurple/example/nullclient.c b/libpurple/example/nullclient.c
--- a/libpurple/example/nullclient.c
+++ b/libpurple/example/nullclient.c
@@ -108,6 +108,7 @@ static PurpleEventLoopUiOps glib_eventlo
 	/* padding */
 	NULL,
 	NULL,
+	NULL,
 	NULL
 };
 /*** End of the eventloop functions. ***/
@@ -174,6 +175,7 @@ static PurpleCoreUiOps null_core_uiops =
 	NULL,
 	NULL,
 	NULL,
+	NULL,
 	NULL
 };
 
diff --git a/libpurple/protocols/gg/edisc.c b/libpurple/protocols/gg/edisc.c
--- a/libpurple/protocols/gg/edisc.c
+++ b/libpurple/protocols/gg/edisc.c
@@ -528,7 +528,7 @@ static void ggp_edisc_xfer_send_reader(P
 
 	if (edisc_xfer->already_read != offset) {
 		purple_debug_error("gg", "ggp_edisc_xfer_send_reader: "
-			"Invalid offset (%d != %" G_GSIZE_FORMAT ")\n",
+			"Invalid offset (%" G_GSIZE_FORMAT " != %" G_GSIZE_FORMAT ")\n",
 			edisc_xfer->already_read, offset);
 		ggp_edisc_xfer_error(xfer, _("Error while reading a file"));
 		return;
@@ -541,7 +541,7 @@ static void ggp_edisc_xfer_send_reader(P
 	else {
 		success = TRUE;
 		edisc_xfer->already_read += stored;
-		eof = (edisc_xfer->already_read >= purple_xfer_get_size(xfer));
+		eof = ((goffset)edisc_xfer->already_read >= purple_xfer_get_size(xfer));
 	}
 
 	cb(hc, success, eof, stored);
@@ -974,7 +974,7 @@ static gboolean ggp_edisc_xfer_recv_writ
 	g_return_val_if_fail(edisc_xfer != NULL, FALSE);
 
 	stored = purple_xfer_write_file(xfer, (guchar *)buffer, length) ?
-			length : -1;
+			(gssize)length : -1;
 
 	if (stored < 0 || (gsize)stored != length) {
 		purple_debug_error("gg", "ggp_edisc_xfer_recv_writer: "
@@ -984,8 +984,8 @@ static gboolean ggp_edisc_xfer_recv_writ
 
 	if (stored > purple_xfer_get_bytes_remaining(xfer)) {
 		purple_debug_error("gg", "ggp_edisc_xfer_recv_writer: "
-			"saved too much (%d > %d)\n",
-			stored, (int)purple_xfer_get_bytes_remaining(xfer));
+			"saved too much (%" G_GSSIZE_FORMAT " > %" G_GOFFSET_FORMAT ")\n",
+			stored, purple_xfer_get_bytes_remaining(xfer));
 		return FALSE;
 	}
 
diff --git a/libpurple/protocols/irc/dcc_send.c b/libpurple/protocols/irc/dcc_send.c
--- a/libpurple/protocols/irc/dcc_send.c
+++ b/libpurple/protocols/irc/dcc_send.c
@@ -216,7 +216,7 @@ static void irc_dccsend_send_read(gpoint
 			xd->rxqueue = NULL;
 		}
 
-		if (acked >= purple_xfer_get_size(xfer)) {
+		if ((goffset)acked >= purple_xfer_get_size(xfer)) {
 			purple_input_remove(xd->inpa);
 			xd->inpa = 0;
 			purple_xfer_set_completed(xfer, TRUE);
@@ -231,7 +231,7 @@ static gssize irc_dccsend_send_write(con
 	gssize s;
 	gssize ret;
 
-	s = MIN(purple_xfer_get_bytes_remaining(xfer), size);
+	s = MIN((gssize)purple_xfer_get_bytes_remaining(xfer), (gssize)size);
 	if (!s)
 		return 0;
 
diff --git a/libpurple/protocols/irc/parse.c b/libpurple/protocols/irc/parse.c
--- a/libpurple/protocols/irc/parse.c
+++ b/libpurple/protocols/irc/parse.c
@@ -397,7 +397,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 ? (goffset)(end - cur) : strlen(cur)));
+		decoded = g_string_append_len(decoded, cur, (end ? (gssize)(end - cur) : (gssize)strlen(cur)));
 		cur = end ? end : cur + strlen(cur);
 
 		switch (*cur) {
diff --git a/libpurple/protocols/jabber/si.c b/libpurple/protocols/jabber/si.c
--- a/libpurple/protocols/jabber/si.c
+++ b/libpurple/protocols/jabber/si.c
@@ -1008,7 +1008,7 @@ jabber_si_xfer_ibb_recv_data_cb(JabberIB
 	PurpleXfer *xfer = (PurpleXfer *) jabber_ibb_session_get_user_data(sess);
 	JabberSIXfer *jsx = purple_xfer_get_protocol_data(xfer);
 
-	if (size <= purple_xfer_get_bytes_remaining(xfer)) {
+	if ((goffset)size <= purple_xfer_get_bytes_remaining(xfer)) {
 		purple_debug_info("jabber", "about to write %" G_GSIZE_FORMAT " bytes from IBB stream\n",
 			size);
 		purple_circular_buffer_append(jsx->ibb_buffer, data, size);
diff --git a/libpurple/protocols/msn/nexus.c b/libpurple/protocols/msn/nexus.c
--- a/libpurple/protocols/msn/nexus.c
+++ b/libpurple/protocols/msn/nexus.c
@@ -403,7 +403,7 @@ msn_nexus_connect(MsnNexus *nexus)
 	domains = g_string_new(NULL);
 	for (i = 0; i < nexus->token_len; i++) {
 		g_string_append_printf(domains, MSN_SSO_RST_TEMPLATE,
-		                       i+1,
+		                       (int)i+1,
 		                       ticket_domains[i][SSO_VALID_TICKET_DOMAIN],
 		                       ticket_domains[i][SSO_VALID_TICKET_POLICY] != NULL ?
 		                           ticket_domains[i][SSO_VALID_TICKET_POLICY] :
diff --git a/libpurple/protocols/yahoo/yahoo_filexfer.c b/libpurple/protocols/yahoo/yahoo_filexfer.c
--- a/libpurple/protocols/yahoo/yahoo_filexfer.c
+++ b/libpurple/protocols/yahoo/yahoo_filexfer.c
@@ -812,7 +812,7 @@ yahoo_process_filetrans_15_reader(Purple
 	PurpleXfer *xfer = _xfer;
 	gssize stored;
 
-	if (offset != purple_xfer_get_bytes_sent(xfer)) {
+	if ((goffset)offset != purple_xfer_get_bytes_sent(xfer)) {
 		purple_debug_warning("yahoo",
 			"offset != purple_xfer_get_bytes_sent(xfer)\n");
 	}
diff --git a/libpurple/util.c b/libpurple/util.c
--- a/libpurple/util.c
+++ b/libpurple/util.c
@@ -3082,7 +3082,7 @@ purple_util_write_data_to_file_absolute(
 		return FALSE;
 	}
 	/* Use stat to be absolutely sure. */
-	if ((g_stat(filename_temp, &st) == -1) || (st.st_size != real_size))
+	if ((g_stat(filename_temp, &st) == -1) || (st.st_size != (off_t)real_size))
 	{
 		purple_debug_error("util", "Error writing data to file %s: "
 				   "Incomplete file written; is your disk "
diff --git a/libpurple/xfer.c b/libpurple/xfer.c
--- a/libpurple/xfer.c
+++ b/libpurple/xfer.c
@@ -1173,7 +1173,7 @@ purple_xfer_read(PurpleXfer *xfer, gucha
 	if (purple_xfer_get_size(xfer) == 0)
 		s = priv->current_buffer_size;
 	else
-		s = MIN(purple_xfer_get_bytes_remaining(xfer), priv->current_buffer_size);
+		s = MIN((gssize)purple_xfer_get_bytes_remaining(xfer), (gssize)priv->current_buffer_size);
 
 	if (priv->ops.read != NULL)	{
 		r = (priv->ops.read)(buffer, xfer);
@@ -1211,7 +1211,7 @@ purple_xfer_write(PurpleXfer *xfer, cons
 	g_return_val_if_fail(buffer != NULL, 0);
 	g_return_val_if_fail(size   != 0,    0);
 
-	s = MIN(purple_xfer_get_bytes_remaining(xfer), size);
+	s = MIN((gssize)purple_xfer_get_bytes_remaining(xfer), (gssize)size);
 
 	if (priv->ops.write != NULL) {
 		r = (priv->ops.write)(buffer, s, xfer);
@@ -1242,7 +1242,7 @@ purple_xfer_write_file(PurpleXfer *xfer,
 	ui_ops = purple_xfer_get_ui_ops(xfer);
 	fs_known = (purple_xfer_get_size(xfer) > 0);
 
-	if (fs_known && size > purple_xfer_get_bytes_remaining(xfer)) {
+	if (fs_known && (goffset)size > purple_xfer_get_bytes_remaining(xfer)) {
 		purple_debug_warning("filetransfer",
 			"Got too much data (truncating at %" G_GOFFSET_FORMAT
 			").\n", purple_xfer_get_size(xfer));
@@ -1356,7 +1356,7 @@ do_transfer(PurpleXfer *xfer)
 		}
 	} else if (priv->type == PURPLE_XFER_TYPE_SEND) {
 		gssize result = 0;
-		size_t s = MIN(purple_xfer_get_bytes_remaining(xfer), priv->current_buffer_size);
+		gsize s = MIN((gsize)purple_xfer_get_bytes_remaining(xfer), (gsize)priv->current_buffer_size);
 		gboolean read = TRUE;
 
 		/* this is so the protocol can keep the connection open
diff --git a/pidgin/gtkwebviewtoolbar.c b/pidgin/gtkwebviewtoolbar.c
--- a/pidgin/gtkwebviewtoolbar.c
+++ b/pidgin/gtkwebviewtoolbar.c
@@ -1529,7 +1529,7 @@ gtk_webviewtoolbar_init(GtkWebViewToolba
 	gtk_action_set_sensitive(priv->attention, FALSE);
 
 	gtk_action_set_sensitive(priv->smiley,
-		(gboolean)pidgin_themes_get_proto_smileys(NULL));
+		pidgin_themes_get_proto_smileys(NULL) != NULL);
 
 	purple_prefs_connect_callback(toolbar,
 	                              PIDGIN_PREFS_ROOT "/conversations/toolbar/wide",
@@ -1632,7 +1632,7 @@ gtk_webviewtoolbar_switch_active_convers
 		PURPLE_PROTOCOL_IMPLEMENTS(protocol, ATTENTION_IFACE, send));
 
 	gtk_action_set_sensitive(priv->smiley,
-		(gboolean)pidgin_themes_get_proto_smileys(priv->sml));
+		pidgin_themes_get_proto_smileys(priv->sml) != NULL);
 }
 
 void



More information about the Commits mailing list