summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrbuj <[email protected]>2020-04-07 14:12:38 +0200
committerraveit65 <[email protected]>2020-05-25 09:37:56 +0200
commit2570b9ab7f8e26c0035bd6fb5401cba99d682ac4 (patch)
tree208e932cdde1b8e50ac6cffe9e72db7ac6940105
parent146cc418fad7c39a21a1ce55f92a895bb0be3332 (diff)
downloadmate-panel-2570b9ab7f8e26c0035bd6fb5401cba99d682ac4.tar.bz2
mate-panel-2570b9ab7f8e26c0035bd6fb5401cba99d682ac4.tar.xz
Fix some cast-function-type warnings introduced in GCC 8
-rw-r--r--applets/notification_area/system-tray/na-tray-child.c7
-rw-r--r--applets/notification_area/system-tray/na-tray-child.h4
-rw-r--r--applets/notification_area/system-tray/na-tray.c2
-rw-r--r--applets/wncklet/window-list.c2
-rw-r--r--mate-panel/libegg/eggdesktopfile.c2
-rw-r--r--mate-panel/libmate-panel-applet-private/panel-applets-manager-dbus.c11
-rw-r--r--mate-panel/menu.c4
-rw-r--r--mate-panel/panel-addto.c2
-rw-r--r--mate-panel/panel-applet-info.c4
-rw-r--r--mate-panel/panel-applet-info.h2
-rw-r--r--mate-panel/panel-applets-manager.c3
-rw-r--r--mate-panel/panel-menu-button.c6
-rw-r--r--mate-panel/panel-menu-items.c11
-rw-r--r--mate-panel/panel-util.c2
14 files changed, 34 insertions, 28 deletions
diff --git a/applets/notification_area/system-tray/na-tray-child.c b/applets/notification_area/system-tray/na-tray-child.c
index cc45abc3..cd7c305a 100644
--- a/applets/notification_area/system-tray/na-tray-child.c
+++ b/applets/notification_area/system-tray/na-tray-child.c
@@ -557,8 +557,13 @@ na_tray_child_set_composited (NaTrayChild *child,
* the child is shifted with respect to the background.
*/
void
-na_tray_child_force_redraw (NaTrayChild *child)
+na_tray_child_force_redraw (gpointer key,
+ gpointer value,
+ gpointer user_data)
{
+ (void) value;
+ (void) user_data;
+ NaTrayChild *child = key;
GtkWidget *widget = GTK_WIDGET (child);
if (gtk_widget_get_mapped (widget))
diff --git a/applets/notification_area/system-tray/na-tray-child.h b/applets/notification_area/system-tray/na-tray-child.h
index aa39658a..5865adab 100644
--- a/applets/notification_area/system-tray/na-tray-child.h
+++ b/applets/notification_area/system-tray/na-tray-child.h
@@ -73,7 +73,9 @@ char *na_tray_child_get_title (NaTrayChild *child);
gboolean na_tray_child_has_alpha (NaTrayChild *child);
void na_tray_child_set_composited (NaTrayChild *child,
gboolean composited);
-void na_tray_child_force_redraw (NaTrayChild *child);
+void na_tray_child_force_redraw (gpointer key,
+ gpointer value,
+ gpointer user_data);
void na_tray_child_get_wm_class (NaTrayChild *child,
char **res_name,
char **res_class);
diff --git a/applets/notification_area/system-tray/na-tray.c b/applets/notification_area/system-tray/na-tray.c
index 8cf1b9ec..fee75dc8 100644
--- a/applets/notification_area/system-tray/na-tray.c
+++ b/applets/notification_area/system-tray/na-tray.c
@@ -715,7 +715,7 @@ idle_redraw_cb (NaTray *tray)
NaTrayPrivate *priv = tray->priv;
g_hash_table_foreach (priv->trays_screen->icon_table,
- (GHFunc) na_tray_child_force_redraw, NULL);
+ na_tray_child_force_redraw, NULL);
priv->idle_redraw_id = 0;
diff --git a/applets/wncklet/window-list.c b/applets/wncklet/window-list.c
index 5ce9e48b..85670666 100644
--- a/applets/wncklet/window-list.c
+++ b/applets/wncklet/window-list.c
@@ -308,7 +308,7 @@ static gboolean applet_enter_notify_event (WnckTasklist *tl, GList *wnck_windows
gtk_widget_show (tasklist->preview);
- g_signal_connect_data (G_OBJECT (tasklist->preview), "draw", G_CALLBACK (preview_window_draw), thumbnail, (GClosureNotify) g_object_unref, 0);
+ g_signal_connect_data (G_OBJECT (tasklist->preview), "draw", G_CALLBACK (preview_window_draw), thumbnail, (GClosureNotify) G_CALLBACK (g_object_unref), 0);
return FALSE;
}
diff --git a/mate-panel/libegg/eggdesktopfile.c b/mate-panel/libegg/eggdesktopfile.c
index 5e069770..633cd73e 100644
--- a/mate-panel/libegg/eggdesktopfile.c
+++ b/mate-panel/libegg/eggdesktopfile.c
@@ -1291,7 +1291,7 @@ egg_desktop_file_launchv (EggDesktopFile *desktop_file,
out:
if (env)
{
- g_ptr_array_foreach (env, (GFunc)g_free, NULL);
+ g_ptr_array_set_free_func (env, g_free);
g_ptr_array_free (env, TRUE);
}
free_document_list (translated_documents);
diff --git a/mate-panel/libmate-panel-applet-private/panel-applets-manager-dbus.c b/mate-panel/libmate-panel-applet-private/panel-applets-manager-dbus.c
index 00c8a6f3..82c1e918 100644
--- a/mate-panel/libmate-panel-applet-private/panel-applets-manager-dbus.c
+++ b/mate-panel/libmate-panel-applet-private/panel-applets-manager-dbus.c
@@ -83,10 +83,7 @@ mate_panel_applet_factory_info_free (MatePanelAppletFactoryInfo *info)
g_free (info->id);
g_free (info->location);
- g_list_foreach (info->applet_list,
- (GFunc) mate_panel_applet_info_free,
- NULL);
- g_list_free (info->applet_list);
+ g_list_free_full (info->applet_list, mate_panel_applet_info_free);
info->applet_list = NULL;
g_free (info->srcdir);
@@ -325,8 +322,7 @@ applets_directory_changed (GFileMonitor *monitor,
}
}
- g_slist_foreach (dirs, (GFunc) g_free, NULL);
- g_slist_free (dirs);
+ g_slist_free_full (dirs, g_free);
}
break;
default:
@@ -651,8 +647,7 @@ mate_panel_applets_manager_dbus_finalize (GObject *object)
MatePanelAppletsManagerDBus *manager = MATE_PANEL_APPLETS_MANAGER_DBUS (object);
if (manager->priv->monitors) {
- g_list_foreach (manager->priv->monitors, (GFunc) g_object_unref, NULL);
- g_list_free (manager->priv->monitors);
+ g_list_free_full (manager->priv->monitors, g_object_unref);
manager->priv->monitors = NULL;
}
diff --git a/mate-panel/menu.c b/mate-panel/menu.c
index f5d88fad..6376e964 100644
--- a/mate-panel/menu.c
+++ b/mate-panel/menu.c
@@ -815,7 +815,7 @@ setup_uri_drag (GtkWidget *menuitem,
g_signal_connect_data (G_OBJECT (menuitem), "drag_data_get",
G_CALLBACK (drag_data_get_string_cb),
g_strdup (uri),
- (GClosureNotify)g_free,
+ (GClosureNotify) G_CALLBACK (g_free),
0 /* connect_flags */);
g_signal_connect (G_OBJECT (menuitem), "drag_end",
G_CALLBACK (drag_end_menu_cb), NULL);
@@ -846,7 +846,7 @@ setup_internal_applet_drag (GtkWidget *menuitem,
g_signal_connect_data (G_OBJECT (menuitem), "drag_data_get",
G_CALLBACK (drag_data_get_string_cb),
g_strdup (panel_action_get_drag_id (type)),
- (GClosureNotify)g_free,
+ (GClosureNotify) G_CALLBACK (g_free),
0 /* connect_flags */);
g_signal_connect (G_OBJECT (menuitem), "drag_end",
G_CALLBACK (drag_end_menu_cb), NULL);
diff --git a/mate-panel/panel-addto.c b/mate-panel/panel-addto.c
index cfc9c715..8a30c1b1 100644
--- a/mate-panel/panel-addto.c
+++ b/mate-panel/panel-addto.c
@@ -341,7 +341,7 @@ panel_addto_setup_drag (GtkTreeView *tree_view,
g_signal_connect_data (G_OBJECT (tree_view), "drag_data_get",
G_CALLBACK (panel_addto_drag_data_get_cb),
g_strdup (text),
- (GClosureNotify) g_free,
+ (GClosureNotify) G_CALLBACK (g_free),
0 /* connect_flags */);
g_signal_connect_after (G_OBJECT (tree_view), "drag-begin",
G_CALLBACK (panel_addto_drag_begin_cb),
diff --git a/mate-panel/panel-applet-info.c b/mate-panel/panel-applet-info.c
index 55d91dfd..3ba05a67 100644
--- a/mate-panel/panel-applet-info.c
+++ b/mate-panel/panel-applet-info.c
@@ -76,8 +76,10 @@ mate_panel_applet_info_new (const gchar *iid,
}
void
-mate_panel_applet_info_free (MatePanelAppletInfo *info)
+mate_panel_applet_info_free (gpointer data)
{
+ MatePanelAppletInfo *info = data;
+
if (!info)
return;
diff --git a/mate-panel/panel-applet-info.h b/mate-panel/panel-applet-info.h
index 1588b012..fc999ffc 100644
--- a/mate-panel/panel-applet-info.h
+++ b/mate-panel/panel-applet-info.h
@@ -39,7 +39,7 @@ MatePanelAppletInfo *mate_panel_applet_info_new (const gchar *iid,
gboolean x11_supported,
gboolean wayland_supported);
-void mate_panel_applet_info_free (MatePanelAppletInfo *info);
+void mate_panel_applet_info_free (gpointer data);
const gchar *mate_panel_applet_info_get_iid (MatePanelAppletInfo *info);
const gchar *mate_panel_applet_info_get_name (MatePanelAppletInfo *info);
diff --git a/mate-panel/panel-applets-manager.c b/mate-panel/panel-applets-manager.c
index 23b43f0c..6d93d04b 100644
--- a/mate-panel/panel-applets-manager.c
+++ b/mate-panel/panel-applets-manager.c
@@ -49,8 +49,7 @@ static GSList *mate_panel_applets_managers = NULL;
static void
_mate_panel_applets_manager_cleanup (gpointer data)
{
- g_slist_foreach (mate_panel_applets_managers, (GFunc) g_object_unref, NULL);
- g_slist_free (mate_panel_applets_managers);
+ g_slist_free_full (mate_panel_applets_managers, g_object_unref);
mate_panel_applets_managers = NULL;
}
diff --git a/mate-panel/panel-menu-button.c b/mate-panel/panel-menu-button.c
index 03e2a343..c89f6ef0 100644
--- a/mate-panel/panel-menu-button.c
+++ b/mate-panel/panel-menu-button.c
@@ -376,8 +376,12 @@ panel_menu_button_menu_deactivated (PanelMenuButton *button)
}
static void
-panel_menu_button_menu_detacher (PanelMenuButton *button)
+panel_menu_button_menu_detacher (GtkWidget *attach_widget,
+ GtkMenu *menu)
{
+ (void) menu;
+ PanelMenuButton *button = PANEL_MENU_BUTTON (attach_widget);
+
/*
* just in case someone still owns a reference to the
* menu (the menu may be up or some such other nonsense)
diff --git a/mate-panel/panel-menu-items.c b/mate-panel/panel-menu-items.c
index 046d3ee3..e433d2ed 100644
--- a/mate-panel/panel-menu-items.c
+++ b/mate-panel/panel-menu-items.c
@@ -249,7 +249,7 @@ panel_menu_items_append_from_desktop (GtkWidget *menu,
g_signal_connect_data (item, "activate",
G_CALLBACK (panel_menu_item_activate_desktop_file),
g_strdup (full_path),
- (GClosureNotify) g_free, 0);
+ (GClosureNotify) G_CALLBACK (g_free), 0);
g_signal_connect (G_OBJECT (item), "button_press_event",
G_CALLBACK (menu_dummy_button_press_event), NULL);
@@ -297,7 +297,7 @@ panel_menu_items_append_place_item (const char *icon_name,
user_data = g_strdup (uri);
g_signal_connect_data (item, "activate", callback, user_data,
- (GClosureNotify) g_free, 0);
+ (GClosureNotify) G_CALLBACK (g_free), 0);
g_signal_connect (G_OBJECT (item), "button_press_event",
G_CALLBACK (menu_dummy_button_press_event), NULL);
@@ -451,8 +451,7 @@ panel_place_menu_item_append_gtk_bookmarks (GtkWidget *menu, guint max_items_or_
}
g_hash_table_destroy (table);
- g_slist_foreach (lines, (GFunc) g_free, NULL);
- g_slist_free (lines);
+ g_slist_free_full (lines, g_free);
add_bookmarks = g_slist_reverse (add_bookmarks);
@@ -612,7 +611,7 @@ panel_menu_item_append_drive (GtkWidget *menu,
g_signal_connect_data (item, "activate",
G_CALLBACK (panel_menu_item_rescan_drive),
g_object_ref (drive),
- (GClosureNotify) g_object_unref, 0);
+ (GClosureNotify) G_CALLBACK (g_object_unref), 0);
g_signal_connect (G_OBJECT (item), "button_press_event",
G_CALLBACK (menu_dummy_button_press_event), NULL);
@@ -712,7 +711,7 @@ panel_menu_item_append_volume (GtkWidget *menu,
g_signal_connect_data (item, "activate",
G_CALLBACK (panel_menu_item_mount_volume),
g_object_ref (volume),
- (GClosureNotify) g_object_unref, 0);
+ (GClosureNotify) G_CALLBACK (g_object_unref), 0);
g_signal_connect (G_OBJECT (item), "button_press_event",
G_CALLBACK (menu_dummy_button_press_event), NULL);
diff --git a/mate-panel/panel-util.c b/mate-panel/panel-util.c
index 7389b321..7c2a22fa 100644
--- a/mate-panel/panel-util.c
+++ b/mate-panel/panel-util.c
@@ -1212,7 +1212,7 @@ panel_util_set_tooltip_text (GtkWidget *widget,
g_object_set (widget, "has-tooltip", TRUE, NULL);
g_signal_connect_data (widget, "query-tooltip",
G_CALLBACK (panel_util_query_tooltip_cb),
- g_strdup (text), (GClosureNotify) g_free, 0);
+ g_strdup (text), (GClosureNotify) G_CALLBACK (g_free), 0);
}
/* This is similar to what g_file_new_for_commandline_arg() does, but