From 5b7a16146d172a03e18300750a9b9806706098c5 Mon Sep 17 00:00:00 2001 From: Tim Janik Date: Wed, 7 Nov 2001 03:25:55 +0000 Subject: [PATCH] provide G_CLOSURE_N_NOTIFIERS() for people that need to walk the notifier Wed Nov 7 00:56:00 2001 Tim Janik * gclosure.h: provide G_CLOSURE_N_NOTIFIERS() for people that need to walk the notifier list (puhh, black magic, stay-away-warning ;). --- gobject/ChangeLog | 5 +++++ gobject/gclosure.c | 3 ++- gobject/gclosure.h | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/gobject/ChangeLog b/gobject/ChangeLog index 093b65e..d344bf5 100644 --- a/gobject/ChangeLog +++ b/gobject/ChangeLog @@ -1,3 +1,8 @@ +Wed Nov 7 00:56:00 2001 Tim Janik + + * gclosure.h: provide G_CLOSURE_N_NOTIFIERS() for people that need + to walk the notifier list (puhh, black magic, stay-away-warning ;). + Mon Nov 5 18:59:08 2001 Tim Janik * gobject.h: diff --git a/gobject/gclosure.c b/gobject/gclosure.c index 532e73d..8c540c4 100644 --- a/gobject/gclosure.c +++ b/gobject/gclosure.c @@ -32,6 +32,7 @@ #define CLOSURE_MAX_N_INOTIFIERS ((1 << 8) - 1) #define CLOSURE_N_MFUNCS(cl) ((cl)->meta_marshal + \ ((cl)->n_guards << 1L)) +/* same as G_CLOSURE_N_NOTIFIERS() (keep in sync) */ #define CLOSURE_N_NOTIFIERS(cl) (CLOSURE_N_MFUNCS (cl) + \ (cl)->n_fnotifiers + \ (cl)->n_inotifiers) @@ -77,7 +78,7 @@ closure_invoke_notifiers (GClosure *closure, { /* notifier layout: * meta_marshal n_guards n_guards n_fnotif. n_inotifiers - * ->[[meta_marshal][pre_guards][post_guards][fnotifers][inotifiers]] + * ->[[meta_marshal][pre_guards][post_guards][fnotifiers][inotifiers]] * * CLOSURE_N_MFUNCS(cl) = meta_marshal + n_guards + n_guards; * CLOSURE_N_NOTIFIERS(cl) = CLOSURE_N_MFUNCS(cl) + n_fnotifiers + n_inotifiers diff --git a/gobject/gclosure.h b/gobject/gclosure.h index ab8974d..dd9af65 100644 --- a/gobject/gclosure.h +++ b/gobject/gclosure.h @@ -26,6 +26,8 @@ G_BEGIN_DECLS /* --- defines --- */ #define G_CLOSURE_NEEDS_MARSHAL(closure) (((GClosure*) (closure))->marshal == NULL) +#define G_CLOSURE_N_NOTIFIERS(cl) ((cl)->meta_marshal + ((cl)->n_guards << 1L) + \ + (cl)->n_fnotifiers + (cl)->n_inotifiers) #define G_CCLOSURE_SWAP_DATA(cclosure) (((GClosure*) (closure))->derivative_flag) #define G_CALLBACK(f) ((GCallback) (f)) -- 2.7.4