[gtk/3-24-warn-fixes: 5/5] sw: Do not cast clear function in g_clear_pointer()
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/3-24-warn-fixes: 5/5] sw: Do not cast clear function in g_clear_pointer()
- Date: Tue, 5 Feb 2019 14:38:09 +0000 (UTC)
commit 43980583e3092401c607814189ac4515d54b144c
Author: Emmanuele Bassi <ebassi gnome org>
Date: Tue Feb 5 15:35:27 2019 +0100
sw: Do not cast clear function in g_clear_pointer()
We don't need to do it, since g_clear_pointer() will do it for us, and
will also check if the function conforms to a GDestroyNotify. Using an
explicit cast will generate a compiler warning.
gtk/gtkscrolledwindow.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkscrolledwindow.c b/gtk/gtkscrolledwindow.c
index cc7c439938..d52ccf646c 100644
--- a/gtk/gtkscrolledwindow.c
+++ b/gtk/gtkscrolledwindow.c
@@ -2854,7 +2854,7 @@ gtk_scrolled_window_finalize (GObject *object)
g_clear_object (&priv->long_press_gesture);
g_clear_object (&priv->pan_gesture);
g_clear_object (&priv->gadget);
- g_clear_pointer (&priv->scroll_history, (GDestroyNotify) g_array_unref);
+ g_clear_pointer (&priv->scroll_history, g_array_unref);
G_OBJECT_CLASS (gtk_scrolled_window_parent_class)->finalize (object);
}
@@ -3690,7 +3690,7 @@ scrolled_window_deceleration_cb (GtkWidget *widget,
gtk_adjustment_set_value (hadjustment, position);
}
else if (data->hscrolling)
- g_clear_pointer (&data->hscrolling, (GDestroyNotify) gtk_kinetic_scrolling_free);
+ g_clear_pointer (&data->hscrolling, gtk_kinetic_scrolling_free);
if (data->vscrolling &&
gtk_kinetic_scrolling_tick (data->vscrolling, elapsed, &position))
@@ -3699,7 +3699,7 @@ scrolled_window_deceleration_cb (GtkWidget *widget,
gtk_adjustment_set_value (vadjustment, position);
}
else if (data->vscrolling)
- g_clear_pointer (&data->vscrolling, (GDestroyNotify) gtk_kinetic_scrolling_free);
+ g_clear_pointer (&data->vscrolling, gtk_kinetic_scrolling_free);
if (!data->hscrolling && !data->vscrolling)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]