[glib] Remove some unnecessary source prepare/check functions



commit 8f80fbb2a7bbd140657247b328d6f010ed4d9157
Author: Dan Winship <danw gnome org>
Date:   Mon Jun 3 08:10:31 2013 -0300

    Remove some unnecessary source prepare/check functions
    
    GPollableSource and GSocket's "broken" source never trigger on their
    own, so with the changes to GSources in the last cycle, their check
    and prepare functions are unnecessary (and undesired).
    
    https://bugzilla.gnome.org/show_bug.cgi?id=701511

 gio/gpollableutils.c |   18 ++----------------
 gio/gsocket.c        |   17 ++---------------
 2 files changed, 4 insertions(+), 31 deletions(-)
---
diff --git a/gio/gpollableutils.c b/gio/gpollableutils.c
index 1aa4fd0..e794ac6 100644
--- a/gio/gpollableutils.c
+++ b/gio/gpollableutils.c
@@ -42,20 +42,6 @@ typedef struct {
 } GPollableSource;
 
 static gboolean
-pollable_source_prepare (GSource *source,
-                        gint    *timeout)
-{
-  *timeout = -1;
-  return FALSE;
-}
-
-static gboolean
-pollable_source_check (GSource *source)
-{
-  return FALSE;
-}
-
-static gboolean
 pollable_source_dispatch (GSource     *source,
                          GSourceFunc  callback,
                          gpointer     user_data)
@@ -100,8 +86,8 @@ pollable_source_closure_callback (GObject  *stream,
 
 static GSourceFuncs pollable_source_funcs =
 {
-  pollable_source_prepare,
-  pollable_source_check,
+  NULL,
+  NULL,
   pollable_source_dispatch,
   pollable_source_finalize,
   (GSourceFunc)pollable_source_closure_callback,
diff --git a/gio/gsocket.c b/gio/gsocket.c
index 20f4b30..7c1422b 100644
--- a/gio/gsocket.c
+++ b/gio/gsocket.c
@@ -2916,19 +2916,6 @@ g_socket_is_closed (GSocket *socket)
 #ifdef G_OS_WIN32
 /* Broken source, used on errors */
 static gboolean
-broken_prepare  (GSource *source,
-                gint    *timeout)
-{
-  return FALSE;
-}
-
-static gboolean
-broken_check (GSource *source)
-{
-  return FALSE;
-}
-
-static gboolean
 broken_dispatch (GSource     *source,
                 GSourceFunc  callback,
                 gpointer     user_data)
@@ -2938,8 +2925,8 @@ broken_dispatch (GSource     *source,
 
 static GSourceFuncs broken_funcs =
 {
-  broken_prepare,
-  broken_check,
+  NULL,
+  NULL,
   broken_dispatch,
   NULL
 };


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