|
|
73b847 |
From 1d5ec0b9787f5f3d48fe3a8539c35d23e51745d6 Mon Sep 17 00:00:00 2001
|
|
|
73b847 |
From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= <mail@3v1n0.net>
|
|
|
73b847 |
Date: Wed, 4 Dec 2019 13:23:26 +0100
|
|
|
73b847 |
Subject: [PATCH 078/181] fp-device: Remove unused timeout function and source
|
|
|
73b847 |
data
|
|
|
73b847 |
|
|
|
73b847 |
These were probably added in previous iterations, but they are not uneeded
|
|
|
73b847 |
anymore as the GSource embeds already a callback function.
|
|
|
73b847 |
|
|
|
73b847 |
So make just this clearer in the dispatch function.
|
|
|
73b847 |
---
|
|
|
73b847 |
libfprint/fp-device.c | 22 +++++-----------------
|
|
|
73b847 |
1 file changed, 5 insertions(+), 17 deletions(-)
|
|
|
73b847 |
|
|
|
73b847 |
diff --git a/libfprint/fp-device.c b/libfprint/fp-device.c
|
|
|
73b847 |
index 182be51..334b998 100644
|
|
|
73b847 |
--- a/libfprint/fp-device.c
|
|
|
73b847 |
+++ b/libfprint/fp-device.c
|
|
|
73b847 |
@@ -1382,22 +1382,10 @@ fp_device_list_prints_finish (FpDevice *device,
|
|
|
73b847 |
|
|
|
73b847 |
typedef struct
|
|
|
73b847 |
{
|
|
|
73b847 |
- GSource source;
|
|
|
73b847 |
- FpDevice *device;
|
|
|
73b847 |
- FpTimeoutFunc callback;
|
|
|
73b847 |
- gpointer user_data;
|
|
|
73b847 |
+ GSource source;
|
|
|
73b847 |
+ FpDevice *device;
|
|
|
73b847 |
} FpDeviceTimeoutSource;
|
|
|
73b847 |
|
|
|
73b847 |
-gboolean
|
|
|
73b847 |
-device_timeout_cb (gpointer user_data)
|
|
|
73b847 |
-{
|
|
|
73b847 |
- FpDeviceTimeoutSource *source = user_data;
|
|
|
73b847 |
-
|
|
|
73b847 |
- source->callback (source->device, source->user_data);
|
|
|
73b847 |
-
|
|
|
73b847 |
- return G_SOURCE_REMOVE;
|
|
|
73b847 |
-}
|
|
|
73b847 |
-
|
|
|
73b847 |
void
|
|
|
73b847 |
timeout_finalize (GSource *source)
|
|
|
73b847 |
{
|
|
|
73b847 |
@@ -1409,11 +1397,12 @@ timeout_finalize (GSource *source)
|
|
|
73b847 |
}
|
|
|
73b847 |
|
|
|
73b847 |
static gboolean
|
|
|
73b847 |
-timeout_dispatch (GSource *source, GSourceFunc callback, gpointer user_data)
|
|
|
73b847 |
+timeout_dispatch (GSource *source, GSourceFunc gsource_func, gpointer user_data)
|
|
|
73b847 |
{
|
|
|
73b847 |
FpDeviceTimeoutSource *timeout_source = (FpDeviceTimeoutSource *) source;
|
|
|
73b847 |
+ FpTimeoutFunc callback = (FpTimeoutFunc) gsource_func;
|
|
|
73b847 |
|
|
|
73b847 |
- ((FpTimeoutFunc) callback)(timeout_source->device, user_data);
|
|
|
73b847 |
+ callback (timeout_source->device, user_data);
|
|
|
73b847 |
|
|
|
73b847 |
return G_SOURCE_REMOVE;
|
|
|
73b847 |
}
|
|
|
73b847 |
@@ -1496,7 +1485,6 @@ fpi_device_add_timeout (FpDevice *device,
|
|
|
73b847 |
source = (FpDeviceTimeoutSource *) g_source_new (&timeout_funcs,
|
|
|
73b847 |
sizeof (FpDeviceTimeoutSource));
|
|
|
73b847 |
source->device = device;
|
|
|
73b847 |
- source->user_data = user_data;
|
|
|
73b847 |
|
|
|
73b847 |
g_source_attach (&source->source, NULL);
|
|
|
73b847 |
g_source_set_callback (&source->source, (GSourceFunc) func, user_data, destroy_notify);
|
|
|
73b847 |
--
|
|
|
73b847 |
2.24.1
|
|
|
73b847 |
|