Remove redundant callback type casts

Mon, 04 Nov 2019 13:28:18 +0300

author
qarkai <qarkai@gmail.com>
date
Mon, 04 Nov 2019 13:28:18 +0300
changeset 40128
9b64a2d80f8c
parent 40102
df0db1029678
child 40129
539acf784dbc

Remove redundant callback type casts

libpurple/buddylist.c file | annotate | diff | comparison | revisions
libpurple/plugins/keyrings/internalkeyring.c file | annotate | diff | comparison | revisions
libpurple/presence.c file | annotate | diff | comparison | revisions
libpurple/protocols.c file | annotate | diff | comparison | revisions
libpurple/protocols/facebook/api.c file | annotate | diff | comparison | revisions
libpurple/protocols/irc/msgs.c file | annotate | diff | comparison | revisions
pidgin/gtkconv.c file | annotate | diff | comparison | revisions
pidgin/gtknotify.c file | annotate | diff | comparison | revisions
--- a/libpurple/buddylist.c	Sun Nov 03 09:22:21 2019 +0000
+++ b/libpurple/buddylist.c	Mon Nov 04 13:28:18 2019 +0300
@@ -727,9 +727,7 @@
 	buddies_cache = g_hash_table_new_full(g_direct_hash, g_direct_equal,
 					 NULL, (GDestroyNotify)g_hash_table_destroy);
 
-	groups_cache = g_hash_table_new_full((GHashFunc)g_str_hash,
-					 (GEqualFunc)g_str_equal,
-					 (GDestroyNotify)g_free, NULL);
+	groups_cache = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL);
 
 	for (account = purple_accounts_get_all(); account != NULL; account = account->next)
 	{
--- a/libpurple/plugins/keyrings/internalkeyring.c	Sun Nov 03 09:22:21 2019 +0000
+++ b/libpurple/plugins/keyrings/internalkeyring.c	Mon Nov 04 13:28:18 2019 +0300
@@ -849,7 +849,7 @@
 
 	*mode = "ciphertext";
 	*data = ciphertext;
-	*destroy = (GDestroyNotify)g_free;
+	*destroy = g_free;
 	return TRUE;
 }
 
--- a/libpurple/presence.c	Sun Nov 03 09:22:21 2019 +0000
+++ b/libpurple/presence.c	Mon Nov 04 13:28:18 2019 +0300
@@ -462,7 +462,7 @@
 		purple_presence_get_instance_private(PURPLE_PRESENCE(object));
 
 	if (priv->statuses) {
-		g_list_free_full(priv->statuses, (GDestroyNotify)g_object_unref);
+		g_list_free_full(priv->statuses, g_object_unref);
 		priv->statuses = NULL;
 	}
 
--- a/libpurple/protocols.c	Sun Nov 03 09:22:21 2019 +0000
+++ b/libpurple/protocols.c	Mon Nov 04 13:28:18 2019 +0300
@@ -690,7 +690,7 @@
 	void *handle = purple_protocols_get_handle();
 
 	protocols = g_hash_table_new_full(g_str_hash, g_str_equal, g_free,
-			(GDestroyNotify)g_object_unref);
+			g_object_unref);
 
 	purple_signal_register(handle, "protocol-added",
 	                       purple_marshal_VOID__POINTER,
--- a/libpurple/protocols/facebook/api.c	Sun Nov 03 09:22:21 2019 +0000
+++ b/libpurple/protocols/facebook/api.c	Mon Nov 04 13:28:18 2019 +0300
@@ -2339,7 +2339,7 @@
 		g_signal_emit_by_name(api, "contacts-delta", added, removed);
 
 		g_slist_free_full(added, (GDestroyNotify) fb_api_user_free);
-		g_slist_free_full(removed, (GDestroyNotify) g_free);
+		g_slist_free_full(removed, g_free);
 
 		g_list_free(elms);
 		json_array_unref(arr);
--- a/libpurple/protocols/irc/msgs.c	Sun Nov 03 09:22:21 2019 +0000
+++ b/libpurple/protocols/irc/msgs.c	Mon Nov 04 13:28:18 2019 +0300
@@ -495,8 +495,8 @@
 		}
 		realname = g_strdup(cur);
 
-		g_object_set_data_full(G_OBJECT(cb), "userhost", userhost, (GDestroyNotify)g_free);
-		g_object_set_data_full(G_OBJECT(cb), "realname", realname, (GDestroyNotify)g_free);
+		g_object_set_data_full(G_OBJECT(cb), "userhost", userhost, g_free);
+		g_object_set_data_full(G_OBJECT(cb), "realname", realname, g_free);
 
 		flags = purple_chat_user_get_flags(cb);
 
@@ -971,7 +971,7 @@
 	cb = purple_chat_conversation_find_user(chat, nick);
 
 	if (cb) {
-		g_object_set_data_full(G_OBJECT(cb), "userhost", userhost, (GDestroyNotify)g_free);
+		g_object_set_data_full(G_OBJECT(cb), "userhost", userhost, g_free);
 	}
 
 	if ((ib = g_hash_table_lookup(irc->buddies, nick)) != NULL) {
--- a/pidgin/gtkconv.c	Sun Nov 03 09:22:21 2019 +0000
+++ b/pidgin/gtkconv.c	Mon Nov 04 13:28:18 2019 +0300
@@ -2258,7 +2258,7 @@
 		win = pidgin_buddy_icon_chooser_new(GTK_WINDOW(toplevel),
 		                                    custom_icon_sel_cb, contact);
 		g_object_set_data_full(G_OBJECT(contact), "buddy-icon-chooser", win,
-		                       (GDestroyNotify)g_object_unref);
+				       g_object_unref);
 	}
 	gtk_native_dialog_show(GTK_NATIVE_DIALOG(win));
 }
@@ -2744,7 +2744,7 @@
 				buddy = purple_buddy_new(account, purple_conversation_get_name(conv), NULL);
 				purple_blist_node_set_transient((PurpleBlistNode *)buddy, TRUE);
 				g_object_set_data_full(G_OBJECT(gtkconv->history), "transient_buddy",
-						buddy, (GDestroyNotify)g_object_unref);
+						buddy, g_object_unref);
 			}
 		}
 	}
--- a/pidgin/gtknotify.c	Sun Nov 03 09:22:21 2019 +0000
+++ b/pidgin/gtknotify.c	Mon Nov 04 13:28:18 2019 +0300
@@ -360,7 +360,7 @@
 }
 
 static void
-reset_mail_dialog(GtkDialog *unused)
+reset_mail_dialog(gpointer unused)
 {
 	g_return_if_fail(mail_dialog != NULL);
 
@@ -841,7 +841,7 @@
 		pidgin_blist_set_headline(label_text, "mail-unread",
 				G_CALLBACK(pidgin_notify_emails_present),
 				mail_dialog->dialog,
-				(GDestroyNotify)reset_mail_dialog);
+				reset_mail_dialog);
 		mail_dialog->in_use = FALSE;
 		g_free(label_text);
 	} else if (!gtk_widget_has_focus(mail_dialog->dialog))

mercurial