[gtk/wip/baedert/for-master: 45/56] widget: Use an unchecked cast in _get_native()
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/baedert/for-master: 45/56] widget: Use an unchecked cast in _get_native()
- Date: Tue, 5 May 2020 06:24:36 +0000 (UTC)
commit 75e202f02b8ad2ed546b12984197649373f62c28
Author: Timm Bäder <mail baedert org>
Date: Wed Apr 29 08:07:45 2020 +0200
widget: Use an unchecked cast in _get_native()
This is either no chagne because we know for a fact that the returned
value is a GtkNative - after all thats's the type we pass to
gtk_widget_get_ancestor().
Or it is a bug fix since casting NULL to a GtkNative using GTK_NATIVE()
is not going to work, but the API contract of gtk_widget_get_native()
explicitly allows a NULL return value.
gtk/gtkwidget.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 463d1319e7..c5dca9447d 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -6053,7 +6053,7 @@ gtk_widget_get_native (GtkWidget *widget)
{
g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
- return GTK_NATIVE (gtk_widget_get_ancestor (widget, GTK_TYPE_NATIVE));
+ return (GtkNative *)gtk_widget_get_ancestor (widget, GTK_TYPE_NATIVE);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]