From ceaed4a17cb3b0a14c89f10b72a636f94af97e7a Mon Sep 17 00:00:00 2001 From: Friedrich Beckmann Date: Mon, 24 Aug 2020 11:19:33 +0200 Subject: [PATCH] Warnings: function type cast for g_list_foreach I added a cast for the functions used in g_list_foreach. Without the cast, the warning warning: cast between incompatible function types is reported. --- src/ui/gui/dialog-common.c | 4 ++-- src/ui/gui/psppire-acr.c | 6 +++--- src/ui/gui/psppire-dialog-action-autorecode.c | 4 ++-- src/ui/gui/psppire-dialog-action-recode-different.c | 4 ++-- src/ui/gui/psppire-selector.c | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/ui/gui/dialog-common.c b/src/ui/gui/dialog-common.c index f167034b12..1b29c4a3be 100644 --- a/src/ui/gui/dialog-common.c +++ b/src/ui/gui/dialog-common.c @@ -112,7 +112,7 @@ homogeneous_types (GtkWidget *source, GtkWidget *dest) have_type = true; } - g_list_foreach (list, (GFunc) gtk_tree_path_free, NULL); + g_list_foreach (list, (GFunc) (void (*)(void)) gtk_tree_path_free, NULL); g_list_free (list); if (retval == FALSE) @@ -179,7 +179,7 @@ numeric_only (GtkWidget *source, GtkWidget *dest) } } - g_list_foreach (list, (GFunc) gtk_tree_path_free, NULL); + g_list_foreach (list, (GFunc) (void (*)(void)) gtk_tree_path_free, NULL); g_list_free (list); return retval; diff --git a/src/ui/gui/psppire-acr.c b/src/ui/gui/psppire-acr.c index a876413fd5..82f9aa2c16 100644 --- a/src/ui/gui/psppire-acr.c +++ b/src/ui/gui/psppire-acr.c @@ -183,7 +183,7 @@ on_change_button_clicked (PsppireAcr *acr) g_value_unset (&value); } - g_list_foreach (l, (GFunc) gtk_tree_path_free, NULL); + g_list_foreach (l, (GFunc) (void (*)(void)) gtk_tree_path_free, NULL); g_list_free (l); if (acr->update) acr->update (acr->update_data); @@ -209,7 +209,7 @@ on_remove_button_clicked (PsppireAcr *acr) gtk_list_store_remove (acr->list_store, &iter); - g_list_foreach (l, (GFunc) gtk_tree_path_free, NULL); + g_list_foreach (l, (GFunc) (void (*)(void)) gtk_tree_path_free, NULL); g_list_free (l); } @@ -225,7 +225,7 @@ row_is_selected (const PsppireAcr *acr) result = (l != NULL); - g_list_foreach (l, (GFunc) gtk_tree_path_free, NULL); + g_list_foreach (l, (GFunc) (void (*)(void)) gtk_tree_path_free, NULL); g_list_free (l); return result; diff --git a/src/ui/gui/psppire-dialog-action-autorecode.c b/src/ui/gui/psppire-dialog-action-autorecode.c index ed82bce8e2..a2ec973984 100644 --- a/src/ui/gui/psppire-dialog-action-autorecode.c +++ b/src/ui/gui/psppire-dialog-action-autorecode.c @@ -192,7 +192,7 @@ on_change_clicked (GObject *obj, gpointer data) gtk_tree_model_row_changed (model, rows->data, &iter); finish: - g_list_foreach (rows, (GFunc) gtk_tree_path_free, NULL); + g_list_foreach (rows, (GFunc) (void (*)(void)) gtk_tree_path_free, NULL); g_list_free (rows); var_unref (var); } @@ -275,7 +275,7 @@ on_selection_change (GtkTreeSelection *selection, gpointer data) gtk_widget_set_sensitive (rd->change_button, FALSE); } - g_list_foreach (rows, (GFunc) gtk_tree_path_free, NULL); + g_list_foreach (rows, (GFunc) (void (*)(void)) gtk_tree_path_free, NULL); g_list_free (rows); } diff --git a/src/ui/gui/psppire-dialog-action-recode-different.c b/src/ui/gui/psppire-dialog-action-recode-different.c index 52fe9af7c3..594f8bc9a2 100644 --- a/src/ui/gui/psppire-dialog-action-recode-different.c +++ b/src/ui/gui/psppire-dialog-action-recode-different.c @@ -208,7 +208,7 @@ on_change_clicked (GObject *obj, gpointer data) gtk_tree_model_row_changed (model, rows->data, &iter); finish: - g_list_foreach (rows, (GFunc) gtk_tree_path_free, NULL); + g_list_foreach (rows, (GFunc) (void (*)(void)) gtk_tree_path_free, NULL); g_list_free (rows); } @@ -272,7 +272,7 @@ on_selection_change (GtkTreeSelection *selection, gpointer data) } - g_list_foreach (rows, (GFunc) gtk_tree_path_free, NULL); + g_list_foreach (rows, (GFunc) (void (*)(void)) gtk_tree_path_free, NULL); g_list_free (rows); } diff --git a/src/ui/gui/psppire-selector.c b/src/ui/gui/psppire-selector.c index cada9ef683..165d1faadc 100644 --- a/src/ui/gui/psppire-selector.c +++ b/src/ui/gui/psppire-selector.c @@ -574,7 +574,7 @@ de_select_tree_model (GtkTreeSelection *selection, GtkTreeModel *model) } /* Delete list of RowRefs and its contents */ - g_list_foreach (selected_rows, (GFunc) gtk_tree_row_reference_free, NULL); + g_list_foreach (selected_rows, (GFunc) (void (*)(void)) gtk_tree_row_reference_free, NULL); g_list_free (selected_rows); } @@ -661,7 +661,7 @@ select_selection (PsppireSelector *selector) ); } - g_list_foreach (selected_rows, (GFunc) gtk_tree_path_free, NULL); + g_list_foreach (selected_rows, (GFunc) (void (*)(void)) gtk_tree_path_free, NULL); g_list_free (selected_rows); refilter (selector); -- 2.30.2