Mercurial > pidgin
changeset 24616:e57311348bfb
Change Qun number to unsigned long
author | Hu Yong <ccpaging@gmail.com> |
---|---|
date | Tue, 11 Nov 2008 07:10:33 +0000 |
parents | 967a6efce7cf |
children | 8c3cfad8658a |
files | libpurple/protocols/qq/group_internal.c |
diffstat | 1 files changed, 15 insertions(+), 14 deletions(-) [+] |
line wrap: on
line diff
--- a/libpurple/protocols/qq/group_internal.c Tue Nov 11 07:09:08 2008 +0000 +++ b/libpurple/protocols/qq/group_internal.c Tue Nov 11 07:10:33 2008 +0000 @@ -34,8 +34,9 @@ { 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 @@ 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 @@ } 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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);