[libmanette] device: Avoid using gpointer for user_data but use directly the good type



commit 8013382f148b888abc3faced6163225ef94d5e3d
Author: vanadiae <vanadiae35 gmail com>
Date:   Sat Oct 10 20:17:48 2020 +0200

    device: Avoid using gpointer for user_data but use directly the good type

 src/manette-device.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)
---
diff --git a/src/manette-device.c b/src/manette-device.c
index 2e2a7f9..e5e18d2 100644
--- a/src/manette-device.c
+++ b/src/manette-device.c
@@ -483,15 +483,12 @@ on_evdev_event (ManetteDevice      *self,
 }
 
 static gboolean
-poll_events (GIOChannel   *source,
-             GIOCondition  condition,
-             gpointer      data)
+poll_events (GIOChannel    *source,
+             GIOCondition   condition,
+             ManetteDevice *self)
 {
-  ManetteDevice *self;
   struct input_event evdev_event;
 
-  self = MANETTE_DEVICE (data);
-
   g_return_val_if_fail (MANETTE_IS_DEVICE (self), FALSE);
 
   while (libevdev_has_event_pending (self->evdev_device))
@@ -567,7 +564,7 @@ manette_device_new (const gchar  *filename,
 
   // Poll the events in the main loop.
   channel = g_io_channel_unix_new (self->fd);
-  self->event_source_id = (glong) g_io_add_watch (channel, G_IO_IN, poll_events, self);
+  self->event_source_id = (glong) g_io_add_watch (channel, G_IO_IN, (GIOFunc) poll_events, self);
   buttons_number = 0;
 
   // Initialize the axes buttons and hats.


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