return result;
}
-static void
-fd_source_closure_marshal (GClosure *closure,
- GValue *return_value,
- guint n_param_values,
- const GValue *param_values,
- gpointer invocation_hint,
- gpointer marshal_data)
-{
- GFDSourceFunc callback;
- GCClosure *cc = (GCClosure*) closure;
- gboolean v_return;
-
- g_return_if_fail (return_value != NULL);
- g_return_if_fail (n_param_values == 0);
-
- callback = (GFDSourceFunc) (marshal_data ? marshal_data : cc->callback);
-
- v_return = callback (g_value_get_int (param_values),
- g_value_get_flags (param_values + 1),
- closure->data);
-
- g_value_set_boolean (return_value, v_return);
-}
-
static GSourceFuncs fd_source_funcs = {
fd_source_prepare,
fd_source_check,
fd_source_dispatch,
fd_source_finalize,
(GSourceFunc)fd_source_closure_callback,
- (GSourceDummyMarshal)fd_source_closure_marshal,
};
GSource *
cancellable_source_dispatch,
cancellable_source_finalize,
(GSourceFunc)cancellable_source_closure_callback,
- (GSourceDummyMarshal)g_cclosure_marshal_generic,
};
/**
pollable_source_dispatch,
pollable_source_finalize,
(GSourceFunc)pollable_source_closure_callback,
- (GSourceDummyMarshal)g_cclosure_marshal_generic,
};
/**
socket_source_dispatch,
socket_source_finalize,
(GSourceFunc)socket_source_closure_callback,
- (GSourceDummyMarshal)g_cclosure_marshal_generic,
};
static GSource *
return etype;
}
-/* We need to hand-write this marshaler, since it doesn't have an
- * instance object.
- */
-static void
-source_closure_marshal_BOOLEAN__VOID (GClosure *closure,
- GValue *return_value,
- guint n_param_values,
- const GValue *param_values,
- gpointer invocation_hint,
- gpointer marshal_data)
-{
- GSourceFunc callback;
- GCClosure *cc = (GCClosure*) closure;
- gboolean v_return;
-
- g_return_if_fail (return_value != NULL);
- g_return_if_fail (n_param_values == 0);
-
- callback = (GSourceFunc) (marshal_data ? marshal_data : cc->callback);
-
- v_return = callback (closure->data);
-
- g_value_set_boolean (return_value, v_return);
-}
-
static gboolean
io_watch_closure_callback (GIOChannel *channel,
GIOCondition condition,
if (G_CLOSURE_NEEDS_MARSHAL (closure))
{
GClosureMarshal marshal = (GClosureMarshal)source->source_funcs->closure_marshal;
- if (!marshal)
- {
- if (source->source_funcs == &g_idle_funcs ||
- source->source_funcs == &g_timeout_funcs)
- marshal = source_closure_marshal_BOOLEAN__VOID;
- else if (source->source_funcs == &g_io_watch_funcs)
- marshal = g_cclosure_marshal_BOOLEAN__FLAGS;
- }
if (marshal)
g_closure_set_marshal (closure, marshal);
+ else
+ g_closure_set_marshal (closure, g_cclosure_marshal_generic);
}
}