[gnome-flashback] notifications: fix cast-function-type warnings



commit a2c4a4de1126858f576c6b8c8193a63c3b884c72
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Sun Sep 9 01:07:54 2018 +0300

    notifications: fix cast-function-type warnings

 gnome-flashback/libnotifications/gf-bubble.c       | 9 ++++++++-
 gnome-flashback/libnotifications/nd-notification.c | 9 ++++++++-
 gnome-flashback/libnotifications/nd-queue.c        | 9 ++++++++-
 gnome-flashback/libnotifications/nd-stack.c        | 3 +--
 4 files changed, 25 insertions(+), 5 deletions(-)
---
diff --git a/gnome-flashback/libnotifications/gf-bubble.c b/gnome-flashback/libnotifications/gf-bubble.c
index 4adac80..d224178 100644
--- a/gnome-flashback/libnotifications/gf-bubble.c
+++ b/gnome-flashback/libnotifications/gf-bubble.c
@@ -273,6 +273,13 @@ add_timeout (GfBubble *bubble)
   priv->timeout_id = g_timeout_add (timeout, timeout_bubble, bubble);
 }
 
+static void
+destroy_widget (GtkWidget *widget,
+                gpointer   user_data)
+{
+  gtk_widget_destroy (widget);
+}
+
 static void
 update_bubble (GfBubble *bubble)
 {
@@ -326,7 +333,7 @@ update_bubble (GfBubble *bubble)
 
   have_actions = FALSE;
   gtk_container_foreach (GTK_CONTAINER (priv->actions_box),
-                         (GtkCallback) gtk_widget_destroy, NULL);
+                         destroy_widget, NULL);
 
   actions = nd_notification_get_actions (priv->notification);
 
diff --git a/gnome-flashback/libnotifications/nd-notification.c 
b/gnome-flashback/libnotifications/nd-notification.c
index 1f960f4..9542aa1 100644
--- a/gnome-flashback/libnotifications/nd-notification.c
+++ b/gnome-flashback/libnotifications/nd-notification.c
@@ -511,6 +511,13 @@ scale_pixbuf (GdkPixbuf *pixbuf,
         }
 }
 
+static void
+free_pixels (guchar   *pixels,
+             gpointer  user_data)
+{
+  g_free (pixels);
+}
+
 static GdkPixbuf *
 _notify_daemon_pixbuf_from_data_hint (GVariant *icon_data,
                                       int       size)
@@ -557,7 +564,7 @@ _notify_daemon_pixbuf_from_data_hint (GVariant *icon_data,
                                            width,
                                            height,
                                            rowstride,
-                                           (GdkPixbufDestroyNotify) g_free,
+                                           free_pixels,
                                            NULL);
         if (pixbuf != NULL && size > 0) {
                 GdkPixbuf *scaled;
diff --git a/gnome-flashback/libnotifications/nd-queue.c b/gnome-flashback/libnotifications/nd-queue.c
index 20efadd..9531ada 100644
--- a/gnome-flashback/libnotifications/nd-queue.c
+++ b/gnome-flashback/libnotifications/nd-queue.c
@@ -713,6 +713,13 @@ update_dock (NdQueue *queue)
         g_list_free (list);
 }
 
+static void
+show_all_cb (GtkWidget *widget,
+             gpointer   user_data)
+{
+  gtk_widget_show_all (widget);
+}
+
 static gboolean
 popup_dock (NdQueue *queue,
             guint    time)
@@ -753,7 +760,7 @@ popup_dock (NdQueue *queue,
         gdk_screen_get_monitor_geometry (screen, monitor_num, &monitor);
 
         gtk_container_foreach (GTK_CONTAINER (queue->priv->dock),
-                               (GtkCallback) gtk_widget_show_all, NULL);
+                               show_all_cb, NULL);
         gtk_widget_get_preferred_size (queue->priv->dock, &dock_req, NULL);
 
         if (orientation == GTK_ORIENTATION_VERTICAL) {
diff --git a/gnome-flashback/libnotifications/nd-stack.c b/gnome-flashback/libnotifications/nd-stack.c
index fa45fd5..bc707a0 100644
--- a/gnome-flashback/libnotifications/nd-stack.c
+++ b/gnome-flashback/libnotifications/nd-stack.c
@@ -471,6 +471,5 @@ nd_stack_remove_all (NdStack  *stack)
         GList *bubbles;
 
         bubbles = g_list_copy (stack->priv->bubbles);
-        g_list_foreach (bubbles, (GFunc)gtk_widget_destroy, NULL);
-        g_list_free (bubbles);
+        g_list_free_full (bubbles, (GDestroyNotify) gtk_widget_destroy);
 }


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