comparison libpurple/protocols/msn/msn.c @ 22798:05cb3f04c01e

This cleans up a bunch of warnings that stem from the fact that size_t and gsize have different sizes on different platforms.
author John Bailey <rekkanoryo@rekkanoryo.org>
date Sat, 03 May 2008 02:12:26 +0000
parents 6aa076a2ea6f
children 8c3444f04709 ac567757d236 d756a0477c06 1dd0e007514d
comparison
equal deleted inserted replaced
22796:5e6b42e77fb7 22798:05cb3f04c01e
237 MsnCmdProc *cmdproc; 237 MsnCmdProc *cmdproc;
238 MsnPage *page; 238 MsnPage *page;
239 MsnUser *user; 239 MsnUser *user;
240 char *payload = NULL; 240 char *payload = NULL;
241 const char *mobile_number = NULL; 241 const char *mobile_number = NULL;
242 size_t payload_len; 242 gsize payload_len;
243 243
244 session = gc->proto_data; 244 session = gc->proto_data;
245 cmdproc = session->notification->cmdproc; 245 cmdproc = session->notification->cmdproc;
246 246
247 page = msn_page_new(); 247 page = msn_page_new();
252 if ((user = msn_userlist_find_user(session->userlist, who)) && 252 if ((user = msn_userlist_find_user(session->userlist, who)) &&
253 (mobile_number = msn_user_get_mobile_phone(user)) && 253 (mobile_number = msn_user_get_mobile_phone(user)) &&
254 mobile_number[0] == '+') { 254 mobile_number[0] == '+') {
255 /* if msn_user_get_mobile_phone() has a + in front, it's a number 255 /* if msn_user_get_mobile_phone() has a + in front, it's a number
256 that from the buddy's contact card */ 256 that from the buddy's contact card */
257 trans = msn_transaction_new(cmdproc, "PGD", "tel:%s 1 %d", 257 trans = msn_transaction_new(cmdproc, "PGD", "tel:%s 1 %" G_GSIZE_FORMAT,
258 mobile_number, payload_len); 258 mobile_number, payload_len);
259 } else { 259 } else {
260 /* otherwise we send to whatever phone number the buddy registered 260 /* otherwise we send to whatever phone number the buddy registered
261 with msn */ 261 with msn */
262 trans = msn_transaction_new(cmdproc, "PGD", "%s 1 %d", who, 262 trans = msn_transaction_new(cmdproc, "PGD", "%s 1 %" G_GSIZE_FORMAT,
263 payload_len); 263 who, payload_len);
264 } 264 }
265 265
266 msn_transaction_set_payload(trans, payload, payload_len); 266 msn_transaction_set_payload(trans, payload, payload_len);
267 g_free(payload); 267 g_free(payload);
268 268
2069 } 2069 }
2070 } 2070 }
2071 2071
2072 static void 2072 static void
2073 msn_got_photo(PurpleUtilFetchUrlData *url_data, gpointer user_data, 2073 msn_got_photo(PurpleUtilFetchUrlData *url_data, gpointer user_data,
2074 const gchar *url_text, size_t len, const gchar *error_message) 2074 const gchar *url_text, gsize len, const gchar *error_message)
2075 { 2075 {
2076 MsnGetInfoStepTwoData *info2_data = (MsnGetInfoStepTwoData *)user_data; 2076 MsnGetInfoStepTwoData *info2_data = (MsnGetInfoStepTwoData *)user_data;
2077 int id = -1; 2077 int id = -1;
2078 2078
2079 /* Unmarshall the saved state */ 2079 /* Unmarshall the saved state */
2111 photo_url_text, url_text); 2111 photo_url_text, url_text);
2112 } 2112 }
2113 else 2113 else
2114 { 2114 {
2115 char buf[1024]; 2115 char buf[1024];
2116 purple_debug_info("msn", "%s is %d bytes\n", photo_url_text, len); 2116 purple_debug_info("msn", "%s is %" G_GSIZE_FORMAT " bytes\n", photo_url_text, len);
2117 id = purple_imgstore_add_with_id(g_memdup(url_text, len), len, NULL); 2117 id = purple_imgstore_add_with_id(g_memdup(url_text, len), len, NULL);
2118 g_snprintf(buf, sizeof(buf), "<img id=\"%d\"><br>", id); 2118 g_snprintf(buf, sizeof(buf), "<img id=\"%d\"><br>", id);
2119 purple_notify_user_info_prepend_pair(user_info, NULL, buf); 2119 purple_notify_user_info_prepend_pair(user_info, NULL, buf);
2120 } 2120 }
2121 } 2121 }