[gtk+] Fix a few overlooked casts



commit 484e4537807063e2c225f11f2f55f0d04917d356
Author: Timm Bäder <mail baedert org>
Date:   Sat Dec 9 13:14:00 2017 +0100

    Fix a few overlooked casts
    
    glib warns about these now.

 tests/testgmenu.c      |    4 ++--
 testsuite/gtk/notify.c |    6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/tests/testgmenu.c b/tests/testgmenu.c
index e5366aa..8940af5 100644
--- a/tests/testgmenu.c
+++ b/tests/testgmenu.c
@@ -103,9 +103,9 @@ get_model (void)
   gtk_builder_add_from_string (builder, menu_markup, -1, &error);
   g_assert_no_error (error);
 
-  menu = g_object_ref (gtk_builder_get_object (builder, "edit-menu"));
+  menu = G_MENU_MODEL (g_object_ref (gtk_builder_get_object (builder, "edit-menu")));
 
-  section = g_object_ref (gtk_builder_get_object (builder, "size-placeholder"));
+  section = G_MENU_MODEL (g_object_ref (gtk_builder_get_object (builder, "size-placeholder")));
   g_object_unref (builder);
 
   for (i = 0.5; i <= 2.0; i += 0.5)
diff --git a/testsuite/gtk/notify.c b/testsuite/gtk/notify.c
index a73b290..f6f3ab7 100644
--- a/testsuite/gtk/notify.c
+++ b/testsuite/gtk/notify.c
@@ -399,11 +399,11 @@ test_type (gconstpointer data)
   klass = g_type_class_ref (type);
 
   if (g_type_is_a (type, GTK_TYPE_SETTINGS))
-    instance = g_object_ref (gtk_settings_get_default ());
+    instance = G_OBJECT (g_object_ref (gtk_settings_get_default ()));
   else if (g_type_is_a (type, GDK_TYPE_WINDOW))
     {
-      instance = g_object_ref (gdk_window_new_popup (gdk_display_get_default (),
-                                                     &(GdkRectangle) { 0, 0, 100, 100 }));
+      instance = G_OBJECT (g_object_ref (gdk_window_new_popup (gdk_display_get_default (),
+                                                               &(GdkRectangle) { 0, 0, 100, 100 })));
     }
   else if (g_str_equal (g_type_name (type), "GdkX11Cursor"))
     instance = g_object_new (type, "display", display, NULL);


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