summaryrefslogtreecommitdiff
path: root/pluma
diff options
context:
space:
mode:
authorrbuj <[email protected]>2020-02-28 09:07:37 +0100
committerraveit65 <[email protected]>2020-03-14 13:14:35 +0100
commit28a6895df5fa4a1a60c794ed5e85e31d764e85e7 (patch)
treef9b5d3eae40ecb5bd8eb357c10ce8458b2faa7f9 /pluma
parentd265d00b72fc9a7fb126079780303df9ea217a29 (diff)
downloadpluma-28a6895df5fa4a1a60c794ed5e85e31d764e85e7.tar.bz2
pluma-28a6895df5fa4a1a60c794ed5e85e31d764e85e7.tar.xz
Remove warnings: cast between incompatible function types
Diffstat (limited to 'pluma')
-rw-r--r--pluma/pluma-commands-file.c6
-rw-r--r--pluma/pluma-history-entry.c6
-rw-r--r--pluma/pluma-message-bus.c14
-rw-r--r--pluma/pluma-prefs-manager.c6
-rw-r--r--pluma/pluma-utils.c3
-rw-r--r--pluma/pluma-window.c3
-rw-r--r--pluma/pluma.c3
7 files changed, 12 insertions, 29 deletions
diff --git a/pluma/pluma-commands-file.c b/pluma/pluma-commands-file.c
index 689398a6..2d7e9f31 100644
--- a/pluma/pluma-commands-file.c
+++ b/pluma/pluma-commands-file.c
@@ -296,8 +296,7 @@ load_uri_list (PlumaWindow *window,
ret = load_file_list (window, files, encoding, line_pos, create);
- g_slist_foreach (files, (GFunc) g_object_unref, NULL);
- g_slist_free (files);
+ g_slist_free_full (files, g_object_unref);
return ret;
}
@@ -433,8 +432,7 @@ open_dialog_response_cb (PlumaFileChooserDialog *dialog,
encoding,
0);
- g_slist_foreach (files, (GFunc) g_object_unref, NULL);
- g_slist_free (files);
+ g_slist_free_full (files, g_object_unref);
}
void
diff --git a/pluma/pluma-history-entry.c b/pluma/pluma-history-entry.c
index 13c853e4..3dacc123 100644
--- a/pluma/pluma-history-entry.c
+++ b/pluma/pluma-history-entry.c
@@ -226,8 +226,7 @@ pluma_history_entry_save_history (PlumaHistoryEntry *entry)
entry->priv->history_id,
settings_items);
- g_slist_foreach (settings_items, (GFunc) g_free, NULL);
- g_slist_free (settings_items);
+ g_slist_free_full (settings_items, g_free);
}
static gboolean
@@ -373,8 +372,7 @@ pluma_history_entry_load_history (PlumaHistoryEntry *entry)
-1);
}
- g_slist_foreach (settings_items, (GFunc) g_free, NULL);
- g_slist_free (settings_items);
+ g_slist_free_full (settings_items, g_free);
}
void
diff --git a/pluma/pluma-message-bus.c b/pluma/pluma-message-bus.c
index 621a1d03..fc10a9d5 100644
--- a/pluma/pluma-message-bus.c
+++ b/pluma/pluma-message-bus.c
@@ -158,20 +158,12 @@ message_free (Message *message)
g_free (message->method);
g_free (message->object_path);
- g_list_foreach (message->listeners, (GFunc)listener_free, NULL);
- g_list_free (message->listeners);
+ g_list_free_full (message->listeners, (GDestroyNotify) listener_free);
g_free (message);
}
static void
-message_queue_free (GList *queue)
-{
- g_list_foreach (queue, (GFunc)g_object_unref, NULL);
- g_list_free (queue);
-}
-
-static void
pluma_message_bus_finalize (GObject *object)
{
PlumaMessageBus *bus = PLUMA_MESSAGE_BUS (object);
@@ -179,7 +171,7 @@ pluma_message_bus_finalize (GObject *object)
if (bus->priv->idle_id != 0)
g_source_remove (bus->priv->idle_id);
- message_queue_free (bus->priv->message_queue);
+ g_list_free_full (bus->priv->message_queue, g_object_unref);
g_hash_table_destroy (bus->priv->messages);
g_hash_table_destroy (bus->priv->idmap);
@@ -432,7 +424,7 @@ idle_dispatch (PlumaMessageBus *bus)
dispatch_message (bus, msg);
}
- message_queue_free (list);
+ g_list_free_full (list, g_object_unref);
return FALSE;
}
diff --git a/pluma/pluma-prefs-manager.c b/pluma/pluma-prefs-manager.c
index 2bbfbfa2..f150d13b 100644
--- a/pluma/pluma-prefs-manager.c
+++ b/pluma/pluma-prefs-manager.c
@@ -703,8 +703,7 @@ pluma_prefs_manager_get_auto_detected_encodings (void)
tmp = g_slist_next (tmp);
}
- g_slist_foreach (strings, (GFunc) g_free, NULL);
- g_slist_free (strings);
+ g_slist_free_full (strings, g_free);
res = g_slist_reverse (res);
}
@@ -753,8 +752,7 @@ pluma_prefs_manager_get_shown_in_menu_encodings (void)
tmp = g_slist_next (tmp);
}
- g_slist_foreach (strings, (GFunc) g_free, NULL);
- g_slist_free (strings);
+ g_slist_free_full (strings, g_free);
res = g_slist_reverse (res);
}
diff --git a/pluma/pluma-utils.c b/pluma/pluma-utils.c
index 905b8f53..761d0c71 100644
--- a/pluma/pluma-utils.c
+++ b/pluma/pluma-utils.c
@@ -102,8 +102,7 @@ pluma_utils_uri_has_writable_scheme (const gchar *uri)
scheme,
(GCompareFunc)strcmp) != NULL);
- g_slist_foreach (writable_schemes, (GFunc)g_free, NULL);
- g_slist_free (writable_schemes);
+ g_slist_free_full (writable_schemes, g_free);
g_free (scheme);
diff --git a/pluma/pluma-window.c b/pluma/pluma-window.c
index 6d26cf89..ac78ff71 100644
--- a/pluma/pluma-window.c
+++ b/pluma/pluma-window.c
@@ -1386,8 +1386,7 @@ update_recent_files_menu (PlumaWindow *window)
g_list_free (filtered_items);
- 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
diff --git a/pluma/pluma.c b/pluma/pluma.c
index 12ae069d..99542b65 100644
--- a/pluma/pluma.c
+++ b/pluma/pluma.c
@@ -128,8 +128,7 @@ static const GOptionEntry options [] =
static void
free_command_line_data (void)
{
- g_slist_foreach (file_list, (GFunc) g_object_unref, NULL);
- g_slist_free (file_list);
+ g_slist_free_full (file_list, g_object_unref);
file_list = NULL;
g_strfreev (remaining_args);