[retro-gtk] Avoid unnecessary casts when connecting to signal



commit 2113dfb3cc5834d528b064071106101526532ad7
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Sat Feb 22 20:55:58 2020 +0500

    Avoid unnecessary casts when connecting to signal
    
    User data is a gpointer, there's no point in casting it to anything.

 retro-gtk/retro-cairo-display.c | 4 ++--
 retro-gtk/retro-gl-display.c    | 8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/retro-gtk/retro-cairo-display.c b/retro-gtk/retro-cairo-display.c
index 75f95f1..84f197e 100644
--- a/retro-gtk/retro-cairo-display.c
+++ b/retro-gtk/retro-cairo-display.c
@@ -221,12 +221,12 @@ retro_cairo_display_init (RetroCairoDisplay *self)
   g_signal_connect_object (G_OBJECT (self),
                            "notify::sensitive",
                            (GCallback) gtk_widget_queue_draw,
-                           GTK_WIDGET (self),
+                           self,
                            G_CONNECT_SWAPPED);
   g_signal_connect_object (G_OBJECT (self),
                            "notify::pixbuf",
                            (GCallback) gtk_widget_queue_draw,
-                           GTK_WIDGET (self),
+                           self,
                            G_CONNECT_SWAPPED);
 }
 
diff --git a/retro-gtk/retro-gl-display.c b/retro-gtk/retro-gl-display.c
index 9a5cefe..969159d 100644
--- a/retro-gtk/retro-gl-display.c
+++ b/retro-gtk/retro-gl-display.c
@@ -330,19 +330,19 @@ retro_gl_display_init (RetroGLDisplay *self)
   g_signal_connect_object (G_OBJECT (self),
                            "realize",
                            (GCallback) realize,
-                           GTK_WIDGET (self),
+                           self,
                            0);
 
   g_signal_connect_object (G_OBJECT (self),
                            "unrealize",
                            (GCallback) unrealize,
-                           GTK_WIDGET (self),
+                           self,
                            0);
 
   g_signal_connect_object (G_OBJECT (self),
                            "render",
                            (GCallback) render,
-                           GTK_WIDGET (self),
+                           self,
                            0);
 
   self->filter = RETRO_VIDEO_FILTER_SMOOTH;
@@ -350,7 +350,7 @@ retro_gl_display_init (RetroGLDisplay *self)
   g_signal_connect_object (G_OBJECT (self),
                            "notify::sensitive",
                            (GCallback) gtk_widget_queue_draw,
-                           GTK_WIDGET (self),
+                           self,
                            G_CONNECT_SWAPPED);
 }
 


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