From 96254254a6ed491ebf8826f8e28d40425aa4f2ef Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Sat, 3 Nov 2018 10:35:30 +0000 Subject: GTK: Squash GCC8.2 warning. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit frontends/gtk/download.c: In function ‘gui_download_window_create’: frontends/gtk/download.c:829:10: warning: cast between incompatible function types from ‘gboolean (*)(gboolean)’ {aka ‘int (*)(int)’} to ‘gboolean (*)(void *)’ {aka ‘int (*)(void *)’} [-Wcast-function-type] (GSourceFunc) nsgtk_download_update, FALSE); ^ --- frontends/gtk/download.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'frontends') diff --git a/frontends/gtk/download.c b/frontends/gtk/download.c index c9cc1ea54..3eab53221 100644 --- a/frontends/gtk/download.c +++ b/frontends/gtk/download.c @@ -745,6 +745,16 @@ static void nsgtk_download_store_create_item (struct gui_download_window *dl) NSGTK_DOWNLOAD, dl, -1); } +/** + * Wrapper to GSourceFunc-ify nsgtk_download_update. + */ +static gboolean nsgtk_download_gsourcefunc__nsgtk_download_update( + gpointer user_data) +{ + bool *force_update = user_data; + return nsgtk_download_update(*force_update); +} + static struct gui_download_window * gui_download_window_create(download_context *ctx, struct gui_window *gui) { @@ -825,8 +835,10 @@ gui_download_window_create(download_context *ctx, struct gui_window *gui) nsgtk_download_change_status(download, NSGTK_DOWNLOAD_WORKING); if (nsgtk_downloads_num_active == 0) { - g_timeout_add(UPDATE_RATE, - (GSourceFunc) nsgtk_download_update, FALSE); + g_timeout_add( + UPDATE_RATE, + nsgtk_download_gsourcefunc__nsgtk_download_update, + FALSE); } nsgtk_downloads_list = g_list_prepend(nsgtk_downloads_list, download); -- cgit v1.2.3