pidgin: f1393851: Fix this compiler warning:

nosnilmot at pidgin.im nosnilmot at pidgin.im
Thu Jul 9 22:30:26 EDT 2009


-----------------------------------------------------------------
Revision: f139385141b58d312c5410c33e908cabe63993e4
Ancestor: bd005861cf3abdbc22c2cbbc9e207663d787b069
Author: nosnilmot at pidgin.im
Date: 2009-07-10T02:26:37
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/f139385141b58d312c5410c33e908cabe63993e4

Modified files:
        libpurple/internal.h libpurple/protocols/oscar/clientlogin.c

ChangeLog: 

Fix this compiler warning:
clientlogin.c: In function 'send_start_oscar_session':
clientlogin.c:293: warning: format '%zu' expects type 'size_t', but argument 4 has type 'time_t'

I'm not sure it's 100% right this way but it preserves what was there
before for 64bit CPUs and makes my old crap happy too.

-------------- next part --------------
============================================================
--- libpurple/internal.h	63b8d5809283f9fed738255d8a76511c755d178f
+++ libpurple/internal.h	ea15491800a06de23ed507ea0768abf6b6567f65
@@ -230,6 +230,14 @@
 #	endif
 #endif
 
+#if SIZEOF_TIME_T == 4
+#	define PURPLE_TIME_T_MODIFIER "lu"
+#elif SIZEOF_TIME_T == 8
+#	define PURPLE_TIME_T_MODIFIER "zu"
+#else
+#error Unknown size of time_t
+#endif
+
 #include <glib-object.h>
 
 #ifndef G_DEFINE_TYPE
============================================================
--- libpurple/protocols/oscar/clientlogin.c	2ec57aff2d34686089de94ccb0a82548a3cd0b3c
+++ libpurple/protocols/oscar/clientlogin.c	1222f2616809bea3655bd0d4dfce1f63500a819e
@@ -288,7 +288,7 @@ static void send_start_oscar_session(Osc
 	query_string = g_strdup_printf("a=%s"
 			"&f=xml"
 			"&k=%s"
-			"&ts=%zu"
+			"&ts=%" PURPLE_TIME_T_MODIFIER
 			"&useTLS=0",
 			oscar_auth_url_encode(token), get_client_key(od), hosttime);
 	signature = generate_signature("GET", URL_START_OSCAR_SESSION,


More information about the Commits mailing list