summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrbuj <[email protected]>2020-02-27 20:49:54 +0100
committerraveit65 <[email protected]>2020-03-10 20:29:47 +0100
commitd34df9832f460c2bca79257aae4b5cfc77c959a1 (patch)
tree74e7a06c4b018f9045ebd97d7252fa71f87066ab /src
parent0c8d17a76050af39b22f26b33f7b47de949ef379 (diff)
downloadeom-d34df9832f460c2bca79257aae4b5cfc77c959a1.tar.bz2
eom-d34df9832f460c2bca79257aae4b5cfc77c959a1.tar.xz
Remove warnings: cast between incompatible function types
Diffstat (limited to 'src')
-rw-r--r--src/eom-image.c6
-rw-r--r--src/eom-jobs.c13
-rw-r--r--src/eom-thumb-view.c6
-rw-r--r--src/eom-uri-converter.c3
-rw-r--r--src/eom-window.c15
5 files changed, 14 insertions, 29 deletions
diff --git a/src/eom-image.c b/src/eom-image.c
index 01a869a..191acd4 100644
--- a/src/eom-image.c
+++ b/src/eom-image.c
@@ -199,8 +199,7 @@ eom_image_dispose (GObject *object)
}
if (priv->undo_stack) {
- g_slist_foreach (priv->undo_stack, (GFunc) g_object_unref, NULL);
- g_slist_free (priv->undo_stack);
+ g_slist_free_full (priv->undo_stack, g_object_unref);
priv->undo_stack = NULL;
}
@@ -1649,8 +1648,7 @@ eom_image_reset_modifications (EomImage *image)
priv = image->priv;
- g_slist_foreach (priv->undo_stack, (GFunc) g_object_unref, NULL);
- g_slist_free (priv->undo_stack);
+ g_slist_free_full (priv->undo_stack, g_object_unref);
priv->undo_stack = NULL;
if (priv->trans != NULL) {
diff --git a/src/eom-jobs.c b/src/eom-jobs.c
index 3078610..6baed21 100644
--- a/src/eom-jobs.c
+++ b/src/eom-jobs.c
@@ -443,11 +443,8 @@ eom_job_model_run (EomJob *ejob)
eom_list_store_add_files (job->store, filtered_list);
- g_list_foreach (filtered_list, (GFunc) g_object_unref, NULL);
- g_list_free (filtered_list);
-
- g_list_foreach (error_list, (GFunc) g_free, NULL);
- g_list_free (error_list);
+ g_list_free_full (filtered_list, g_object_unref);
+ g_list_free_full (error_list, g_free);
ejob->finished = TRUE;
}
@@ -466,8 +463,7 @@ eom_job_transform_dispose (GObject *object)
job->trans = NULL;
}
- g_list_foreach (job->images, (GFunc) g_object_unref, NULL);
- g_list_free (job->images);
+ g_list_free_full (job->images, g_object_unref);
(* G_OBJECT_CLASS (eom_job_transform_parent_class)->dispose) (object);
}
@@ -566,8 +562,7 @@ eom_job_save_dispose (GObject *object)
job = EOM_JOB_SAVE (object);
if (job->images) {
- g_list_foreach (job->images, (GFunc) g_object_unref, NULL);
- g_list_free (job->images);
+ g_list_free_full (job->images, g_object_unref);
job->images = NULL;
}
diff --git a/src/eom-thumb-view.c b/src/eom-thumb-view.c
index 86bf842..05b0416 100644
--- a/src/eom-thumb-view.c
+++ b/src/eom-thumb-view.c
@@ -856,8 +856,7 @@ eom_thumb_view_get_first_selected_image (EomThumbView *thumbview)
image = eom_thumb_view_get_image_from_path (thumbview, path);
- g_list_foreach (list, (GFunc) gtk_tree_path_free , NULL);
- g_list_free (list);
+ g_list_free_full (list, (GDestroyNotify) gtk_tree_path_free);
return image;
}
@@ -983,8 +982,7 @@ eom_thumb_view_select_single (EomThumbView *thumbview,
} else {
list = gtk_icon_view_get_selected_items (GTK_ICON_VIEW (thumbview));
path = gtk_tree_path_copy ((GtkTreePath *) list->data);
- g_list_foreach (list, (GFunc) gtk_tree_path_free , NULL);
- g_list_free (list);
+ g_list_free_full (list, (GDestroyNotify) gtk_tree_path_free);
gtk_icon_view_unselect_all (GTK_ICON_VIEW (thumbview));
diff --git a/src/eom-uri-converter.c b/src/eom-uri-converter.c
index 2397a28..d38b52d 100644
--- a/src/eom-uri-converter.c
+++ b/src/eom-uri-converter.c
@@ -79,8 +79,7 @@ eom_uri_converter_dispose (GObject *object)
}
if (priv->token_list) {
- g_list_foreach (priv->token_list, (GFunc) free_token, NULL);
- g_list_free (priv->token_list);
+ g_list_free_full (priv->token_list, free_token);
priv->token_list = NULL;
}
diff --git a/src/eom-window.c b/src/eom-window.c
index ccec08b..6501304 100644
--- a/src/eom-window.c
+++ b/src/eom-window.c
@@ -1599,8 +1599,7 @@ eom_window_open_recent_cb (GtkAction *action, EomWindow *window)
0,
NULL);
- g_slist_foreach (list, (GFunc) g_free, NULL);
- g_slist_free (list);
+ g_slist_free_full (list, g_free);
}
static void
@@ -1619,8 +1618,7 @@ file_open_dialog_response_cb (GtkWidget *chooser,
0,
NULL);
- g_slist_foreach (uris, (GFunc) g_free, NULL);
- g_slist_free (uris);
+ g_slist_free_full (uris, g_free);
}
gtk_widget_destroy (chooser);
@@ -3548,8 +3546,7 @@ eom_window_cmd_move_to_trash (GtkAction *action, gpointer user_data)
}
/* free list */
- g_list_foreach (images, (GFunc) g_object_unref, NULL);
- g_list_free (images);
+ g_list_free_full (images, g_object_unref);
/* select image at previously saved position */
pos = MIN (pos, eom_list_store_length (list) - 1);
@@ -4162,8 +4159,7 @@ eom_window_update_recent_files_menu (EomWindow *window)
g_free (tip);
}
- g_list_foreach (items, (GFunc) gtk_recent_info_unref, NULL);
- g_list_free (items);
+ g_list_free_full (items, (GDestroyNotify) gtk_recent_info_unref);
}
static void
@@ -4883,8 +4879,7 @@ eom_window_dispose (GObject *object)
}
if (priv->file_list != NULL) {
- g_slist_foreach (priv->file_list, (GFunc) g_object_unref, NULL);
- g_slist_free (priv->file_list);
+ g_slist_free_full (priv->file_list, g_object_unref);
priv->file_list = NULL;
}