summaryrefslogtreecommitdiff
path: root/libmate-desktop/mate-desktop-item.c
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/mate-desktop-item.c
parentb222081467e85e45dd9451060c369f4fa582c870 (diff)
downloadmate-desktop-952faddbde2bff65fefd57dbffd2242977fa1841.tar.bz2
mate-desktop-952faddbde2bff65fefd57dbffd2242977fa1841.tar.xz
Remove warnings: cast between incompatible function types
Diffstat (limited to 'libmate-desktop/mate-desktop-item.c')
-rw-r--r--libmate-desktop/mate-desktop-item.c22
1 files changed, 7 insertions, 15 deletions
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 &&