[gnome-panel/wip-warnings: 6/6] panel-addto-dialog.c: avoid cast between incompatible function types



commit 94f4669977a168b96a5c795e4a60e363fe229d75
Author: Sebastian Geiger <sbastig gmx net>
Date:   Mon Feb 24 16:06:31 2020 +0100

    panel-addto-dialog.c: avoid cast between incompatible function types
    
    GClosureNotify expects two parameters but g_free expects only one, so
    we should wrap it in a new function.
    
    Without this GCC emits the following warning:
    warning: cast between incompatible function types from ‘void (*)(void *)’ to ‘void (*)(void *, GClosure 
*)’ {aka ‘void (*)(void *, struct _GClosure *)’}

 gnome-panel/panel-addto-dialog.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
---
diff --git a/gnome-panel/panel-addto-dialog.c b/gnome-panel/panel-addto-dialog.c
index 9407f8a92..9cfcf1281 100644
--- a/gnome-panel/panel-addto-dialog.c
+++ b/gnome-panel/panel-addto-dialog.c
@@ -214,6 +214,13 @@ panel_addto_drag_begin_cb (GtkWidget      *widget,
        g_object_unref (gicon);
 }
 
+static void
+drag_text_destroyed (gpointer  data,
+                     GClosure *closure)
+{
+       g_free (data);
+}
+
 static void
 panel_addto_setup_drag (GtkTreeView          *tree_view,
                        const GtkTargetEntry *target,
@@ -229,7 +236,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,
+                              drag_text_destroyed,
                               0 /* connect_flags */);
        g_signal_connect_after (G_OBJECT (tree_view), "drag-begin",
                                G_CALLBACK (panel_addto_drag_begin_cb),


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]