pidgin: dc85c232: This cleans up a bunch of warnings that ...

rekkanoryo at pidgin.im rekkanoryo at pidgin.im
Fri May 2 22:15:51 EDT 2008


-----------------------------------------------------------------
Revision: dc85c2329304dd6f567820b55939193328f9e506
Ancestor: de954c20849206de750b57c34fb04dd7b8a8833a
Author: rekkanoryo at pidgin.im
Date: 2008-05-03T02:12:26
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/dc85c2329304dd6f567820b55939193328f9e506

Modified files:
        libpurple/protocols/msn/command.c
        libpurple/protocols/msn/msn.c
        libpurple/protocols/msn/notification.c
        libpurple/protocols/msn/slplink.c
        libpurple/protocols/msn/soap.c
        libpurple/protocols/msn/state.c
        libpurple/protocols/msn/switchboard.c

ChangeLog: 

This cleans up a bunch of warnings that stem from the fact that size_t and
gsize have different sizes on different platforms.

-------------- next part --------------
============================================================
--- libpurple/protocols/msn/command.c	af4d995cb608a0725ff07b9551e63e0c8c969f86
+++ libpurple/protocols/msn/command.c	8ee8a3a61b15e0c7ce616e449c7a76f4988a2230
@@ -121,7 +121,7 @@ msn_command_from_string(const char *stri
 	/* khc: Huh! */
 	/*add payload Length checking*/
 	msn_set_payload_len(cmd);
-	purple_debug_info("MSNP14","get payload len:%d\n",cmd->payload_len);
+	purple_debug_info("MSNP14","get payload len:%" G_GSIZE_FORMAT "\n", cmd->payload_len);
 
 	msn_command_ref(cmd);
 
============================================================
--- libpurple/protocols/msn/msn.c	6ce042f757eef19bfda47427cb21f176131e14bd
+++ libpurple/protocols/msn/msn.c	b2b65704a3209caa94f97363ec9eff777c37db59
@@ -239,7 +239,7 @@ send_to_mobile(PurpleConnection *gc, con
 	MsnUser *user;
 	char *payload = NULL;
 	const char *mobile_number = NULL;
-	size_t payload_len;
+	gsize payload_len;
 
 	session = gc->proto_data;
 	cmdproc = session->notification->cmdproc;
@@ -254,13 +254,13 @@ send_to_mobile(PurpleConnection *gc, con
 		mobile_number[0] == '+') {
 		/* if msn_user_get_mobile_phone() has a + in front, it's a number
 		   that from the buddy's contact card */
-		trans = msn_transaction_new(cmdproc, "PGD", "tel:%s 1 %d",
+		trans = msn_transaction_new(cmdproc, "PGD", "tel:%s 1 %" G_GSIZE_FORMAT,
 			mobile_number, payload_len);
 	} else {
 		/* otherwise we send to whatever phone number the buddy registered
 		   with msn */
-		trans = msn_transaction_new(cmdproc, "PGD", "%s 1 %d", who,
-			payload_len);
+		trans = msn_transaction_new(cmdproc, "PGD", "%s 1 %" G_GSIZE_FORMAT,
+			who, payload_len);
 	}
 
 	msn_transaction_set_payload(trans, payload, payload_len);
@@ -2071,7 +2071,7 @@ msn_got_photo(PurpleUtilFetchUrlData *ur
 
 static void
 msn_got_photo(PurpleUtilFetchUrlData *url_data, gpointer user_data,
-		const gchar *url_text, size_t len, const gchar *error_message)
+		const gchar *url_text, gsize len, const gchar *error_message)
 {
 	MsnGetInfoStepTwoData *info2_data = (MsnGetInfoStepTwoData *)user_data;
 	int id = -1;
@@ -2113,7 +2113,7 @@ msn_got_photo(PurpleUtilFetchUrlData *ur
 		else
 		{
 			char buf[1024];
-			purple_debug_info("msn", "%s is %d bytes\n", photo_url_text, len);
+			purple_debug_info("msn", "%s is %" G_GSIZE_FORMAT " bytes\n", photo_url_text, len);
 			id = purple_imgstore_add_with_id(g_memdup(url_text, len), len, NULL);
 			g_snprintf(buf, sizeof(buf), "<img id=\"%d\"><br>", id);
 			purple_notify_user_info_prepend_pair(user_info, NULL, buf);
============================================================
--- libpurple/protocols/msn/notification.c	fd21b93550aba8a1df08fab46314ece42fac476d
+++ libpurple/protocols/msn/notification.c	4024481f241bd238d95124f90f00fa8251e8d85a
@@ -414,7 +414,7 @@ msg_cmd(MsnCmdProc *cmdproc, MsnCommand 
 	{
 		g_return_if_fail(cmd->payload_cb != NULL);
 
-		purple_debug_info("MSNP14","MSG payload:{%.*s}\n",cmd->payload_len, cmd->payload);
+		purple_debug_info("MSNP14", "MSG payload:{%.*s}\n", (guint)(cmd->payload_len), cmd->payload);
 		cmd->payload_cb(cmdproc, cmd, cmd->payload, cmd->payload_len);
 	}
 }
@@ -432,10 +432,12 @@ uum_send_msg(MsnSession *session,MsnMess
 	cmdproc = session->notification->cmdproc;
 	g_return_if_fail(msg     != NULL);
 	payload = msn_message_gen_payload(msg, &payload_len);
-	purple_debug_info("MSNP14","send UUM,payload{%s},strlen:%d,len:%d\n",
-		payload,strlen(payload),payload_len);
+	purple_debug_info("MSNP14",
+		"send UUM, payload{%s}, strlen:%" G_GSIZE_FORMAT ", len:%" G_GSIZE_FORMAT "\n",
+		payload, strlen(payload), payload_len);
 	type = msg->type;
-	trans = msn_transaction_new(cmdproc, "UUM","%s 32 %d %d",msg->remote_user,type,payload_len);
+	trans = msn_transaction_new(cmdproc, "UUM", "%s 32 %d %" G_GSIZE_FORMAT,
+		msg->remote_user, type, payload_len);
 	msn_transaction_set_payload(trans, payload, strlen(payload));
 	msn_cmdproc_send_trans(cmdproc, trans);
 }
@@ -449,7 +451,7 @@ ubm_cmd_post(MsnCmdProc *cmdproc, MsnCom
 	const char *passport;
 	const char *content_type;
 
-	purple_debug_info("MSNP14","Process UBM payload:%.*s\n", len, payload);
+	purple_debug_info("MSNP14","Process UBM payload:%.*s\n", (guint)len, payload);
 	msg = msn_message_new_from_cmd(cmdproc->session, cmd);
 
 	msn_message_parse_payload(msg, payload, len,MSG_LINE_DEM,MSG_BODY_DEM);
@@ -530,7 +532,7 @@ ubm_cmd(MsnCmdProc *cmdproc, MsnCommand 
 	}else{
 		g_return_if_fail(cmd->payload_cb != NULL);
 
-		purple_debug_info("MSNP14","UBM payload:{%.*s}\n", cmd->payload_len, cmd->payload);
+		purple_debug_info("MSNP14", "UBM payload:{%.*s}\n", (guint)(cmd->payload_len), cmd->payload);
 		ubm_cmd_post(cmdproc, cmd, cmd->payload, cmd->payload_len);
 	}
 }
@@ -645,7 +647,7 @@ msn_notification_post_adl(MsnCmdProc *cm
 {
 	MsnTransaction *trans;
 	purple_debug_info("MSN Notification","Sending ADL with payload: %s\n", payload);
-	trans = msn_transaction_new(cmdproc, "ADL","%d", strlen(payload));
+	trans = msn_transaction_new(cmdproc, "ADL","%" G_GSIZE_FORMAT, strlen(payload));
 	msn_transaction_set_payload(trans, payload, strlen(payload));
 	msn_cmdproc_send_trans(cmdproc, trans);
 }
@@ -729,7 +731,7 @@ msn_notification_send_fqy(MsnSession *se
 	domain = tokens[1];
 
 	payload = g_strdup_printf("<ml><d n=\"%s\"><c n=\"%s\"/></d></ml>", domain, email);
-	trans = msn_transaction_new(cmdproc, "FQY","%d", strlen(payload));
+	trans = msn_transaction_new(cmdproc, "FQY","%" G_GSIZE_FORMAT, strlen(payload));
 	msn_transaction_set_payload(trans, payload, strlen(payload));
 	msn_cmdproc_send_trans(cmdproc, trans);
 
@@ -2070,7 +2072,7 @@ msn_notification_rem_buddy_from_list(Msn
 	xmlnode_free(rml_node);
 
 	purple_debug_info("MSN Notification","Send RML with payload:\n%s\n", payload);
-	trans = msn_transaction_new(cmdproc, "RML","%d", strlen(payload));
+	trans = msn_transaction_new(cmdproc, "RML","%" G_GSIZE_FORMAT, strlen(payload));
 	msn_transaction_set_payload(trans, payload, strlen(payload));
 	msn_cmdproc_send_trans(cmdproc, trans);
 	g_free(payload);
============================================================
--- libpurple/protocols/msn/slplink.c	621ca0ce1d83e0375d9842d9d4485da97124f0e4
+++ libpurple/protocols/msn/slplink.c	e227291ffa8aaf340455f2408c4a24271da3612f
@@ -598,7 +598,9 @@ msn_slplink_process_msg(MsnSlpLink *slpl
 	{
 		if ((offset + len) > slpmsg->size)
 		{
-			purple_debug_error("msn", "Oversized slpmsg - msgsize=%lld offset=%d len=%d\n", slpmsg->size, offset, len);
+			purple_debug_error("msn",
+				"Oversized slpmsg - msgsize=%lld offset=%" G_GSIZE_FORMAT " len=%" G_GSIZE_FORMAT "\n",
+				slpmsg->size, offset, len);
 			g_return_if_reached();
 		}
 		else
============================================================
--- libpurple/protocols/msn/soap.c	7ff6d18928808d87a0c0d0e538f528144e93e088
+++ libpurple/protocols/msn/soap.c	5da79a60cf213277405c11c7a7f68a97748d926f
@@ -273,7 +273,7 @@ msn_soap_read(MsnSoapConn *soapconn)
 			case EAGAIN: return len;
 
 			default : purple_debug_error("MSN SOAP", "Read error!"
-						"read len: %d, error = %s\n",
+						"read len: %" G_GSSIZE_FORMAT ", error = %s\n",
 						len, g_strerror(errno));
 				  purple_input_remove(soapconn->input_handler);
 				  //soapconn->input_handler = 0;
@@ -293,7 +293,9 @@ msn_soap_read(MsnSoapConn *soapconn)
 			soapconn->read_buf[soapconn->read_len] = '\0';
 		}
 		else {
-			purple_debug_error("MSN SOAP", "Failure re-allocating %d bytes of memory!\n", soapconn->read_len + len + 1);
+			purple_debug_error("MSN SOAP",
+				"Failure re-allocating %" G_GSIZE_FORMAT " bytes of memory!\n",
+				soapconn->read_len + len + 1);
 			exit(EXIT_FAILURE);
 		}
 			
@@ -301,7 +303,9 @@ msn_soap_read(MsnSoapConn *soapconn)
 
 #if defined(MSN_SOAP_DEBUG)
 	if (len > 0)
-		purple_debug_info("MSN SOAP","Read %d bytes from SOAP server:\n%s\n", len, soapconn->read_buf + soapconn->read_len - len);
+		purple_debug_info("MSN SOAP",
+			"Read %" G_GSIZE_FORMAT " bytes from SOAP server:\n%s\n", len,
+			soapconn->read_buf + soapconn->read_len - len);
 #endif
 
 	return len;
@@ -523,7 +527,9 @@ msn_soap_read_cb(gpointer data, gint sou
 		soapconn->body_len	= atoi(body_len);
 		g_free(body_len);
 #ifdef MSN_SOAP_DEBUG
-		purple_debug_misc("MSN SOAP","SOAP bytes read so far: %d, Content-Length: %d\n", soapconn->read_len, soapconn->body_len);
+		purple_debug_misc("MSN SOAP",
+			"SOAP bytes read so far: %" G_GSIZE_FORMAT ", Content-Length: %d\n",
+			soapconn->read_len, soapconn->body_len);
 #endif
 		soapconn->need_to_read = (body_start - soapconn->read_buf + soapconn->body_len) - soapconn->read_len;
 		if ( soapconn->need_to_read > 0 ) {
============================================================
--- libpurple/protocols/msn/state.c	54706d075bbd006759acb584ca5c381256c9bea2
+++ libpurple/protocols/msn/state.c	846a59dda2961d229bcea61bd39a1f89027e4f99
@@ -250,7 +250,7 @@ msn_set_psm(MsnSession *session)
 
 	payload = session->psm;
 	purple_debug_misc("MSNP14","Sending UUX command with payload: %s\n",payload);
-	trans = msn_transaction_new(cmdproc, "UUX", "%d", strlen(payload));
+	trans = msn_transaction_new(cmdproc, "UUX", "%" G_GSIZE_FORMAT, strlen(payload));
 	msn_transaction_set_payload(trans, payload, strlen(payload));
 	msn_cmdproc_send_trans(cmdproc, trans);
 
============================================================
--- libpurple/protocols/msn/switchboard.c	61652dd677faa0d66c162565c8f7145c7091c106
+++ libpurple/protocols/msn/switchboard.c	e617676518a2e8c2d583f10222670ba4d0a8a6ef
@@ -544,7 +544,7 @@ release_msg(MsnSwitchBoard *swboard, Msn
 	msn_message_show_readable(msg, "SB SEND", FALSE);
 #endif
 
-	trans = msn_transaction_new(cmdproc, "MSG", "%c %d",
+	trans = msn_transaction_new(cmdproc, "MSG", "%c %" G_GSIZE_FORMAT,
 								msn_message_get_flag(msg), payload_len);
 
 	/* Data for callbacks */


More information about the Commits mailing list