summaryrefslogtreecommitdiff
path: root/libmate-desktop
diff options
context:
space:
mode:
authorrbuj <[email protected]>2020-02-27 15:44:11 +0100
committerraveit65 <[email protected]>2020-03-03 12:23:24 +0100
commit952faddbde2bff65fefd57dbffd2242977fa1841 (patch)
treeda45bd082d1de45ad42c07ff092dc98ef15ee92b /libmate-desktop
parentb222081467e85e45dd9451060c369f4fa582c870 (diff)
downloadmate-desktop-952faddbde2bff65fefd57dbffd2242977fa1841.tar.bz2
mate-desktop-952faddbde2bff65fefd57dbffd2242977fa1841.tar.xz
Remove warnings: cast between incompatible function types
Diffstat (limited to 'libmate-desktop')
-rw-r--r--libmate-desktop/mate-bg.c5
-rw-r--r--libmate-desktop/mate-desktop-item.c22
2 files changed, 8 insertions, 19 deletions
diff --git a/libmate-desktop/mate-bg.c b/libmate-desktop/mate-bg.c
index d8a20c8..803fa02 100644
--- a/libmate-desktop/mate-bg.c
+++ b/libmate-desktop/mate-bg.c
@@ -2972,10 +2972,7 @@ slideshow_unref (SlideShow *show)
}
g_queue_free (show->slides);
-
- g_list_foreach (show->stack->head, (GFunc) g_free, NULL);
- g_queue_free (show->stack);
-
+ g_queue_free_full (show->stack, g_free);
g_free (show);
}
diff --git a/libmate-desktop/mate-desktop-item.c b/libmate-desktop/mate-desktop-item.c
index 616020b..7e02347 100644
--- a/libmate-desktop/mate-desktop-item.c
+++ b/libmate-desktop/mate-desktop-item.c
@@ -866,15 +866,14 @@ mate_desktop_item_ref (MateDesktopItem *item)
}
static void
-free_section (gpointer data, gpointer user_data)
+free_section (gpointer data)
{
Section *section = data;
g_free (section->name);
section->name = NULL;
- g_list_foreach (section->keys, (GFunc)g_free, NULL);
- g_list_free (section->keys);
+ g_list_free_full (section->keys, g_free);
section->keys = NULL;
g_free (section);
@@ -897,16 +896,13 @@ mate_desktop_item_unref (MateDesktopItem *item)
if(item->refcount != 0)
return;
- g_list_foreach (item->languages, (GFunc)g_free, NULL);
- g_list_free (item->languages);
+ g_list_free_full (item->languages, g_free);
item->languages = NULL;
- g_list_foreach (item->keys, (GFunc)g_free, NULL);
- g_list_free (item->keys);
+ g_list_free_full (item->keys, g_free);
item->keys = NULL;
- g_list_foreach (item->sections, free_section, NULL);
- g_list_free (item->sections);
+ g_list_free_full (item->sections, (GDestroyNotify) free_section);
item->sections = NULL;
g_hash_table_destroy (item->main_hash);
@@ -1560,10 +1556,7 @@ free_startup_timeout (void *data)
{
StartupTimeoutData *std = data;
- g_slist_foreach (std->contexts,
- (GFunc) sn_launcher_context_unref,
- NULL);
- g_slist_free (std->contexts);
+ g_slist_free_full (std->contexts, (GDestroyNotify) sn_launcher_context_unref);
if (std->timeout_id != 0) {
g_source_remove (std->timeout_id);
@@ -1947,8 +1940,7 @@ ditem_execute (const MateDesktopItem *item,
g_strfreev (temp_argv);
real_argv = list_to_vector (vector_list);
- g_slist_foreach (vector_list, (GFunc)g_free, NULL);
- g_slist_free (vector_list);
+ g_slist_free_full (vector_list, g_free);
#ifdef HAVE_STARTUP_NOTIFICATION
if (sn_context != NULL &&