From ff0c453f01c96f89d249e6717b243667d6940604 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Sun, 30 Apr 2023 17:42:35 -0500 Subject: Use G_SOURCE_FUNC macro more It was added in GLib 2.58 Testing Done: Compiled only. Reviewed at https://reviews.imfreedom.org/r/2446/ --- finch/gntblist.c | 14 ++++++++++---- finch/plugins/gntgf/gntgf.c | 3 ++- libpurple/plugins/joinpart/joinpart.c | 2 +- libpurple/protocols/gg/edisc.c | 2 +- libpurple/protocols/jabber/jabber.c | 2 +- pidgin/gtkmedia.c | 2 +- 6 files changed, 16 insertions(+), 9 deletions(-) diff --git a/finch/gntblist.c b/finch/gntblist.c index bb35924609..48004b3793 100644 --- a/finch/gntblist.c +++ b/finch/gntblist.c @@ -1719,7 +1719,7 @@ draw_tooltip(FinchBuddyList *ggblist) * top of that, if the selected buddy belongs to the disconnected * account, then retrieving the tooltip for that causes crash. So * let's make sure we wait for all the buddies to be removed first.*/ - int id = g_timeout_add(0, (GSourceFunc)draw_tooltip_real, ggblist); + int id = g_timeout_add(0, G_SOURCE_FUNC(draw_tooltip_real), ggblist); g_object_set_data_full(G_OBJECT(ggblist->window), "draw_tooltip_calback", GINT_TO_POINTER(id), (GDestroyNotify)g_source_remove); } @@ -2086,7 +2086,9 @@ status_selection_changed(G_GNUC_UNUSED GntComboBox *box, /* Move the focus to the entry box */ /* XXX: Make sure the selected status can have a message */ gnt_box_move_focus(GNT_BOX(ggblist->window), 1); - ggblist->typing = g_timeout_add_seconds(TYPING_TIMEOUT_S, (GSourceFunc)remove_typing_cb, NULL); + ggblist->typing = g_timeout_add_seconds(TYPING_TIMEOUT_S, + G_SOURCE_FUNC(remove_typing_cb), + NULL); } else if (now->type == STATUS_SAVED_ALL) { @@ -2121,7 +2123,9 @@ status_text_changed(G_GNUC_UNUSED GntEntry *entry, const char *text, return TRUE; } - ggblist->typing = g_timeout_add_seconds(TYPING_TIMEOUT_S, (GSourceFunc)remove_typing_cb, NULL); + ggblist->typing = g_timeout_add_seconds(TYPING_TIMEOUT_S, + G_SOURCE_FUNC(remove_typing_cb), + NULL); return FALSE; } @@ -2357,7 +2361,9 @@ buddy_signed_on_off_cb(gpointer data) g_clear_handle_id(&fnode->signed_timer, g_source_remove); g_object_ref(node); - fnode->signed_timer = g_timeout_add_seconds(6, (GSourceFunc)buddy_recent_signed_on_off, data); + fnode->signed_timer = g_timeout_add_seconds(6, + G_SOURCE_FUNC(buddy_recent_signed_on_off), + data); update_node_display(node, ggblist); if (purple_blist_node_get_parent(node) && PURPLE_IS_META_CONTACT(purple_blist_node_get_parent(node))) update_node_display(purple_blist_node_get_parent(node), ggblist); diff --git a/finch/plugins/gntgf/gntgf.c b/finch/plugins/gntgf/gntgf.c index a4d0b3e87c..d70c659b5e 100644 --- a/finch/plugins/gntgf/gntgf.c +++ b/finch/plugins/gntgf/gntgf.c @@ -215,7 +215,8 @@ notify(PurpleConversation *conv, const char *fmt, ...) } gnt_widget_draw(window); - toast->timer = g_timeout_add_seconds(4, (GSourceFunc)remove_toaster, toast); + toast->timer = g_timeout_add_seconds(4, G_SOURCE_FUNC(remove_toaster), + toast); toasters = g_list_prepend(toasters, toast); } diff --git a/libpurple/plugins/joinpart/joinpart.c b/libpurple/plugins/joinpart/joinpart.c index 0a5edc8fb0..22ece5c30b 100644 --- a/libpurple/plugins/joinpart/joinpart.c +++ b/libpurple/plugins/joinpart/joinpart.c @@ -238,7 +238,7 @@ join_part_load(GPluginPlugin *plugin, G_GNUC_UNUSED GError **error) G_CALLBACK(received_chat_msg_cb), users); /* Cleanup every 5 minutes */ - id = g_timeout_add_seconds(60 * 5, (GSourceFunc)clean_users_hash, users); + id = g_timeout_add_seconds(60 * 5, G_SOURCE_FUNC(clean_users_hash), users); g_object_set_data(G_OBJECT(plugin), "users", users); g_object_set_data(G_OBJECT(plugin), "id", GUINT_TO_POINTER(id)); diff --git a/libpurple/protocols/gg/edisc.c b/libpurple/protocols/gg/edisc.c index 640ab3f9e1..0ada1f98a8 100644 --- a/libpurple/protocols/gg/edisc.c +++ b/libpurple/protocols/gg/edisc.c @@ -981,7 +981,7 @@ ggp_edisc_xfer_recv_done_cb(GObject *source, GAsyncResult *result, poll = g_pollable_input_stream_create_source(G_POLLABLE_INPUT_STREAM(input), edisc_xfer->cancellable); g_source_set_callback(poll, - (GSourceFunc)(gpointer)ggp_edisc_xfer_recv_pollable_source_cb, + G_SOURCE_FUNC(ggp_edisc_xfer_recv_pollable_source_cb), xfer, NULL); edisc_xfer->handler = g_source_attach(poll, NULL); g_source_unref(poll); diff --git a/libpurple/protocols/jabber/jabber.c b/libpurple/protocols/jabber/jabber.c index dd317f1bfe..5d9a719530 100644 --- a/libpurple/protocols/jabber/jabber.c +++ b/libpurple/protocols/jabber/jabber.c @@ -537,7 +537,7 @@ jabber_keepalive(G_GNUC_UNUSED PurpleProtocolServer *protocol_server, if (js->keepalive_timeout == 0) { jabber_keepalive_ping(js); js->keepalive_timeout = g_timeout_add_seconds(120, - (GSourceFunc)(jabber_keepalive_timeout), gc); + G_SOURCE_FUNC(jabber_keepalive_timeout), gc); } } diff --git a/pidgin/gtkmedia.c b/pidgin/gtkmedia.c index 9630f93564..e088286480 100644 --- a/pidgin/gtkmedia.c +++ b/pidgin/gtkmedia.c @@ -769,7 +769,7 @@ pidgin_media_ready_cb(PurpleMedia *media, PidginMedia *gtkmedia, const gchar *si g_clear_handle_id(>kmedia->priv->timeout_id, g_source_remove); gtkmedia->priv->request_type |= type; gtkmedia->priv->timeout_id = g_timeout_add(500, - (GSourceFunc)pidgin_request_timeout_cb, + G_SOURCE_FUNC(pidgin_request_timeout_cb), gtkmedia); } -- cgit v1.2.1