# HG changeset patch # User Richard Laager # Date 1182026075 0 # Node ID 9b9e202eb4493480cc4cdeea746ec4351e7e04e3 # Parent 97b735ca9d7a97ed5426c68aa6e82f665d1f9dcf# Parent cd385a6206e2670795a839747e336027cb207ca4 merge of 'bfe8046c64de924e7495c4913a6db09a462b1d85' and 'dedd3ec8f99fdd14b30a54ea1142e9daee336eff' diff -r 97b735ca9d7a -r 9b9e202eb449 ChangeLog.API --- a/ChangeLog.API Sat Jun 16 20:16:36 2007 +0000 +++ b/ChangeLog.API Sat Jun 16 20:34:35 2007 +0000 @@ -21,10 +21,6 @@ * purple_core_ensure_single_instance This is for UIs to use to ensure only one copy is running. * purple_dbus_is_owner - * purple_dbusify_const_GList - * purple_dbusify_const_GSList - * purple_const_GList_to_array - * purple_const_GSList_to_array * purple_image_data_calculate_filename * pidgin_retrieve_user_info, shows immediate feedback when getting information about a user. @@ -39,7 +35,9 @@ Can be used for inserting an animated image into an IMHTML. Changed: - * Mark some return types const: + * The documentation of the following functions now properly + declares that the returned value must not be modified or + freed, which was always the case: * purple_accounts_get_all * purple_connections_get_all * purple_connections_get_connecting @@ -49,16 +47,25 @@ * purple_get_conversations * purple_get_ims * purple_notify_user_info_get_entries - - Deprecated: - * purple_dbusify_GList: Use purple_dbusify_const_GList (and - g_list_free if needed) if depending on 2.1.0 is okay. - * purple_dbusify_GSList: Use purple_dbusify_const_GSList (and - g_slist_free if needed) if depending on 2.1.0 is okay.. - * purple_GList_to_array: Use purple_const_GList_to_array (and - g_list_free if needed) if depending on 2.1.0 is okay.. - * purple_GSList_to_array: Use purple_const_GSList_to_array (and - g_slist_free if needed) if depending on 2.1.0 is okay.. + * The following functions now return a GList* instead of a + const GList*, as const is not very useful with GLists. The + returned value still must not be modified or freed: + * purple_account_get_status_types + * purple_mime_document_get_fields + * purple_mime_document_get_parts + * purple_mime_part_get_fields + * purple_request_fields_get_required + * purple_request_field_list_get_selected + * purple_request_field_list_get_items + * purple_status_type_get_attrs + * purple_presence_get_statuses + * purple_request_field_list_set_selected now takes a GList* + instead of a const GList* for items, as const is not very + useful with GLists. The passed list is still not modified + or freed. + * purple_presence_add_list now takes a GList* instead of a + const GList* for source_list, as const is not very useful with + GLists. The passed list is still not modified or freed. Pidgin: Changed: @@ -69,6 +76,11 @@ Added: * finch_retrieve_user_info + Changed: + * gnt_tree_get_rows() now returns a GList* instead of a const + GList*, as const is not very useful with GLists. The + returned value still must not be modified or freed. + version 2.0.2 (6/14/2007): Pidgin: Deprecated: diff -r 97b735ca9d7a -r 9b9e202eb449 finch/gntaccount.c --- a/finch/gntaccount.c Sat Jun 16 20:16:36 2007 +0000 +++ b/finch/gntaccount.c Sat Jun 16 20:34:35 2007 +0000 @@ -641,7 +641,7 @@ void finch_accounts_show_all() { - const GList *iter; + GList *iter; GntWidget *box, *button; if (accounts.window) @@ -734,7 +734,7 @@ void finch_accounts_init() { - const GList *iter; + GList *iter; purple_signal_connect(purple_accounts_get_handle(), "account-added", finch_accounts_get_handle(), PURPLE_CALLBACK(account_added_callback), @@ -831,7 +831,7 @@ { PurpleConnection *gc = purple_account_get_connection(data->account); - if (g_list_find((GList *)purple_connections_get_all(), gc)) + if (g_list_find(purple_connections_get_all(), gc)) { purple_blist_request_add_buddy(data->account, data->username, NULL, data->alias); diff -r 97b735ca9d7a -r 9b9e202eb449 finch/gntft.c --- a/finch/gntft.c Sat Jun 16 20:16:36 2007 +0000 +++ b/finch/gntft.c Sat Jun 16 20:34:35 2007 +0000 @@ -86,7 +86,7 @@ static void update_title_progress() { - const GList *list; + GList *list; int num_active_xfers = 0; guint64 total_bytes_xferred = 0; guint64 total_file_size = 0; @@ -172,7 +172,7 @@ void finch_xfer_dialog_new(void) { - const GList *iter; + GList *iter; GntWidget *window; GntWidget *bbox; GntWidget *button; diff -r 97b735ca9d7a -r 9b9e202eb449 finch/gntpounce.c --- a/finch/gntpounce.c Sat Jun 16 20:16:36 2007 +0000 +++ b/finch/gntpounce.c Sat Jun 16 20:34:35 2007 +0000 @@ -137,7 +137,7 @@ static void populate_pounces_list(PouncesManager *dialog) { - const GList *pounces; + GList *pounces; gnt_tree_remove_all(GNT_TREE(dialog->tree)); @@ -288,7 +288,7 @@ GntWidget *hbox, *vbox; GntWidget *button; GntWidget *combo; - const GList *list; + GList *list; g_return_if_fail((cur_pounce != NULL) || (account != NULL) || @@ -303,7 +303,7 @@ dialog->pounce = NULL; dialog->account = account; } else { - const GList *connections = purple_connections_get_all(); + GList *connections = purple_connections_get_all(); PurpleConnection *gc; if (connections != NULL) { diff -r 97b735ca9d7a -r 9b9e202eb449 finch/gntprefs.c --- a/finch/gntprefs.c Sat Jun 16 20:16:36 2007 +0000 +++ b/finch/gntprefs.c Sat Jun 16 20:34:35 2007 +0000 @@ -89,7 +89,7 @@ get_status_titles() { GList *list = NULL; - const GList *iter; + GList *iter; for (iter = purple_savedstatuses_get_all(); iter; iter = iter->next) { char *str; if (purple_savedstatus_is_transient(iter->data)) diff -r 97b735ca9d7a -r 9b9e202eb449 finch/gntrequest.c --- a/finch/gntrequest.c Sat Jun 16 20:16:36 2007 +0000 +++ b/finch/gntrequest.c Sat Jun 16 20:34:35 2007 +0000 @@ -297,7 +297,7 @@ GList *list = NULL; if (purple_request_field_list_get_multi_select(field)) { - const GList *iter; + GList *iter; GntWidget *tree = field->ui_data; iter = purple_request_field_list_get_items(field); @@ -433,7 +433,7 @@ else if (type == PURPLE_REQUEST_FIELD_CHOICE) { int id; - const GList *list; + GList *list; GntWidget *combo = gnt_combo_box_new(); gnt_box_add_widget(GNT_BOX(hbox), combo); field->ui_data = combo; @@ -449,7 +449,7 @@ } else if (type == PURPLE_REQUEST_FIELD_LIST) { - const GList *list; + GList *list; gboolean multi = purple_request_field_list_get_multi_select(field); if (multi) { @@ -490,7 +490,7 @@ { gboolean all; PurpleAccount *def; - const GList *list; + GList *list; GntWidget *combo = gnt_combo_box_new(); gnt_box_set_alignment(GNT_BOX(hbox), GNT_ALIGN_MID); gnt_box_add_widget(GNT_BOX(hbox), combo); diff -r 97b735ca9d7a -r 9b9e202eb449 finch/gntstatus.c --- a/finch/gntstatus.c Sat Jun 16 20:16:36 2007 +0000 +++ b/finch/gntstatus.c Sat Jun 16 20:34:35 2007 +0000 @@ -83,7 +83,7 @@ static void populate_statuses(GntTree *tree) { - const GList *list; + GList *list; for (list = purple_savedstatuses_get_all(); list; list = list->next) { @@ -244,7 +244,7 @@ static void set_substatuses(EditStatus *edit) { - const GList *iter; + GList *iter; for (iter = gnt_tree_get_rows(GNT_TREE(edit->tree)); iter; iter = iter->next) { RowInfo *key = iter->data; if (gnt_tree_get_choice(GNT_TREE(edit->tree), key)) { @@ -410,7 +410,7 @@ EditSubStatus *sub; GntWidget *window, *combo, *entry, *box, *button, *l; PurpleSavedStatusSub *substatus = NULL; - const GList *iter; + GList *iter; char *name; RowInfo *selected = gnt_tree_get_selection_data(tree); PurpleAccount *account = selected->account; @@ -497,7 +497,7 @@ GntWidget *window, *box, *button, *entry, *combo, *label, *tree; PurpleStatusPrimitive prims[] = {PURPLE_STATUS_AVAILABLE, PURPLE_STATUS_AWAY, PURPLE_STATUS_INVISIBLE, PURPLE_STATUS_OFFLINE, PURPLE_STATUS_UNSET}, current; - const GList *iter; + GList *iter; int i; if (saved) diff -r 97b735ca9d7a -r 9b9e202eb449 finch/libgnt/gnttree.c --- a/finch/libgnt/gnttree.c Sat Jun 16 20:16:36 2007 +0000 +++ b/finch/libgnt/gnttree.c Sat Jun 16 20:34:35 2007 +0000 @@ -1017,7 +1017,7 @@ return ret; } -const GList *gnt_tree_get_rows(GntTree *tree) +GList *gnt_tree_get_rows(GntTree *tree) { return tree->list; } diff -r 97b735ca9d7a -r 9b9e202eb449 finch/libgnt/gnttree.h --- a/finch/libgnt/gnttree.h Sat Jun 16 20:16:36 2007 +0000 +++ b/finch/libgnt/gnttree.h Sat Jun 16 20:34:35 2007 +0000 @@ -190,7 +190,13 @@ */ GList * gnt_tree_get_selection_text_list(GntTree *tree); -const GList *gnt_tree_get_rows(GntTree *tree); +/** + * + * @param tree + * + * @constreturn + */ +GList *gnt_tree_get_rows(GntTree *tree); /** * diff -r 97b735ca9d7a -r 9b9e202eb449 finch/libgnt/gntwm.h --- a/finch/libgnt/gntwm.h Sat Jun 16 20:16:36 2007 +0000 +++ b/finch/libgnt/gntwm.h Sat Jun 16 20:34:35 2007 +0000 @@ -163,7 +163,7 @@ /* List of windows. Although the WM can keep a list of its own for the windows, * it'd be better if there was a way to share between the 'core' and the WM. */ - /*const GList *(*window_list)();*/ + /*GList *(*window_list)();*/ void (*res1)(void); void (*res2)(void); diff -r 97b735ca9d7a -r 9b9e202eb449 finch/libgnt/wms/s.c --- a/finch/libgnt/wms/s.c Sat Jun 16 20:16:36 2007 +0000 +++ b/finch/libgnt/wms/s.c Sat Jun 16 20:34:35 2007 +0000 @@ -121,7 +121,7 @@ static GntWidget * find_widget(GntWM *wm, const char *wname) { - const GList *iter = wm->cws->list; + GList *iter = wm->cws->list; for (; iter; iter = iter->next) { GntWidget *widget = iter->data; const char *name = gnt_widget_get_name(widget); diff -r 97b735ca9d7a -r 9b9e202eb449 libpurple/account.c --- a/libpurple/account.c Sat Jun 16 20:16:36 2007 +0000 +++ b/libpurple/account.c Sat Jun 16 20:34:35 2007 +0000 @@ -205,7 +205,7 @@ { PurpleStatusType *type = purple_status_get_type(status); xmlnode *node, *child; - const GList *attrs, *attr; + GList *attrs, *attr; node = xmlnode_new("attributes"); @@ -241,7 +241,7 @@ statuses_to_xmlnode(const PurplePresence *presence) { xmlnode *node, *child; - const GList *statuses, *status; + GList *statuses, *status; node = xmlnode_new("statuses"); @@ -371,7 +371,7 @@ accounts_to_xmlnode(void) { xmlnode *node, *child; - const GList *cur; + GList *cur; node = xmlnode_new("account"); xmlnode_set_attrib(node, "version", "1.0"); @@ -877,7 +877,7 @@ void purple_account_destroy(PurpleAccount *account) { - const GList *l; + GList *l; g_return_if_fail(account != NULL); @@ -1805,7 +1805,7 @@ PurpleStatusType * purple_account_get_status_type(const PurpleAccount *account, const char *id) { - const GList *l; + GList *l; g_return_val_if_fail(account != NULL, NULL); g_return_val_if_fail(id != NULL, NULL); @@ -1824,7 +1824,7 @@ PurpleStatusType * purple_account_get_status_type_with_primitive(const PurpleAccount *account, PurpleStatusPrimitive primitive) { - const GList *l; + GList *l; g_return_val_if_fail(account != NULL, NULL); @@ -1857,7 +1857,7 @@ return purple_presence_is_status_active(account->presence, status_id); } -const GList * +GList * purple_account_get_status_types(const PurpleAccount *account) { g_return_val_if_fail(account != NULL, NULL); @@ -2272,7 +2272,7 @@ schedule_accounts_save(); } -const GList * +GList * purple_accounts_get_all(void) { return accounts; @@ -2282,7 +2282,7 @@ purple_accounts_get_all_active(void) { GList *list = NULL; - const GList *all = purple_accounts_get_all(); + GList *all = purple_accounts_get_all(); while (all != NULL) { PurpleAccount *account = all->data; @@ -2300,7 +2300,7 @@ purple_accounts_find(const char *name, const char *protocol_id) { PurpleAccount *account = NULL; - const GList *l; + GList *l; char *who; g_return_val_if_fail(name != NULL, NULL); @@ -2327,7 +2327,7 @@ void purple_accounts_restore_current_statuses() { - const GList *l; + GList *l; PurpleAccount *account; /* If we're not connected to the Internet right now, we bail on this */ diff -r 97b735ca9d7a -r 9b9e202eb449 libpurple/account.h --- a/libpurple/account.h Sat Jun 16 20:16:36 2007 +0000 +++ b/libpurple/account.h Sat Jun 16 20:34:35 2007 +0000 @@ -672,9 +672,9 @@ * * @param account The account. * - * @return The account's status types. + * @constreturn The account's status types. */ -const GList *purple_account_get_status_types(const PurpleAccount *account); +GList *purple_account_get_status_types(const PurpleAccount *account); /** * Returns a protocol-specific integer setting for an account. @@ -884,9 +884,9 @@ /** * Returns a list of all accounts. * - * @return A list of all accounts. + * @constreturn A list of all accounts. */ -const GList *purple_accounts_get_all(void); +GList *purple_accounts_get_all(void); /** * Returns a list of all enabled accounts diff -r 97b735ca9d7a -r 9b9e202eb449 libpurple/accountopt.c --- a/libpurple/accountopt.c Sat Jun 16 20:16:36 2007 +0000 +++ b/libpurple/accountopt.c Sat Jun 16 20:34:35 2007 +0000 @@ -282,7 +282,7 @@ return option->masked; } -const GList * +GList * purple_account_option_get_list(const PurpleAccountOption *option) { g_return_val_if_fail(option != NULL, NULL); diff -r 97b735ca9d7a -r 9b9e202eb449 libpurple/accountopt.h --- a/libpurple/accountopt.h Sat Jun 16 20:16:36 2007 +0000 +++ b/libpurple/accountopt.h Sat Jun 16 20:34:35 2007 +0000 @@ -296,9 +296,9 @@ * * @param option The account option. * - * @return The list values. + * @constreturn The list values. */ -const GList *purple_account_option_get_list(const PurpleAccountOption *option); +GList *purple_account_option_get_list(const PurpleAccountOption *option); /*@}*/ diff -r 97b735ca9d7a -r 9b9e202eb449 libpurple/blist.c --- a/libpurple/blist.c Sat Jun 16 20:16:36 2007 +0000 +++ b/libpurple/blist.c Sat Jun 16 20:34:35 2007 +0000 @@ -304,7 +304,7 @@ { xmlnode *node, *child, *grandchild; PurpleBlistNode *gnode; - const GList *cur; + GList *cur; node = xmlnode_new("purple"); xmlnode_set_attrib(node, "version", "1.0"); @@ -1895,7 +1895,7 @@ { PurpleBlistUiOps *ops = purple_blist_get_ui_ops(); PurpleBlistNode *node; - const GList *l; + GList *l; g_return_if_fail(group != NULL); diff -r 97b735ca9d7a -r 9b9e202eb449 libpurple/buddyicon.c --- a/libpurple/buddyicon.c Sat Jun 16 20:16:36 2007 +0000 +++ b/libpurple/buddyicon.c Sat Jun 16 20:34:35 2007 +0000 @@ -1021,7 +1021,7 @@ _purple_buddy_icons_account_loaded_cb() { const char *dirname = purple_buddy_icons_get_cache_dir(); - const GList *cur; + GList *cur; for (cur = purple_accounts_get_all(); cur != NULL; cur = cur->next) { diff -r 97b735ca9d7a -r 9b9e202eb449 libpurple/connection.c --- a/libpurple/connection.c Sat Jun 16 20:16:36 2007 +0000 +++ b/libpurple/connection.c Sat Jun 16 20:34:35 2007 +0000 @@ -456,7 +456,7 @@ void purple_connections_disconnect_all(void) { - const GList *l; + GList *l; PurpleConnection *gc; while ((l = purple_connections_get_all()) != NULL) { @@ -466,13 +466,13 @@ } } -const GList * +GList * purple_connections_get_all(void) { return connections; } -const GList * +GList * purple_connections_get_connecting(void) { return connections_connecting; diff -r 97b735ca9d7a -r 9b9e202eb449 libpurple/connection.h --- a/libpurple/connection.h Sat Jun 16 20:16:36 2007 +0000 +++ b/libpurple/connection.h Sat Jun 16 20:34:35 2007 +0000 @@ -259,16 +259,16 @@ * Returns a list of all active connections. This does not * include connections that are in the process of connecting. * - * @return A list of all active connections. + * @constreturn A list of all active connections. */ -const GList *purple_connections_get_all(void); +GList *purple_connections_get_all(void); /** * Returns a list of all connections in the process of connecting. * - * @return A list of connecting connections. + * @constreturn A list of connecting connections. */ -const GList *purple_connections_get_connecting(void); +GList *purple_connections_get_connecting(void); /** * Checks if gc is still a valid pointer to a gc. @@ -279,7 +279,7 @@ * TODO: Eventually this bad boy will be removed, because it is * a gross fix for a crashy problem. */ -#define PURPLE_CONNECTION_IS_VALID(gc) (g_list_find((GList *)purple_connections_get_all(), (gc)) != NULL) +#define PURPLE_CONNECTION_IS_VALID(gc) (g_list_find(purple_connections_get_all(), (gc)) != NULL) /*@}*/ diff -r 97b735ca9d7a -r 9b9e202eb449 libpurple/conversation.c --- a/libpurple/conversation.c Sat Jun 16 20:16:36 2007 +0000 +++ b/libpurple/conversation.c Sat Jun 16 20:34:35 2007 +0000 @@ -631,7 +631,7 @@ purple_conversation_foreach(void (*func)(PurpleConversation *conv)) { PurpleConversation *conv; - const GList *l; + GList *l; g_return_if_fail(func != NULL); @@ -732,19 +732,19 @@ return g_hash_table_lookup(conv->data, key); } -const GList * +GList * purple_get_conversations(void) { return conversations; } -const GList * +GList * purple_get_ims(void) { return ims; } -const GList * +GList * purple_get_chats(void) { return chats; @@ -759,7 +759,7 @@ PurpleConversation *c = NULL; gchar *name1; const gchar *name2; - const GList *cnv; + GList *cnv; g_return_val_if_fail(name != NULL, NULL); @@ -819,7 +819,7 @@ return; if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM && - !g_list_find((GList *)purple_get_conversations(), conv)) + !g_list_find(purple_get_conversations(), conv)) return; displayed = g_strdup(message); @@ -1250,7 +1250,7 @@ return users; } -const GList * +GList * purple_conv_chat_get_users(const PurpleConvChat *chat) { g_return_val_if_fail(chat != NULL, NULL); @@ -1284,7 +1284,7 @@ if (!purple_conv_chat_is_user_ignored(chat, name)) return; - item = g_list_find((GList *)purple_conv_chat_get_ignored(chat), + item = g_list_find(purple_conv_chat_get_ignored(chat), purple_conv_chat_get_ignored_user(chat, name)); purple_conv_chat_set_ignored(chat, @@ -1304,7 +1304,7 @@ return ignored; } -const GList * +GList * purple_conv_chat_get_ignored(const PurpleConvChat *chat) { g_return_val_if_fail(chat != NULL, NULL); @@ -1315,7 +1315,7 @@ const char * purple_conv_chat_get_ignored_user(const PurpleConvChat *chat, const char *user) { - const GList *ignored; + GList *ignored; g_return_val_if_fail(chat != NULL, NULL); g_return_val_if_fail(user != NULL, NULL); @@ -1810,7 +1810,7 @@ PurpleConversation *conv; PurpleConversationUiOps *ops; GList *users; - const GList *l; + GList *l; GList *names = NULL; g_return_if_fail(chat != NULL); @@ -1919,7 +1919,7 @@ PurpleConversation * purple_find_chat(const PurpleConnection *gc, int id) { - const GList *l; + GList *l; PurpleConversation *conv; for (l = purple_get_chats(); l != NULL; l = l->next) { @@ -1968,7 +1968,7 @@ PurpleConvChatBuddy * purple_conv_chat_cb_find(PurpleConvChat *chat, const char *name) { - const GList *l; + GList *l; PurpleConvChatBuddy *cb = NULL; g_return_val_if_fail(chat != NULL, NULL); diff -r 97b735ca9d7a -r 9b9e202eb449 libpurple/conversation.h --- a/libpurple/conversation.h Sat Jun 16 20:16:36 2007 +0000 +++ b/libpurple/conversation.h Sat Jun 16 20:34:35 2007 +0000 @@ -502,23 +502,23 @@ * * This list includes both IMs and chats. * - * @return A GList of all conversations. + * @constreturn A GList of all conversations. */ -const GList *purple_get_conversations(void); +GList *purple_get_conversations(void); /** * Returns a list of all IMs. * - * @return A GList of all IMs. + * @constreturn A GList of all IMs. */ -const GList *purple_get_ims(void); +GList *purple_get_ims(void); /** * Returns a list of all chats. * - * @return A GList of all chats. + * @constreturn A GList of all chats. */ -const GList *purple_get_chats(void); +GList *purple_get_chats(void); /** * Finds a conversation with the specified type, name, and Purple account. @@ -875,9 +875,9 @@ * * @param chat The chat. * - * @return The list of users. + * @constreturn The list of users. */ -const GList *purple_conv_chat_get_users(const PurpleConvChat *chat); +GList *purple_conv_chat_get_users(const PurpleConvChat *chat); /** * Ignores a user in a chat room. @@ -912,7 +912,7 @@ * * @return The list of ignored users. */ -const GList *purple_conv_chat_get_ignored(const PurpleConvChat *chat); +GList *purple_conv_chat_get_ignored(const PurpleConvChat *chat); /** * Returns the actual name of the specified ignored user, if it exists in diff -r 97b735ca9d7a -r 9b9e202eb449 libpurple/dbus-analyze-functions.py --- a/libpurple/dbus-analyze-functions.py Sat Jun 16 20:16:36 2007 +0000 +++ b/libpurple/dbus-analyze-functions.py Sat Jun 16 20:34:35 2007 +0000 @@ -32,8 +32,8 @@ "purple_log_read", ] -# This is a list of functions that return a GList* whose elements are -# string, not pointers to objects. +# This is a list of functions that return a GList* or GSList * whose elements +# are strings, not pointers to objects. stringlists = [ "purple_prefs_get_path_list", "purple_prefs_get_string_list", @@ -41,6 +41,32 @@ "purple_uri_list_extract_uris", ] +# This is a list of functions that return a GList* or GSList* that should +# not be freed. Ideally, this information should be obtained from the Doxygen +# documentation at some point. +constlists = [ + "purple_account_get_status_types", + "purple_accounts_get_all", + "purple_account_option_get_list", + "purple_connections_get_all", + "purple_connections_get_connecting", + "purple_get_conversations", + "purple_get_ims", + "purple_get_chats", + "purple_conv_chat_get_users", + "purple_conv_chat_get_ignored", + "purple_mime_document_get_fields", + "purple_mime_document_get_parts", + "purple_mime_part_get_fields", + "purple_notify_user_info_get_entries", + "purple_request_fields_get_required", + "purple_request_field_list_get_selected", + "purple_request_field_list_get_items", + "purple_savedstatuses_get_all", + "purple_status_type_get_attrs", + "purple_presence_get_statuses", +] + pointer = "#pointer#" myexception = "My Exception" @@ -152,7 +178,7 @@ return self.outputpurplestructure(type, name) if type[0] in ["GList", "GSList"]: - return self.outputlist(type, name, const) + return self.outputlist(type, name) raise myexception @@ -254,7 +280,7 @@ self.returncode.append("return (%s*) GINT_TO_POINTER(%s);" % (type[0], name)); self.definepurplestructure(type) - def outputlist(self, type, name, const): + def outputlist(self, type, name): self.functiontype = "%s*" % type[0] self.decls.append("GArray *%s;" % name) self.outputparams.append(('dbus_g_type_get_collection("GArray", G_TYPE_INT)', name)) @@ -298,7 +324,7 @@ print "\tdbus_message_append_args(reply_DBUS,", for param in self.cparamsout: if type(param) is str: - print "%s," % param + print "%s," % param, else: print "DBUS_TYPE_%s, &%s," % param, print "DBUS_TYPE_INVALID);" @@ -390,28 +416,20 @@ # GList*, GSList*, assume that list is a list of objects # unless the function is in stringlists - def outputlist(self, type, name, const): + def outputlist(self, type, name): self.cdecls.append("\tdbus_int32_t %s_LEN;" % name) self.ccodeout.append("\tg_free(%s);" % name) - if const: - const_prefix = "const_" - else: - const_prefix = "" - - if (const): - self.cdecls.append("\tconst %s *list;" % type[0]); - else: - self.cdecls.append("\t%s *list;" % type[0]); + self.cdecls.append("\t%s *list;" % type[0]); if self.function.name in stringlists: self.cdecls.append("\tchar **%s;" % name) self.ccode.append("\tlist = %s;" % self.call) - self.ccode.append("\t%s = (char **)purple_const_%s_to_array(list, &%s_LEN);" % \ + self.ccode.append("\t%s = (char **)purple_%s_to_array(list, FALSE, &%s_LEN);" % \ (name, type[0], name)) - self.cparamsout.append("\tDBUS_TYPE_ARRAY, DBUS_TYPE_STRING, &%s, %s_LEN" \ + self.cparamsout.append("DBUS_TYPE_ARRAY, DBUS_TYPE_STRING, &%s, %s_LEN" \ % (name, name)) - if (not const): + if (not (self.function.name in constlists)): type_name = type[0].lower()[1:] self.ccodeout.append("\tg_%s_foreach(list, (GFunc)g_free, NULL);" % type_name) self.ccodeout.append("\tg_%s_free(list);" % type_name) @@ -419,11 +437,11 @@ else: self.cdecls.append("\tdbus_int32_t *%s;" % name) self.ccode.append("\tlist = %s;" % self.call) - self.ccode.append("\t%s = purple_dbusify_const_%s(list, &%s_LEN);" % \ + self.ccode.append("\t%s = purple_dbusify_%s(list, FALSE, &%s_LEN);" % \ (name, type[0], name)) - if (not const): + if (not (self.function.name in constlists)): self.ccode.append("\tg_%s_free(list);" % type[0].lower()[1:]) - self.cparamsout.append("\tDBUS_TYPE_ARRAY, DBUS_TYPE_INT32, &%s, %s_LEN" \ + self.cparamsout.append("DBUS_TYPE_ARRAY, DBUS_TYPE_INT32, &%s, %s_LEN" \ % (name, name)) self.addouttype("ai", name) diff -r 97b735ca9d7a -r 9b9e202eb449 libpurple/dbus-bindings.h --- a/libpurple/dbus-bindings.h Sat Jun 16 20:16:36 2007 +0000 +++ b/libpurple/dbus-bindings.h Sat Jun 16 20:34:35 2007 +0000 @@ -83,52 +83,14 @@ int first_arg_type, va_list var_args); -/** - * @deprecated In 3.0.0, this method will have a signature and behavior - * like that of purple_dbusify_const_GList(). - */ dbus_int32_t* purple_dbusify_GList(GList *list, gboolean free_memory, dbus_int32_t *len); -/** - * @deprecated In 3.0.0, this method will have a signature and behavior - * like that of purple_dbusify_const_GSList(). - */ dbus_int32_t* purple_dbusify_GSList(GSList *list, gboolean free_memory, dbus_int32_t *len); - -/** - * @since 2.1.0 - */ -dbus_int32_t* purple_dbusify_const_GList(const GList *list, dbus_int32_t *len); - -/** - * @since 2.1.0 - */ -dbus_int32_t* purple_dbusify_const_GSList(const GSList *list, dbus_int32_t *len); - -/** - * @deprecated In 3.0.0, this method will have a signature and behavior - * like that of purple_const_GList_to_array(). - */ gpointer* purple_GList_to_array(GList *list, gboolean free_memory, dbus_int32_t *len); -/** - * @deprecated In 3.0.0, this method will have a signature and behavior - * like that of purple_const_GSList_to_array(). - */ gpointer* purple_GSList_to_array(GSList *list, gboolean free_memory, dbus_int32_t *len); - -/** - * @since 2.1.0 - */ -gpointer* purple_const_GList_to_array(const GList *list, dbus_int32_t *len); - -/** - * @since 2.1.0 - */ -gpointer* purple_const_GSList_to_array(const GSList *list, dbus_int32_t *len); - GHashTable *purple_dbus_iter_hash_table(DBusMessageIter *iter, DBusError *error); const char* empty_to_null(const char *str); diff -r 97b735ca9d7a -r 9b9e202eb449 libpurple/dbus-server.c --- a/libpurple/dbus-server.c Sat Jun 16 20:16:36 2007 +0000 +++ b/libpurple/dbus-server.c Sat Jun 16 20:34:35 2007 +0000 @@ -290,45 +290,19 @@ } dbus_int32_t * -purple_dbusify_const_GList(const GList *list, dbus_int32_t *len) +purple_dbusify_GList(GList *list, gboolean free_memory, dbus_int32_t *len) { dbus_int32_t *array; int i; - const GList *elem; + GList *elem; - /* g_list_length() should really take a const GList */ - *len = g_list_length((GList *)list); + *len = g_list_length(list); array = g_new0(dbus_int32_t, *len); for (i = 0, elem = list; elem != NULL; elem = elem->next, i++) array[i] = purple_dbus_pointer_to_id(elem->data); - return array; -} - -dbus_int32_t * -purple_dbusify_GList(GList *list, gboolean free_memory, dbus_int32_t *len) -{ - dbus_int32_t *array = purple_dbusify_const_GList(list, len); - - if (!free_memory) - return array; - - g_list_free(list); - return array; -} - -dbus_int32_t * -purple_dbusify_const_GSList(const GSList *list, dbus_int32_t *len) -{ - dbus_int32_t *array; - int i; - const GSList *elem; - - /* g_slist_length should really take a const GSList */ - *len = g_slist_length((GSList *)list); - array = g_new0(dbus_int32_t, *len); - for (i = 0, elem = list; elem != NULL; elem = elem->next, i++) - array[i] = purple_dbus_pointer_to_id(elem->data); + if (free_memory) + g_list_free(list); return array; } @@ -336,26 +310,17 @@ dbus_int32_t * purple_dbusify_GSList(GSList *list, gboolean free_memory, dbus_int32_t *len) { - dbus_int32_t *array = purple_dbusify_const_GSList(list, len); - - if (!free_memory) - return array; - - g_slist_free(list); - return array; -} + dbus_int32_t *array; + int i; + GSList *elem; -gpointer * -purple_const_GList_to_array(const GList *list, dbus_int32_t *len) -{ - gpointer *array; - int i; - const GList *elem; + *len = g_slist_length(list); + array = g_new0(dbus_int32_t, *len); + for (i = 0, elem = list; elem != NULL; elem = elem->next, i++) + array[i] = purple_dbus_pointer_to_id(elem->data); - *len = g_list_length((GList *)list); - array = g_new0(gpointer, *len); - for (i = 0, elem = list; elem != NULL; elem = elem->next, i++) - array[i] = elem->data; + if (free_memory) + g_slist_free(list); return array; } @@ -363,39 +328,36 @@ gpointer * purple_GList_to_array(GList *list, gboolean free_memory, dbus_int32_t *len) { - gpointer *array = purple_const_GList_to_array(list, len); - - if (!free_memory) - return array; - - g_list_free(list); - return array; -} - -gpointer * -purple_const_GSList_to_array(const GSList *list, dbus_int32_t *len) -{ gpointer *array; int i; - const GSList *elem; + GList *elem; - *len = g_slist_length((GSList *)list); + *len = g_list_length(list); array = g_new0(gpointer, *len); for (i = 0, elem = list; elem != NULL; elem = elem->next, i++) array[i] = elem->data; + if (free_memory) + g_list_free(list); + return array; } gpointer * purple_GSList_to_array(GSList *list, gboolean free_memory, dbus_int32_t *len) { - gpointer *array = purple_const_GSList_to_array(list, len); + gpointer *array; + int i; + GSList *elem; - if (!free_memory) - return array; + *len = g_slist_length(list); + array = g_new0(gpointer, *len); + for (i = 0, elem = list; elem != NULL; elem = elem->next, i++) + array[i] = elem->data; - g_slist_free(list); + if (free_memory) + g_slist_free(list); + return array; } diff -r 97b735ca9d7a -r 9b9e202eb449 libpurple/dbus-useful.c --- a/libpurple/dbus-useful.c Sat Jun 16 20:16:36 2007 +0000 +++ b/libpurple/dbus-useful.c Sat Jun 16 20:34:35 2007 +0000 @@ -11,7 +11,7 @@ gboolean (*account_test)(const PurpleAccount *account)) { PurpleAccount *result = NULL; - const GList *l; + GList *l; char *who; if (name) diff -r 97b735ca9d7a -r 9b9e202eb449 libpurple/idle.c --- a/libpurple/idle.c Sat Jun 16 20:16:36 2007 +0000 +++ b/libpurple/idle.c Sat Jun 16 20:34:35 2007 +0000 @@ -199,7 +199,7 @@ /* Idle reporting stuff */ if (report_idle && (time_idle >= IDLEMARK)) { - const GList *l; + GList *l; for (l = purple_connections_get_all(); l != NULL; l = l->next) { PurpleConnection *gc = l->data; diff -r 97b735ca9d7a -r 9b9e202eb449 libpurple/log.c --- a/libpurple/log.c Sat Jun 16 20:16:36 2007 +0000 +++ b/libpurple/log.c Sat Jun 16 20:34:35 2007 +0000 @@ -985,7 +985,7 @@ GDir *protocol_dir; const gchar *username; gchar *protocol_unescaped; - const GList *account_iter; + GList *account_iter; GList *accounts = NULL; if ((protocol_dir = g_dir_open(protocol_path, 0, NULL)) == NULL) { diff -r 97b735ca9d7a -r 9b9e202eb449 libpurple/mime.c --- a/libpurple/mime.c Sat Jun 16 20:16:36 2007 +0000 +++ b/libpurple/mime.c Sat Jun 16 20:34:35 2007 +0000 @@ -277,7 +277,7 @@ } -const GList * +GList * purple_mime_part_get_fields(PurpleMimePart *part) { g_return_val_if_fail(part != NULL, NULL); @@ -513,7 +513,7 @@ } -const GList * +GList * purple_mime_document_get_fields(PurpleMimeDocument *doc) { g_return_val_if_fail(doc != NULL, NULL); @@ -537,7 +537,7 @@ } -const GList * +GList * purple_mime_document_get_parts(PurpleMimeDocument *doc) { g_return_val_if_fail(doc != NULL, NULL); diff -r 97b735ca9d7a -r 9b9e202eb449 libpurple/mime.h --- a/libpurple/mime.h Sat Jun 16 20:16:36 2007 +0000 +++ b/libpurple/mime.h Sat Jun 16 20:34:35 2007 +0000 @@ -90,10 +90,10 @@ * * @param doc The MIME document. * - * @returns A list of strings indicating the fields (but not the values of - * the fields) in the header of doc. + * @constreturn A list of strings indicating the fields (but not the values + * of the fields) in the header of doc. */ -const GList *purple_mime_document_get_fields(PurpleMimeDocument *doc); +GList *purple_mime_document_get_fields(PurpleMimeDocument *doc); /** * Get the value of a specific field in the header of a document. @@ -125,9 +125,9 @@ * * @param doc The MIME document. * - * @returns List of PurpleMimePart contained within doc. + * @constreturn List of PurpleMimePart contained within doc. */ -const GList *purple_mime_document_get_parts(PurpleMimeDocument *doc); +GList *purple_mime_document_get_parts(PurpleMimeDocument *doc); /** * Create and insert a new part into a MIME document. @@ -142,10 +142,10 @@ * * @param part The MIME document part. * - * @returns List of strings indicating the fields (but not the values - * of the fields) in the header of part. + * @constreturn List of strings indicating the fields (but not the values + * of the fields) in the header of part. */ -const GList *purple_mime_part_get_fields(PurpleMimePart *part); +GList *purple_mime_part_get_fields(PurpleMimePart *part); /** diff -r 97b735ca9d7a -r 9b9e202eb449 libpurple/notify.c --- a/libpurple/notify.c Sat Jun 16 20:16:36 2007 +0000 +++ b/libpurple/notify.c Sat Jun 16 20:34:35 2007 +0000 @@ -530,7 +530,7 @@ g_free(user_info); } -const GList * +GList * purple_notify_user_info_get_entries(PurpleNotifyUserInfo *user_info) { g_return_val_if_fail(user_info != NULL, NULL); diff -r 97b735ca9d7a -r 9b9e202eb449 libpurple/notify.h --- a/libpurple/notify.h Sat Jun 16 20:16:36 2007 +0000 +++ b/libpurple/notify.h Sat Jun 16 20:34:35 2007 +0000 @@ -456,9 +456,9 @@ * * @param user_info The PurpleNotifyUserInfo * - * @result A GList of PurpleNotifyUserInfoEntry objects + * @constreturn A GList of PurpleNotifyUserInfoEntry objects */ -const GList *purple_notify_user_info_get_entries(PurpleNotifyUserInfo *user_info); +GList *purple_notify_user_info_get_entries(PurpleNotifyUserInfo *user_info); /** * Create a textual representation of a PurpleNotifyUserInfo, separating entries with newline diff -r 97b735ca9d7a -r 9b9e202eb449 libpurple/plugins/joinpart.c --- a/libpurple/plugins/joinpart.c Sat Jun 16 20:16:36 2007 +0000 +++ b/libpurple/plugins/joinpart.c Sat Jun 16 20:34:35 2007 +0000 @@ -86,7 +86,7 @@ /* If the room is small, don't bother. */ chat = PURPLE_CONV_CHAT(conv); threshold = purple_prefs_get_int(THRESHOLD_PREF); - if (g_list_length((GList *)purple_conv_chat_get_users(chat)) < threshold) + if (g_list_length(purple_conv_chat_get_users(chat)) < threshold) return FALSE; /* We always care about our buddies! */ diff -r 97b735ca9d7a -r 9b9e202eb449 libpurple/plugins/perl/common/Account.xs --- a/libpurple/plugins/perl/common/Account.xs Sat Jun 16 20:16:36 2007 +0000 +++ b/libpurple/plugins/perl/common/Account.xs Sat Jun 16 20:34:35 2007 +0000 @@ -184,7 +184,7 @@ purple_account_get_status_types(account) Purple::Account account PREINIT: - const GList *l; + GList *l; PPCODE: for (l = purple_account_get_status_types(account); l != NULL; l = l->next) { XPUSHs(sv_2mortal(purple_perl_bless_object(l->data, "Purple::StatusType"))); @@ -290,7 +290,7 @@ void purple_accounts_get_all() PREINIT: - const GList *l; + GList *l; PPCODE: for (l = purple_accounts_get_all(); l != NULL; l = l->next) { XPUSHs(sv_2mortal(purple_perl_bless_object(l->data, "Purple::Account"))); diff -r 97b735ca9d7a -r 9b9e202eb449 libpurple/plugins/perl/common/AccountOpts.xs --- a/libpurple/plugins/perl/common/AccountOpts.xs Sat Jun 16 20:16:36 2007 +0000 +++ b/libpurple/plugins/perl/common/AccountOpts.xs Sat Jun 16 20:34:35 2007 +0000 @@ -88,7 +88,7 @@ purple_account_option_get_list(option) Purple::Account::Option option PREINIT: - const GList *l; + GList *l; PPCODE: for (l = purple_account_option_get_list(option); l != NULL; l = l->next) { /* XXX These are actually PurpleKeyValuePairs but we don't have a diff -r 97b735ca9d7a -r 9b9e202eb449 libpurple/plugins/perl/common/Connection.xs --- a/libpurple/plugins/perl/common/Connection.xs Sat Jun 16 20:16:36 2007 +0000 +++ b/libpurple/plugins/perl/common/Connection.xs Sat Jun 16 20:34:35 2007 +0000 @@ -72,7 +72,7 @@ void purple_connections_get_all() PREINIT: - const GList *l; + GList *l; PPCODE: for (l = purple_connections_get_all(); l != NULL; l = l->next) { XPUSHs(sv_2mortal(purple_perl_bless_object(l->data, "Purple::Connection"))); @@ -81,7 +81,7 @@ void purple_connections_get_connecting() PREINIT: - const GList *l; + GList *l; PPCODE: for (l = purple_connections_get_connecting(); l != NULL; l = l->next) { XPUSHs(sv_2mortal(purple_perl_bless_object(l->data, "Purple::Connection"))); diff -r 97b735ca9d7a -r 9b9e202eb449 libpurple/plugins/perl/common/Conversation.xs --- a/libpurple/plugins/perl/common/Conversation.xs Sat Jun 16 20:16:36 2007 +0000 +++ b/libpurple/plugins/perl/common/Conversation.xs Sat Jun 16 20:34:35 2007 +0000 @@ -93,7 +93,7 @@ void purple_get_ims() PREINIT: - const GList *l; + GList *l; PPCODE: for (l = purple_get_ims(); l != NULL; l = l->next) { XPUSHs(sv_2mortal(purple_perl_bless_object(l->data, "Purple::Conversation"))); @@ -102,7 +102,7 @@ void purple_get_conversations() PREINIT: - const GList *l; + GList *l; PPCODE: for (l = purple_get_conversations(); l != NULL; l = l->next) { XPUSHs(sv_2mortal(purple_perl_bless_object(l->data, "Purple::Conversation"))); @@ -111,7 +111,7 @@ void purple_get_chats() PREINIT: - const GList *l; + GList *l; PPCODE: for (l = purple_get_chats(); l != NULL; l = l->next) { XPUSHs(sv_2mortal(purple_perl_bless_object(l->data, "Purple::Conversation"))); @@ -354,7 +354,7 @@ purple_conv_chat_get_users(chat) Purple::Conversation::Chat chat PREINIT: - const GList *l; + GList *l; PPCODE: for (l = purple_conv_chat_get_users(chat); l != NULL; l = l->next) { XPUSHs(sv_2mortal(purple_perl_bless_object(l->data, "Purple::ListEntry"))); @@ -394,7 +394,7 @@ purple_conv_chat_get_ignored(chat) Purple::Conversation::Chat chat PREINIT: - const GList *l; + GList *l; PPCODE: for (l = purple_conv_chat_get_ignored(chat); l != NULL; l = l->next) { XPUSHs(sv_2mortal(purple_perl_bless_object(l->data, "Purple::ListEntry"))); diff -r 97b735ca9d7a -r 9b9e202eb449 libpurple/plugins/perl/common/Notify.xs --- a/libpurple/plugins/perl/common/Notify.xs Sat Jun 16 20:16:36 2007 +0000 +++ b/libpurple/plugins/perl/common/Notify.xs Sat Jun 16 20:34:35 2007 +0000 @@ -140,7 +140,7 @@ purple_notify_user_info_get_entries(user_info) Purple::NotifyUserInfo user_info PREINIT: - const GList *l; + GList *l; PPCODE: l = purple_notify_user_info_get_entries(user_info); for (; l != NULL; l = l->next) { diff -r 97b735ca9d7a -r 9b9e202eb449 libpurple/plugins/perl/common/Request.xs --- a/libpurple/plugins/perl/common/Request.xs Sat Jun 16 20:16:36 2007 +0000 +++ b/libpurple/plugins/perl/common/Request.xs Sat Jun 16 20:34:35 2007 +0000 @@ -396,7 +396,7 @@ purple_request_field_list_get_items(field) Purple::Request::Field field PREINIT: - const GList *l; + GList *l; PPCODE: for (l = purple_request_field_list_get_items(field); l != NULL; l = l->next) { XPUSHs(sv_2mortal(newSVpv(l->data, 0))); @@ -410,7 +410,7 @@ purple_request_field_list_get_selected(field) Purple::Request::Field field PREINIT: - const GList *l; + GList *l; PPCODE: for (l = purple_request_field_list_get_selected(field); l != NULL; l = l->next) { XPUSHs(sv_2mortal(newSVpv(l->data, 0))); @@ -625,7 +625,7 @@ purple_request_fields_get_required(fields) Purple::Request::Fields fields PREINIT: - const GList *l; + GList *l; PPCODE: for (l = purple_request_fields_get_required(fields); l != NULL; l = l->next) { XPUSHs(sv_2mortal(purple_perl_bless_object(l->data, "Purple::Request::Field"))); diff -r 97b735ca9d7a -r 9b9e202eb449 libpurple/plugins/perl/common/SavedStatuses.xs --- a/libpurple/plugins/perl/common/SavedStatuses.xs Sat Jun 16 20:16:36 2007 +0000 +++ b/libpurple/plugins/perl/common/SavedStatuses.xs Sat Jun 16 20:34:35 2007 +0000 @@ -130,7 +130,7 @@ void purple_savedstatuses_get_all() PREINIT: - const GList *l; + GList *l; PPCODE: for (l = purple_savedstatuses_get_all(); l != NULL; l = l->next) { XPUSHs(sv_2mortal(purple_perl_bless_object(l->data, "Purple::SavedStatus"))); @@ -140,7 +140,7 @@ purple_savedstatuses_get_popular(how_many) unsigned int how_many PREINIT: - const GList *l; + GList *l; PPCODE: for (l = purple_savedstatuses_get_popular(how_many); l != NULL; l = l->next) { XPUSHs(sv_2mortal(purple_perl_bless_object(l->data, "Purple::SavedStatus"))); diff -r 97b735ca9d7a -r 9b9e202eb449 libpurple/plugins/perl/common/Status.xs --- a/libpurple/plugins/perl/common/Status.xs Sat Jun 16 20:16:36 2007 +0000 +++ b/libpurple/plugins/perl/common/Status.xs Sat Jun 16 20:34:35 2007 +0000 @@ -142,7 +142,7 @@ purple_presence_get_statuses(presence) Purple::Presence presence PREINIT: - const GList *l; + GList *l; PPCODE: for (l = purple_presence_get_statuses(presence); l != NULL; l = l->next) { XPUSHs(sv_2mortal(purple_perl_bless_object(l->data, "Purple::Status"))); @@ -392,7 +392,7 @@ purple_status_type_get_attrs(status_type) Purple::StatusType status_type PREINIT: - const GList *l; + GList *l; PPCODE: for (l = purple_status_type_get_attrs(status_type); l != NULL; l = l->next) { XPUSHs(sv_2mortal(purple_perl_bless_object(l->data, "Purple::StatusAttr"))); diff -r 97b735ca9d7a -r 9b9e202eb449 libpurple/plugins/tcl/tcl_cmds.c --- a/libpurple/plugins/tcl/tcl_cmds.c Sat Jun 16 20:16:36 2007 +0000 +++ b/libpurple/plugins/tcl/tcl_cmds.c Sat Jun 16 20:34:35 2007 +0000 @@ -43,7 +43,7 @@ static PurpleAccount *tcl_validate_account(Tcl_Obj *obj, Tcl_Interp *interp) { PurpleAccount *account; - const GList *cur; + GList *cur; account = purple_tcl_ref_get(interp, obj, PurpleTclRefAccount); @@ -62,7 +62,7 @@ static PurpleConversation *tcl_validate_conversation(Tcl_Obj *obj, Tcl_Interp *interp) { PurpleConversation *convo; - const GList *cur; + GList *cur; convo = purple_tcl_ref_get(interp, obj, PurpleTclRefConversation); @@ -81,7 +81,7 @@ static PurpleConnection *tcl_validate_gc(Tcl_Obj *obj, Tcl_Interp *interp) { PurpleConnection *gc; - const GList *cur; + GList *cur; gc = purple_tcl_ref_get(interp, obj, PurpleTclRefConnection); @@ -113,7 +113,7 @@ const char *listopts[] = { "-all", "-online", NULL }; enum { CMD_ACCOUNTLIST_ALL, CMD_ACCOUNTLIST_ONLINE } listopt; const char *alias; - const GList *cur; + GList *cur; PurpleAccount *account; PurpleStatus *status; PurpleStatusType *status_type; @@ -612,7 +612,7 @@ const char *cmds[] = { "account", "displayname", "handle", "list", NULL }; enum { CMD_CONN_ACCOUNT, CMD_CONN_DISPLAYNAME, CMD_CONN_HANDLE, CMD_CONN_LIST } cmd; int error; - const GList *cur; + GList *cur; PurpleConnection *gc; if (objc < 2) { @@ -680,7 +680,7 @@ PurpleConversation *convo; PurpleAccount *account; PurpleConversationType type; - const GList *cur; + GList *cur; char *opt, *from, *what; int error, argsused, flags = 0; @@ -1082,7 +1082,7 @@ Tcl_Obj *result = Tcl_GetObjResult(interp); Tcl_Obj *list, *elem; PurplePresence *presence; - const GList *cur; + GList *cur; int error, idle, idle_time, login_time; if (objc < 2) { @@ -1524,7 +1524,7 @@ Tcl_Obj *result = Tcl_GetObjResult(interp); PurpleStatusType *status_type; Tcl_Obj *list, *elem; - const GList *cur; + GList *cur; int error; if (objc < 2) { diff -r 97b735ca9d7a -r 9b9e202eb449 libpurple/protocols/gg/gg.c --- a/libpurple/protocols/gg/gg.c Sat Jun 16 20:16:36 2007 +0000 +++ b/libpurple/protocols/gg/gg.c Sat Jun 16 20:34:35 2007 +0000 @@ -823,7 +823,7 @@ { GGPInfo *info = gc->proto_data; PurpleRequestField *field; - const GList *sel; + GList *sel; field = purple_request_fields_get_field(fields, "name"); sel = purple_request_field_list_get_selected(field); diff -r 97b735ca9d7a -r 9b9e202eb449 libpurple/protocols/irc/irc.c --- a/libpurple/protocols/irc/irc.c Sat Jun 16 20:16:36 2007 +0000 +++ b/libpurple/protocols/irc/irc.c Sat Jun 16 20:34:35 2007 +0000 @@ -592,7 +592,7 @@ struct irc_conn *irc = gc->proto_data; int len; - if(!g_list_find((GList *)purple_connections_get_all(), gc)) { + if(!g_list_find(purple_connections_get_all(), gc)) { purple_ssl_close(gsc); return; } diff -r 97b735ca9d7a -r 9b9e202eb449 libpurple/protocols/jabber/jutil.c --- a/libpurple/protocols/jabber/jutil.c Sat Jun 16 20:16:36 2007 +0000 +++ b/libpurple/protocols/jabber/jutil.c Sat Jun 16 20:34:35 2007 +0000 @@ -221,7 +221,7 @@ jabber_find_unnormalized_conv(const char *name, PurpleAccount *account) { PurpleConversation *c = NULL; - const GList *cnv; + GList *cnv; g_return_val_if_fail(name != NULL, NULL); diff -r 97b735ca9d7a -r 9b9e202eb449 libpurple/protocols/jabber/xdata.c --- a/libpurple/protocols/jabber/xdata.c Sat Jun 16 20:16:36 2007 +0000 +++ b/libpurple/protocols/jabber/xdata.c Sat Jun 16 20:34:35 2007 +0000 @@ -93,7 +93,7 @@ case JABBER_X_DATA_LIST_SINGLE: case JABBER_X_DATA_LIST_MULTI: { - const GList *selected = purple_request_field_list_get_selected(field); + GList *selected = purple_request_field_list_get_selected(field); char *value; fieldnode = xmlnode_new_child(result, "field"); xmlnode_set_attrib(fieldnode, "var", id); diff -r 97b735ca9d7a -r 9b9e202eb449 libpurple/protocols/msn/msn.c --- a/libpurple/protocols/msn/msn.c Sat Jun 16 20:16:36 2007 +0000 +++ b/libpurple/protocols/msn/msn.c Sat Jun 16 20:34:35 2007 +0000 @@ -1463,7 +1463,7 @@ purple_debug_info("msn", "In msn_got_info\n"); /* Make sure the connection is still valid */ - if (g_list_find((GList *)purple_connections_get_all(), info_data->gc) == NULL) + if (g_list_find(purple_connections_get_all(), info_data->gc) == NULL) { purple_debug_warning("msn", "invalid connection. ignoring buddy info.\n"); g_free(info_data->name); @@ -1883,7 +1883,7 @@ /* Make sure the connection is still valid if we got here by fetching a photo url */ if (url_text && (error_message != NULL || - g_list_find((GList *)purple_connections_get_all(), info_data->gc) == NULL)) + g_list_find(purple_connections_get_all(), info_data->gc) == NULL)) { purple_debug_warning("msn", "invalid connection. ignoring buddy photo info.\n"); g_free(stripped); @@ -1982,7 +1982,7 @@ if (acct && !purple_account_is_connected(acct)) acct = NULL; } else { /* Otherwise find an active account for the protocol */ - const GList *l = purple_accounts_get_all(); + GList *l = purple_accounts_get_all(); while (l) { if (!strcmp(prpl, purple_account_get_protocol_id(l->data)) && purple_account_is_connected(l->data)) { diff -r 97b735ca9d7a -r 9b9e202eb449 libpurple/protocols/oscar/oscar.c --- a/libpurple/protocols/oscar/oscar.c Sat Jun 16 20:16:36 2007 +0000 +++ b/libpurple/protocols/oscar/oscar.c Sat Jun 16 20:34:35 2007 +0000 @@ -6558,7 +6558,7 @@ if (acct && !purple_account_is_connected(acct)) acct = NULL; } else { /* Otherwise find an active account for the protocol */ - const GList *l = purple_accounts_get_all(); + GList *l = purple_accounts_get_all(); while (l) { if (!strcmp(prpl, purple_account_get_protocol_id(l->data)) && purple_account_is_connected(l->data)) { diff -r 97b735ca9d7a -r 9b9e202eb449 libpurple/protocols/sametime/sametime.c --- a/libpurple/protocols/sametime/sametime.c Sat Jun 16 20:16:36 2007 +0000 +++ b/libpurple/protocols/sametime/sametime.c Sat Jun 16 20:34:35 2007 +0000 @@ -2660,7 +2660,7 @@ GString *str; PurpleMimeDocument *doc; - const GList *parts; + GList *parts; img_by_cid = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL); images = NULL; @@ -3401,7 +3401,7 @@ static void conf_select_prompt_invite(PurpleBuddy *buddy, PurpleRequestFields *fields) { PurpleRequestField *f; - const GList *l; + GList *l; const char *msg; f = purple_request_fields_get_field(fields, CHAT_KEY_INVITE); @@ -5268,7 +5268,7 @@ PurpleRequestFields *fields) { PurpleRequestField *f; - const GList *l; + GList *l; f = purple_request_fields_get_field(fields, "group"); l = purple_request_field_list_get_items(f); @@ -5334,7 +5334,7 @@ static void remote_group_multi_cb(struct mwPurplePluginData *pd, PurpleRequestFields *fields) { PurpleRequestField *f; - const GList *l; + GList *l; f = purple_request_fields_get_field(fields, "group"); l = purple_request_field_list_get_selected(f); diff -r 97b735ca9d7a -r 9b9e202eb449 libpurple/protocols/silc/buddy.c --- a/libpurple/protocols/silc/buddy.c Sat Jun 16 20:16:36 2007 +0000 +++ b/libpurple/protocols/silc/buddy.c Sat Jun 16 20:34:35 2007 +0000 @@ -1117,7 +1117,7 @@ silcpurple_add_buddy_select_cb(SilcPurpleBuddyRes r, PurpleRequestFields *fields) { PurpleRequestField *f; - const GList *list; + GList *list; SilcClientEntry client_entry; SilcDList clients; diff -r 97b735ca9d7a -r 9b9e202eb449 libpurple/protocols/silc/chat.c --- a/libpurple/protocols/silc/chat.c Sat Jun 16 20:16:36 2007 +0000 +++ b/libpurple/protocols/silc/chat.c Sat Jun 16 20:34:35 2007 +0000 @@ -291,7 +291,7 @@ SilcClient client = sg->client; SilcClientConnection conn = sg->conn; PurpleRequestField *f; - const GList *list; + GList *list; SilcPublicKey public_key; SilcBuffer chpks, pk, chidp; SilcUInt16 c = 0, ct; diff -r 97b735ca9d7a -r 9b9e202eb449 libpurple/protocols/silc10/buddy.c --- a/libpurple/protocols/silc10/buddy.c Sat Jun 16 20:16:36 2007 +0000 +++ b/libpurple/protocols/silc10/buddy.c Sat Jun 16 20:34:35 2007 +0000 @@ -1118,7 +1118,7 @@ silcpurple_add_buddy_select_cb(SilcPurpleBuddyRes r, PurpleRequestFields *fields) { PurpleRequestField *f; - const GList *list; + GList *list; SilcClientEntry client_entry; f = purple_request_fields_get_field(fields, "list"); diff -r 97b735ca9d7a -r 9b9e202eb449 libpurple/protocols/silc10/chat.c --- a/libpurple/protocols/silc10/chat.c Sat Jun 16 20:16:36 2007 +0000 +++ b/libpurple/protocols/silc10/chat.c Sat Jun 16 20:34:35 2007 +0000 @@ -278,7 +278,7 @@ SilcClient client = sg->client; SilcClientConnection conn = sg->conn; PurpleRequestField *f; - const GList *list; + GList *list; SilcPublicKey public_key; SilcBuffer chpks, pk, chidp; SilcUInt16 c = 0, ct; diff -r 97b735ca9d7a -r 9b9e202eb449 libpurple/protocols/yahoo/yahoo.c --- a/libpurple/protocols/yahoo/yahoo.c Sat Jun 16 20:16:36 2007 +0000 +++ b/libpurple/protocols/yahoo/yahoo.c Sat Jun 16 20:34:35 2007 +0000 @@ -3861,7 +3861,7 @@ if (acct && !purple_account_is_connected(acct)) acct = NULL; } else { /* Otherwise find an active account for the protocol */ - const GList *l = purple_accounts_get_all(); + GList *l = purple_accounts_get_all(); while (l) { if (!strcmp(prpl, purple_account_get_protocol_id(l->data)) && purple_account_is_connected(l->data)) { diff -r 97b735ca9d7a -r 9b9e202eb449 libpurple/protocols/yahoo/yahoochat.c --- a/libpurple/protocols/yahoo/yahoochat.c Sat Jun 16 20:16:36 2007 +0000 +++ b/libpurple/protocols/yahoo/yahoochat.c Sat Jun 16 20:34:35 2007 +0000 @@ -633,10 +633,10 @@ * I think conference names are always ascii. */ -void yahoo_conf_leave(struct yahoo_data *yd, const char *room, const char *dn, const GList *who) +void yahoo_conf_leave(struct yahoo_data *yd, const char *room, const char *dn, GList *who) { struct yahoo_packet *pkt; - const GList *w; + GList *w; purple_debug_misc("yahoo", "leaving conference %s\n", room); @@ -653,11 +653,11 @@ } static int yahoo_conf_send(PurpleConnection *gc, const char *dn, const char *room, - const GList *members, const char *what) + GList *members, const char *what) { struct yahoo_data *yd = gc->proto_data; struct yahoo_packet *pkt; - const GList *who; + GList *who; char *msg, *msg2; int utf8 = 1; @@ -714,7 +714,7 @@ { struct yahoo_data *yd = gc->proto_data; struct yahoo_packet *pkt; - const GList *members; + GList *members; char *msg2 = NULL; if (msg) diff -r 97b735ca9d7a -r 9b9e202eb449 libpurple/protocols/yahoo/yahoochat.h --- a/libpurple/protocols/yahoo/yahoochat.h Sat Jun 16 20:16:36 2007 +0000 +++ b/libpurple/protocols/yahoo/yahoochat.h Sat Jun 16 20:34:35 2007 +0000 @@ -50,7 +50,7 @@ char *yahoo_get_chat_name(GHashTable *data); void yahoo_c_invite(PurpleConnection *gc, int id, const char *msg, const char *name); -void yahoo_conf_leave(struct yahoo_data *yd, const char *room, const char *dn, const GList *who); +void yahoo_conf_leave(struct yahoo_data *yd, const char *room, const char *dn, GList *who); void yahoo_chat_goto(PurpleConnection *gc, const char *name); diff -r 97b735ca9d7a -r 9b9e202eb449 libpurple/prpl.c --- a/libpurple/prpl.c Sat Jun 16 20:16:36 2007 +0000 +++ b/libpurple/prpl.c Sat Jun 16 20:34:35 2007 +0000 @@ -265,7 +265,7 @@ purple_prpl_get_statuses(PurpleAccount *account, PurplePresence *presence) { GList *statuses = NULL; - const GList *l; + GList *l; PurpleStatus *status; g_return_val_if_fail(account != NULL, NULL); diff -r 97b735ca9d7a -r 9b9e202eb449 libpurple/request.c --- a/libpurple/request.c Sat Jun 16 20:16:36 2007 +0000 +++ b/libpurple/request.c Sat Jun 16 20:34:35 2007 +0000 @@ -111,7 +111,7 @@ return (g_hash_table_lookup(fields->fields, id) != NULL); } -const GList * +GList * purple_request_fields_get_required(const PurpleRequestFields *fields) { g_return_val_if_fail(fields != NULL, NULL); @@ -872,9 +872,9 @@ } void -purple_request_field_list_set_selected(PurpleRequestField *field, const GList *items) +purple_request_field_list_set_selected(PurpleRequestField *field, GList *items) { - const GList *l; + GList *l; g_return_if_fail(field != NULL); g_return_if_fail(items != NULL); @@ -883,7 +883,7 @@ purple_request_field_list_clear_selected(field); if (!purple_request_field_list_get_multi_select(field) && - g_list_length((GList*)items) > 1) + g_list_length(items) > 1) { purple_debug_warning("request", "More than one item added to non-multi-select " @@ -913,7 +913,7 @@ item, NULL, NULL); } -const GList * +GList * purple_request_field_list_get_selected(const PurpleRequestField *field) { g_return_val_if_fail(field != NULL, NULL); @@ -922,7 +922,7 @@ return field->u.list.selected; } -const GList * +GList * purple_request_field_list_get_items(const PurpleRequestField *field) { g_return_val_if_fail(field != NULL, NULL); diff -r 97b735ca9d7a -r 9b9e202eb449 libpurple/request.h --- a/libpurple/request.h Sat Jun 16 20:16:36 2007 +0000 +++ b/libpurple/request.h Sat Jun 16 20:34:35 2007 +0000 @@ -285,9 +285,9 @@ * * @param fields The fields list. * - * @return The list of required fields. + * @constreturn The list of required fields. */ -const GList *purple_request_fields_get_required(const PurpleRequestFields *fields); +GList *purple_request_fields_get_required(const PurpleRequestFields *fields); /** * Returns whether or not a field with the specified ID is required. @@ -917,10 +917,10 @@ * Sets a list of selected items in a list field. * * @param field The field. - * @param items The list of selected items. + * @param items The list of selected items, which is not modified or freed. */ void purple_request_field_list_set_selected(PurpleRequestField *field, - const GList *items); + GList *items); /** * Returns whether or not a particular item is selected in a list field. @@ -941,9 +941,9 @@ * * @param field The field. * - * @return The list of selected items. + * @constreturn The list of selected items. */ -const GList *purple_request_field_list_get_selected( +GList *purple_request_field_list_get_selected( const PurpleRequestField *field); /** @@ -951,9 +951,9 @@ * * @param field The field. * - * @return The list of items. + * @constreturn The list of items. */ -const GList *purple_request_field_list_get_items(const PurpleRequestField *field); +GList *purple_request_field_list_get_items(const PurpleRequestField *field); /*@}*/ diff -r 97b735ca9d7a -r 9b9e202eb449 libpurple/savedstatuses.c --- a/libpurple/savedstatuses.c Sat Jun 16 20:16:36 2007 +0000 +++ b/libpurple/savedstatuses.c Sat Jun 16 20:34:35 2007 +0000 @@ -716,7 +716,7 @@ return TRUE; } -const GList * +GList * purple_savedstatuses_get_all(void) { return saved_statuses; diff -r 97b735ca9d7a -r 9b9e202eb449 libpurple/savedstatuses.h --- a/libpurple/savedstatuses.h Sat Jun 16 20:16:36 2007 +0000 +++ b/libpurple/savedstatuses.h Sat Jun 16 20:34:35 2007 +0000 @@ -151,9 +151,9 @@ /** * Returns all saved statuses. * - * @return A list of saved statuses. + * @constreturn A list of saved statuses. */ -const GList *purple_savedstatuses_get_all(void); +GList *purple_savedstatuses_get_all(void); /** * Returns the n most popular saved statuses. "Popularity" is diff -r 97b735ca9d7a -r 9b9e202eb449 libpurple/status.c --- a/libpurple/status.c Sat Jun 16 20:16:36 2007 +0000 +++ b/libpurple/status.c Sat Jun 16 20:34:35 2007 +0000 @@ -451,7 +451,7 @@ return NULL; } -const GList * +GList * purple_status_type_get_attrs(const PurpleStatusType *status_type) { g_return_val_if_fail(status_type != NULL, NULL); @@ -548,7 +548,7 @@ purple_status_new(PurpleStatusType *status_type, PurplePresence *presence) { PurpleStatus *status; - const GList *l; + GList *l; g_return_val_if_fail(status_type != NULL, NULL); g_return_val_if_fail(presence != NULL, NULL); @@ -719,10 +719,10 @@ void purple_status_set_active_with_attrs_list(PurpleStatus *status, gboolean active, - const GList *attrs) + GList *attrs) { gboolean changed = FALSE; - const GList *l; + GList *l; GList *specified_attr_ids = NULL; PurpleStatusType *status_type; @@ -1168,9 +1168,9 @@ } void -purple_presence_add_list(PurplePresence *presence, const GList *source_list) +purple_presence_add_list(PurplePresence *presence, GList *source_list) { - const GList *l; + GList *l; g_return_if_fail(presence != NULL); g_return_if_fail(source_list != NULL); @@ -1396,7 +1396,7 @@ return presence->u.buddy.buddy; } -const GList * +GList * purple_presence_get_statuses(const PurplePresence *presence) { g_return_val_if_fail(presence != NULL, NULL); @@ -1408,7 +1408,7 @@ purple_presence_get_status(const PurplePresence *presence, const char *status_id) { PurpleStatus *status; - const GList *l = NULL; + GList *l = NULL; g_return_val_if_fail(presence != NULL, NULL); g_return_val_if_fail(status_id != NULL, NULL); @@ -1487,7 +1487,7 @@ purple_presence_is_status_primitive_active(const PurplePresence *presence, PurpleStatusPrimitive primitive) { - const GList *l; + GList *l; g_return_val_if_fail(presence != NULL, FALSE); g_return_val_if_fail(primitive != PURPLE_STATUS_UNSET, FALSE); @@ -1535,7 +1535,7 @@ gboolean idle1, idle2; time_t idle_time_1, idle_time_2; int score1 = 0, score2 = 0; - const GList *l; + GList *l; if (presence1 == presence2) return 0; diff -r 97b735ca9d7a -r 9b9e202eb449 libpurple/status.h --- a/libpurple/status.h Sat Jun 16 20:16:36 2007 +0000 +++ b/libpurple/status.h Sat Jun 16 20:34:35 2007 +0000 @@ -387,9 +387,9 @@ * * @param status_type The status type. * - * @return The list of attributes. + * @constreturn The list of attributes. */ -const GList *purple_status_type_get_attrs(const PurpleStatusType *status_type); +GList *purple_status_type_get_attrs(const PurpleStatusType *status_type); /** * Find the PurpleStatusType with the given id. @@ -515,10 +515,11 @@ * @param active The active state. * @param attrs A list of attributes to set on the status. This list is * composed of key/value pairs, where each key is a valid - * attribute name for this PurpleStatusType. + * attribute name for this PurpleStatusType. The list is + * not modified or freed by this function. */ void purple_status_set_active_with_attrs_list(PurpleStatus *status, gboolean active, - const GList *attrs); + GList *attrs); /** * Sets the boolean value of an attribute in a status with the specified ID. @@ -768,9 +769,10 @@ * Adds a list of statuses to the presence. * * @param presence The presence. - * @param source_list The source list of statuses to add. + * @param source_list The source list of statuses to add, which is not + * modified or freed by this function. */ -void purple_presence_add_list(PurplePresence *presence, const GList *source_list); +void purple_presence_add_list(PurplePresence *presence, GList *source_list); /** * Sets the active state of a status in a presence. @@ -869,9 +871,9 @@ * * @param presence The presence. * - * @return The statuses. + * @constreturn The statuses. */ -const GList *purple_presence_get_statuses(const PurplePresence *presence); +GList *purple_presence_get_statuses(const PurplePresence *presence); /** * Returns the status with the specified ID from a presence. diff -r 97b735ca9d7a -r 9b9e202eb449 pidgin/gtkaccount.c --- a/pidgin/gtkaccount.c Sat Jun 16 20:16:36 2007 +0000 +++ b/pidgin/gtkaccount.c Sat Jun 16 20:34:35 2007 +0000 @@ -697,7 +697,7 @@ PurpleAccountOption *option; PurpleAccount *account; GtkWidget *frame, *vbox, *check, *entry, *combo, *menu, *item; - const GList *list, *node; + GList *list, *node; gint i, idx, int_value; GtkListStore *model; GtkTreeIter iter; @@ -1586,7 +1586,7 @@ account = purple_connection_get_account(gc); model = GTK_TREE_MODEL(accounts_window->model); - index = g_list_index((GList *)purple_accounts_get_all(), account); + index = g_list_index(purple_accounts_get_all(), account); if (gtk_tree_model_iter_nth_child(model, &iter, NULL, index)) { @@ -1789,13 +1789,13 @@ case GTK_TREE_VIEW_DROP_INTO_OR_AFTER: move_account_after(dialog->model, &dialog->drag_iter, &iter); - dest_index = g_list_index((GList *)purple_accounts_get_all(), + dest_index = g_list_index(purple_accounts_get_all(), account) + 1; break; case GTK_TREE_VIEW_DROP_BEFORE: case GTK_TREE_VIEW_DROP_INTO_OR_BEFORE: - dest_index = g_list_index((GList *)purple_accounts_get_all(), + dest_index = g_list_index(purple_accounts_get_all(), account); move_account_before(dialog->model, &dialog->drag_iter, @@ -2094,7 +2094,7 @@ static gboolean populate_accounts_list(AccountsWindow *dialog) { - const GList *l; + GList *l; gboolean ret = FALSE; GdkPixbuf *global_buddyicon = NULL; const char *path; @@ -2298,7 +2298,7 @@ global_buddyicon_changed(const char *name, PurplePrefType type, gconstpointer value, gpointer window) { - const GList *list; + GList *list; for (list = purple_accounts_get_all(); list; list = list->next) { account_modified_cb(list->data, window); } @@ -2429,7 +2429,7 @@ { PurpleConnection *gc = purple_account_get_connection(data->account); - if (g_list_find((GList *)purple_connections_get_all(), gc)) + if (g_list_find(purple_connections_get_all(), gc)) { purple_blist_request_add_buddy(data->account, data->username, NULL, data->alias); diff -r 97b735ca9d7a -r 9b9e202eb449 pidgin/gtkblist.c --- a/pidgin/gtkblist.c Sat Jun 16 20:16:36 2007 +0000 +++ b/pidgin/gtkblist.c Sat Jun 16 20:34:35 2007 +0000 @@ -696,7 +696,7 @@ gboolean pidgin_blist_joinchat_is_showable() { - const GList *c; + GList *c; PurpleConnection *gc; for (c = purple_connections_get_all(); c != NULL; c = c->next) { @@ -1551,7 +1551,7 @@ add_buddies_from_vcard(const char *prpl_id, PurpleGroup *group, GList *list, const char *alias) { - const GList *l; + GList *l; PurpleAccount *account = NULL; PurpleConnection *gc; @@ -2909,7 +2909,7 @@ prpl = purple_find_prpl(purple_account_get_protocol_id(chat->account)); prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); - if (g_list_length((GList *)purple_connections_get_all()) > 1) + if (g_list_length(purple_connections_get_all()) > 1) { tmp = g_markup_escape_text(chat->account->username, -1); g_string_append_printf(str, _("\nAccount: %s"), tmp); @@ -2974,7 +2974,7 @@ user_info = purple_notify_user_info_new(); /* Account */ - if (full && g_list_length((GList *)purple_connections_get_all()) > 1) + if (full && g_list_length(purple_connections_get_all()) > 1) { tmp = g_markup_escape_text(purple_account_get_username( purple_buddy_get_account(b)), -1); @@ -5733,7 +5733,7 @@ { PidginAddChatData *data; PidginBuddyList *gtkblist; - const GList *l; + GList *l; PurpleConnection *gc; GtkWidget *label; GtkWidget *rowbox; @@ -6500,8 +6500,7 @@ { GtkWidget *menuitem = NULL, *submenu = NULL; GtkAccelGroup *accel_group = NULL; - GList *l = NULL; - const GList *accounts; + GList *l = NULL, *accounts = NULL; gboolean disabled_accounts = FALSE; if (accountmenu == NULL) diff -r 97b735ca9d7a -r 9b9e202eb449 pidgin/gtkconv.c --- a/pidgin/gtkconv.c Sat Jun 16 20:16:36 2007 +0000 +++ b/pidgin/gtkconv.c Sat Jun 16 20:34:35 2007 +0000 @@ -2690,7 +2690,7 @@ gboolean hidden_only, guint max_count) { - const GList *l; + GList *l; GList *r = NULL; guint c = 0; @@ -3850,7 +3850,7 @@ g_list_free(list); } else if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT) { PurpleConvChat *chat = PURPLE_CONV_CHAT(conv); - const GList *l = purple_conv_chat_get_users(chat); + GList *l = purple_conv_chat_get_users(chat); GtkTreeModel *model = gtk_tree_view_get_model(GTK_TREE_VIEW(PIDGIN_CONVERSATION(conv)->u.chat->list)); GtkTreeIter iter; int f; @@ -5446,7 +5446,7 @@ gtkconv = PIDGIN_CONVERSATION(conv); gtkchat = gtkconv->u.chat; - num_users = g_list_length((GList *)purple_conv_chat_get_users(chat)); + num_users = g_list_length(purple_conv_chat_get_users(chat)); g_snprintf(tmp, sizeof(tmp), ngettext("%d person in room", "%d people in room", @@ -5540,7 +5540,7 @@ gtkconv = PIDGIN_CONVERSATION(conv); gtkchat = gtkconv->u.chat; - num_users = g_list_length((GList *)purple_conv_chat_get_users(chat)); + num_users = g_list_length(purple_conv_chat_get_users(chat)); for (l = users; l != NULL; l = l->next) { model = gtk_tree_view_get_model(GTK_TREE_VIEW(gtkchat->list)); @@ -6537,7 +6537,7 @@ close_on_tabs_pref_cb(const char *name, PurplePrefType type, gconstpointer value, gpointer data) { - const GList *l; + GList *l; PurpleConversation *conv; PidginConversation *gtkconv; @@ -6561,7 +6561,7 @@ gconstpointer value, gpointer data) { #ifdef USE_GTKSPELL - const GList *cl; + GList *cl; PurpleConversation *conv; PidginConversation *gtkconv; GtkSpell *spell; @@ -6608,7 +6608,7 @@ show_timestamps_pref_cb(const char *name, PurplePrefType type, gconstpointer value, gpointer data) { - const GList *l; + GList *l; PurpleConversation *conv; PidginConversation *gtkconv; PidginWindow *win; @@ -6636,7 +6636,7 @@ show_formatting_toolbar_pref_cb(const char *name, PurplePrefType type, gconstpointer value, gpointer data) { - const GList *l; + GList *l; PurpleConversation *conv; PidginConversation *gtkconv; PidginWindow *win; @@ -6666,7 +6666,7 @@ animate_buddy_icons_pref_cb(const char *name, PurplePrefType type, gconstpointer value, gpointer data) { - const GList *l; + GList *l; PurpleConversation *conv; PidginConversation *gtkconv; PidginWindow *win; @@ -6693,7 +6693,7 @@ show_buddy_icons_pref_cb(const char *name, PurplePrefType type, gconstpointer value, gpointer data) { - const GList *l; + GList *l; for (l = purple_get_conversations(); l != NULL; l = l->next) { PurpleConversation *conv = l->data; @@ -6819,7 +6819,7 @@ static void account_signed_off_cb(PurpleConnection *gc, gpointer event) { - const GList *iter; + GList *iter; for (iter = purple_get_conversations(); iter; iter = iter->next) { diff -r 97b735ca9d7a -r 9b9e202eb449 pidgin/gtkdocklet.c --- a/pidgin/gtkdocklet.c Sat Jun 16 20:16:36 2007 +0000 +++ b/pidgin/gtkdocklet.c Sat Jun 16 20:34:35 2007 +0000 @@ -109,8 +109,7 @@ static gboolean docklet_update_status() { - GList *convs; - const GList *l; + GList *convs, *l; int count; PurpleSavedStatus *saved_status; PurpleStatusPrimitive newstatus = PURPLE_STATUS_OFFLINE; @@ -214,7 +213,8 @@ static gboolean online_account_supports_chat() { - const GList *c = purple_connections_get_all(); + GList *c = NULL; + c = purple_connections_get_all(); while(c != NULL) { PurpleConnection *gc = c->data; diff -r 97b735ca9d7a -r 9b9e202eb449 pidgin/gtklog.c --- a/pidgin/gtklog.c Sat Jun 16 20:16:36 2007 +0000 +++ b/pidgin/gtklog.c Sat Jun 16 20:34:35 2007 +0000 @@ -757,7 +757,7 @@ void pidgin_syslog_show() { - const GList *accounts; + GList *accounts = NULL; GList *logs = NULL; if (syslog_viewer != NULL) { diff -r 97b735ca9d7a -r 9b9e202eb449 pidgin/gtkmain.c --- a/pidgin/gtkmain.c Sat Jun 16 20:16:36 2007 +0000 +++ b/pidgin/gtkmain.c Sat Jun 16 20:34:35 2007 +0000 @@ -125,7 +125,7 @@ } g_strfreev(names); } else { /* no name given, use the first account */ - const GList *accounts; + GList *accounts; accounts = purple_accounts_get_all(); if (accounts != NULL) @@ -435,7 +435,7 @@ char *opt_login_arg = NULL; char *opt_session_arg = NULL; char *search_path; - const GList *accounts; + GList *accounts; #ifdef HAVE_SIGNAL_H int sig_indx; /* for setting up signal catching */ sigset_t sigset; diff -r 97b735ca9d7a -r 9b9e202eb449 pidgin/gtkpounce.c --- a/pidgin/gtkpounce.c Sat Jun 16 20:16:36 2007 +0000 +++ b/pidgin/gtkpounce.c Sat Jun 16 20:34:35 2007 +0000 @@ -211,7 +211,7 @@ static void populate_pounces_list(PouncesManager *dialog) { - const GList *pounces; + GList *pounces; gtk_list_store_clear(dialog->model); @@ -496,7 +496,7 @@ } else { - const GList *connections = purple_connections_get_all(); + GList *connections = purple_connections_get_all(); PurpleConnection *gc; if (connections != NULL) diff -r 97b735ca9d7a -r 9b9e202eb449 pidgin/gtkrequest.c --- a/pidgin/gtkrequest.c Sat Jun 16 20:16:36 2007 +0000 +++ b/pidgin/gtkrequest.c Sat Jun 16 20:34:35 2007 +0000 @@ -974,7 +974,7 @@ GtkTreeSelection *sel; GtkTreeViewColumn *column; GtkTreeIter iter; - const GList *l; + GList *l; /* Create the scrolled window */ sw = gtk_scrolled_window_new(NULL, NULL); diff -r 97b735ca9d7a -r 9b9e202eb449 pidgin/gtkroomlist.c --- a/pidgin/gtkroomlist.c Sat Jun 16 20:16:36 2007 +0000 +++ b/pidgin/gtkroomlist.c Sat Jun 16 20:34:35 2007 +0000 @@ -343,7 +343,7 @@ gboolean pidgin_roomlist_is_showable() { - const GList *c; + GList *c; PurpleConnection *gc; for (c = purple_connections_get_all(); c != NULL; c = c->next) { diff -r 97b735ca9d7a -r 9b9e202eb449 pidgin/gtksavedstatuses.c --- a/pidgin/gtksavedstatuses.c Sat Jun 16 20:16:36 2007 +0000 +++ b/pidgin/gtksavedstatuses.c Sat Jun 16 20:34:35 2007 +0000 @@ -389,7 +389,7 @@ static void populate_saved_status_list(StatusWindow *dialog) { - const GList *saved_statuses; + GList *saved_statuses; gtk_list_store_clear(dialog->model); @@ -1012,7 +1012,7 @@ static void status_editor_populate_list(StatusEditor *dialog, PurpleSavedStatus *saved_status) { - const GList *iter; + GList *iter; PurpleSavedStatusSub *substatus; gtk_list_store_clear(dialog->model); @@ -1393,7 +1393,7 @@ GtkTreeIter iter; GtkCellRenderer *rend; const char *status_id = NULL; - const GList *list; + GList *list; gboolean select = FALSE; g_return_if_fail(status_editor != NULL); diff -r 97b735ca9d7a -r 9b9e202eb449 pidgin/gtkstatusbox.c --- a/pidgin/gtkstatusbox.c Sat Jun 16 20:16:36 2007 +0000 +++ b/pidgin/gtkstatusbox.c Sat Jun 16 20:34:35 2007 +0000 @@ -191,7 +191,7 @@ static void update_to_reflect_account_status(PidginStatusBox *status_box, PurpleAccount *account, PurpleStatus *newstatus) { - const GList *l; + GList *l; int status_no = -1; const PurpleStatusType *statustype = NULL; const char *message; @@ -732,7 +732,7 @@ static PurpleStatusType * find_status_type_by_index(const PurpleAccount *account, gint active) { - const GList *l = purple_account_get_status_types(account); + GList *l = purple_account_get_status_types(account); gint i; for (i = 0; l; l = l->next) { @@ -941,7 +941,7 @@ { PurpleAccount *acct = NULL, *acct2; GList *tmp, *tmp2, *active_accts = purple_accounts_get_all_active(); - const GList *s, *s1, *s2; + GList *s, *s1, *s2; for (tmp = active_accts; tmp; tmp = tmp->next) { acct = tmp->data; @@ -989,7 +989,7 @@ add_account_statuses(PidginStatusBox *status_box, PurpleAccount *account) { /* Per-account */ - const GList *l; + GList *l; GdkPixbuf *pixbuf; for (l = purple_account_get_status_types(account); l != NULL; l = l->next) @@ -1434,7 +1434,7 @@ } } } else { - const GList *accounts; + GList *accounts; for (accounts = purple_accounts_get_all(); accounts != NULL; accounts = accounts->next) { PurpleAccount *account = accounts->data; PurplePlugin *plug = purple_find_prpl(purple_account_get_protocol_id(account)); @@ -2223,7 +2223,7 @@ { /* Manually find the appropriate transient acct */ if (status_box->token_status_account) { - const GList *iter = purple_savedstatuses_get_all(); + GList *iter = purple_savedstatuses_get_all(); GList *tmp, *active_accts = purple_accounts_get_all_active(); for (; iter != NULL; iter = iter->next) { diff -r 97b735ca9d7a -r 9b9e202eb449 pidgin/gtkthemes.c --- a/pidgin/gtkthemes.c Sat Jun 16 20:16:36 2007 +0000 +++ b/pidgin/gtkthemes.c Sat Jun 16 20:34:35 2007 +0000 @@ -237,7 +237,7 @@ } if (load) { - const GList *cnv; + GList *cnv; if (current_smiley_theme) pidgin_themes_destroy_smiley_theme(current_smiley_theme); diff -r 97b735ca9d7a -r 9b9e202eb449 pidgin/gtkutils.c --- a/pidgin/gtkutils.c Sat Jun 16 20:16:36 2007 +0000 +++ b/pidgin/gtkutils.c Sat Jun 16 20:34:35 2007 +0000 @@ -687,8 +687,8 @@ AopMenu *aop_menu = NULL; PurpleAccount *account; GdkPixbuf *pixbuf = NULL; - const GList *list; - const GList *p; + GList *list; + GList *p; GtkSizeGroup *sg; int i; char buf[256]; @@ -995,9 +995,9 @@ /* Check for a compatible account. */ if (ret_account != NULL) { - const GList *list; + GList *list; PurpleAccount *account = NULL; - const GList *l; + GList *l; const char *protoname; if (all_accounts) diff -r 97b735ca9d7a -r 9b9e202eb449 pidgin/plugins/gestures/gestures.c --- a/pidgin/plugins/gestures/gestures.c Sat Jun 16 20:16:36 2007 +0000 +++ b/pidgin/plugins/gestures/gestures.c Sat Jun 16 20:34:35 2007 +0000 @@ -176,7 +176,7 @@ plugin_load(PurplePlugin *plugin) { PurpleConversation *conv; - const GList *l; + GList *l; for (l = purple_get_conversations(); l != NULL; l = l->next) { conv = (PurpleConversation *)l->data; @@ -199,7 +199,7 @@ { PurpleConversation *conv; PidginConversation *gtkconv; - const GList *l; + GList *l; for (l = purple_get_conversations(); l != NULL; l = l->next) { conv = (PurpleConversation *)l->data; diff -r 97b735ca9d7a -r 9b9e202eb449 pidgin/plugins/gevolution/add_buddy_dialog.c --- a/pidgin/plugins/gevolution/add_buddy_dialog.c Sat Jun 16 20:16:36 2007 +0000 +++ b/pidgin/plugins/gevolution/add_buddy_dialog.c Sat Jun 16 20:34:35 2007 +0000 @@ -162,7 +162,7 @@ GList *list, const char *id) { PurpleAccount *account = NULL; - const GList *l; + GList *l; GtkTreeIter iter; GdkPixbuf *pixbuf; diff -r 97b735ca9d7a -r 9b9e202eb449 pidgin/plugins/gevolution/gevolution.c --- a/pidgin/plugins/gevolution/gevolution.c Sat Jun 16 20:16:36 2007 +0000 +++ b/pidgin/plugins/gevolution/gevolution.c Sat Jun 16 20:34:35 2007 +0000 @@ -69,8 +69,7 @@ const char *prpl_id, EContactField field) { GList *ims = e_contact_get(contact, field); - const GList *l; - const GList *l2; + GList *l, *l2; if (ims == NULL) return; @@ -119,9 +118,9 @@ } static void -contacts_changed_cb(EBookView *book_view, const GList *contacts) +contacts_changed_cb(EBookView *book_view, GList *contacts) { - const GList *l; + GList *l; if (purple_connections_get_all() == NULL) return; @@ -401,7 +400,7 @@ GtkCellRenderer *renderer; GdkPixbuf *pixbuf; GtkListStore *model; - const GList *l; + GList *l; /* Outside container */ ret = gtk_vbox_new(FALSE, 18); diff -r 97b735ca9d7a -r 9b9e202eb449 pidgin/plugins/notify.c --- a/pidgin/plugins/notify.c Sat Jun 16 20:16:36 2007 +0000 +++ b/pidgin/plugins/notify.c Sat Jun 16 20:34:35 2007 +0000 @@ -624,7 +624,7 @@ static void apply_method() { - const GList *convs; + GList *convs; PidginWindow *purplewin = NULL; for (convs = purple_get_conversations(); convs != NULL; @@ -644,7 +644,7 @@ static void apply_notify() { - const GList *convs = purple_get_conversations(); + GList *convs = purple_get_conversations(); while (convs) { PurpleConversation *conv = (PurpleConversation *)convs->data; @@ -818,7 +818,7 @@ static gboolean plugin_load(PurplePlugin *plugin) { - const GList *convs = purple_get_conversations(); + GList *convs = purple_get_conversations(); void *conv_handle = purple_conversations_get_handle(); void *gtk_conv_handle = pidgin_conversations_get_handle(); @@ -860,7 +860,7 @@ static gboolean plugin_unload(PurplePlugin *plugin) { - const GList *convs = purple_get_conversations(); + GList *convs = purple_get_conversations(); while (convs) { PurpleConversation *conv = (PurpleConversation *)convs->data; diff -r 97b735ca9d7a -r 9b9e202eb449 pidgin/plugins/spellchk.c --- a/pidgin/plugins/spellchk.c Sat Jun 16 20:16:36 2007 +0000 +++ b/pidgin/plugins/spellchk.c Sat Jun 16 20:34:35 2007 +0000 @@ -2118,7 +2118,7 @@ plugin_load(PurplePlugin *plugin) { void *conv_handle = purple_conversations_get_handle(); - const GList *convs; + GList *convs; load_conf(); @@ -2137,7 +2137,7 @@ static gboolean plugin_unload(PurplePlugin *plugin) { - const GList *convs; + GList *convs; /* Detach from existing conversations */ for (convs = purple_get_conversations(); convs != NULL; convs = convs->next) diff -r 97b735ca9d7a -r 9b9e202eb449 pidgin/plugins/timestamp.c --- a/pidgin/plugins/timestamp.c Sat Jun 16 20:16:36 2007 +0000 +++ b/pidgin/plugins/timestamp.c Sat Jun 16 20:34:35 2007 +0000 @@ -77,7 +77,7 @@ time_t now = time(NULL) / interval * interval; time_t then; - if (!g_list_find((GList *)purple_get_conversations(), conv)) + if (!g_list_find(purple_get_conversations(), conv)) return FALSE; then = GPOINTER_TO_INT(purple_conversation_get_data( @@ -98,7 +98,7 @@ PidginConversation *gtk_conv = PIDGIN_CONVERSATION(conv); GtkTextBuffer *buffer; - if (!g_list_find((GList *)purple_get_conversations(), conv)) + if (!g_list_find(purple_get_conversations(), conv)) return; buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(gtk_conv->imhtml)); diff -r 97b735ca9d7a -r 9b9e202eb449 pidgin/plugins/xmppconsole.c --- a/pidgin/plugins/xmppconsole.c Sat Jun 16 20:16:36 2007 +0000 +++ b/pidgin/plugins/xmppconsole.c Sat Jun 16 20:34:35 2007 +0000 @@ -731,7 +731,7 @@ GtkWidget *label; GtkTextBuffer *buffer; GtkWidget *toolbar; - const GList *connections; + GList *connections; #if GTK_CHECK_VERSION(2,4,0) GtkToolItem *button; #endif