Warnings: function type cast for g_list_foreach
authorFriedrich Beckmann <friedrich.beckmann@gmx.de>
Mon, 24 Aug 2020 09:19:33 +0000 (11:19 +0200)
committerFriedrich Beckmann <friedrich.beckmann@gmx.de>
Mon, 24 Aug 2020 18:24:29 +0000 (20:24 +0200)
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
src/ui/gui/psppire-acr.c
src/ui/gui/psppire-dialog-action-autorecode.c
src/ui/gui/psppire-dialog-action-recode-different.c
src/ui/gui/psppire-selector.c

index f167034b12a760f2a27f84fa202dbf195badf77c..1b29c4a3bedbc7a02ffa4754ada9121e82af85c4 100644 (file)
@@ -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;
index a876413fd582e5b7dd137b742c4314e811c3b7be..82f9aa2c16231969454ec16583e0d8671d69830a 100644 (file)
@@ -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;
index ed82bce8e293e966e3f468fbbe069f7a61f29a04..a2ec9739840b4b2b9679073e5fc891118813e860 100644 (file)
@@ -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);
 }
 
index 52fe9af7c3847378db73cba1b436f2b78b1def9f..594f8bc9a28bec923764cb89e8c00534859e78eb 100644 (file)
@@ -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);
 }
 
index cada9ef683305e4f2bf69b778869bef8a38edb2c..165d1faadcbd231d0c31ffae9ed5704291d5a08d 100644 (file)
@@ -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);