pidgin.openq: 9d994d81: Change Qun number to unsigned long

ccpaging at pidgin.im ccpaging at pidgin.im
Wed Dec 3 23:21:34 EST 2008


-----------------------------------------------------------------
Revision: 9d994d815f8715368faf09a840d5efcdacb2aba1
Ancestor: 596479315cce1fda89c9f97826aecd9461854e33
Author: ccpaging at pidgin.im
Date: 2008-11-11T07:10:33
Branch: im.pidgin.pidgin.openq
URL: http://d.pidgin.im/viewmtn/revision/info/9d994d815f8715368faf09a840d5efcdacb2aba1

Modified files:
        libpurple/protocols/qq/group_internal.c

ChangeLog: 

Change Qun number to unsigned long

-------------- next part --------------
============================================================
--- libpurple/protocols/qq/group_internal.c	36a9a905f7fdfdb9c90c1916f86263c60bdf8ee4
+++ libpurple/protocols/qq/group_internal.c	0c1a9a139300f02d86f979b5ab665e2e17f8b255
@@ -34,8 +34,9 @@ static qq_room_data *room_data_new(guint
 {
 	qq_room_data *rmd;
 
-	purple_debug_info("QQ", "Created room data: %s, ext id %d, id %d\n",
-			title, ext_id, id);
+	purple_debug_info("QQ", "Created room data: %s, ext id %u, id %u\n",
+			title == NULL ? "(NULL)" : title,
+			ext_id, id);
 	rmd = g_new0(qq_room_data, 1);
 	rmd->my_role = QQ_ROOM_ROLE_NO;
 	rmd->id = id;
@@ -60,9 +61,9 @@ static qq_room_data *room_data_new_by_ha
 	gchar *value;
 
 	value = g_hash_table_lookup(data, QQ_ROOM_KEY_INTERNAL_ID);
-	id = value ? strtol(value, NULL, 10) : 0;
+	id = value ? strtoul(value, NULL, 10) : 0;
 	value= g_hash_table_lookup(data, QQ_ROOM_KEY_EXTERNAL_ID);
-	ext_id = value ? strtol(value, NULL, 10) : 0;
+	ext_id = value ? strtoul(value, NULL, 10) : 0;
 	value = g_strdup(g_hash_table_lookup(data, QQ_ROOM_KEY_TITLE_UTF8));
 
 	rmd = room_data_new(id, ext_id, value);
@@ -107,10 +108,10 @@ void qq_room_update_chat_info(PurpleChat
 	}
 	g_hash_table_replace(chat->components,
 		     g_strdup(QQ_ROOM_KEY_INTERNAL_ID),
-		     g_strdup_printf("%d", rmd->id));
+		     g_strdup_printf("%u", rmd->id));
 	g_hash_table_replace(chat->components,
 		     g_strdup(QQ_ROOM_KEY_EXTERNAL_ID),
-		     g_strdup_printf("%d", rmd->ext_id));
+		     g_strdup_printf("%u", rmd->ext_id));
 	g_hash_table_replace(chat->components,
 		     g_strdup(QQ_ROOM_KEY_TITLE_UTF8), g_strdup(rmd->title_utf8));
 }
@@ -121,15 +122,15 @@ static PurpleChat *chat_new(PurpleConnec
 	PurpleGroup *g;
 	PurpleChat *chat;
 
-	purple_debug_info("QQ", "Add new chat: id %d, ext id %d, title %s\n",
+	purple_debug_info("QQ", "Add new chat: id %u, ext id %u, title %s\n",
 		rmd->id, rmd->ext_id,
 		rmd->title_utf8 == NULL ? "(NULL)" : rmd->title_utf8);
 
 	components = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free);
 	g_hash_table_insert(components,
-			    g_strdup(QQ_ROOM_KEY_INTERNAL_ID), g_strdup_printf("%d", rmd->id));
+			    g_strdup(QQ_ROOM_KEY_INTERNAL_ID), g_strdup_printf("%u", rmd->id));
 	g_hash_table_insert(components, g_strdup(QQ_ROOM_KEY_EXTERNAL_ID),
-			    g_strdup_printf("%d", rmd->ext_id));
+			    g_strdup_printf("%u", rmd->ext_id));
 	g_hash_table_insert(components, g_strdup(QQ_ROOM_KEY_TITLE_UTF8), g_strdup(rmd->title_utf8));
 
 	chat = purple_chat_new(purple_connection_get_account(gc), rmd->title_utf8, components);
@@ -151,7 +152,7 @@ PurpleChat *qq_room_find_or_new(PurpleCo
 
 	g_return_val_if_fail(id != 0 && ext_id != 0, NULL);
 
-	purple_debug_info("QQ", "Find or add new room: id %d, ext id %d\n", id, ext_id);
+	purple_debug_info("QQ", "Find or add new room: id %u, ext id %u\n", id, ext_id);
 
 	rmd = qq_room_data_find(gc, id);
 	if (rmd == NULL) {
@@ -161,7 +162,7 @@ PurpleChat *qq_room_find_or_new(PurpleCo
 		qd->groups = g_list_append(qd->groups, rmd);
 	}
 
-	num_str = g_strdup_printf("%d", ext_id);
+	num_str = g_strdup_printf("%u", ext_id);
 	chat = purple_blist_find_chat(purple_connection_get_account(gc), num_str);
 	g_free(num_str);
 	if (chat) {
@@ -182,7 +183,7 @@ void qq_room_remove(PurpleConnection *gc
 	g_return_if_fail (gc != NULL && gc->proto_data != NULL);
 	qd = (qq_data *) gc->proto_data;
 
-	purple_debug_info("QQ", "Find and remove room data, id %d", id);
+	purple_debug_info("QQ", "Find and remove room data, id %u", id);
 	rmd = qq_room_data_find(gc, id);
 	g_return_if_fail (rmd != NULL);
 
@@ -190,8 +191,8 @@ void qq_room_remove(PurpleConnection *gc
 	qd->groups = g_list_remove(qd->groups, rmd);
 	room_data_free(rmd);
 
-	purple_debug_info("QQ", "Find and remove chat, ext_id %d", ext_id);
-	num_str = g_strdup_printf("%d", ext_id);
+	purple_debug_info("QQ", "Find and remove chat, ext_id %u", ext_id);
+	num_str = g_strdup_printf("%u", ext_id);
 	chat = purple_blist_find_chat(purple_connection_get_account(gc), num_str);
 	g_free(num_str);
 


More information about the Commits mailing list