From 38c0d71060c3d0c3c12d18db1d2f5f0b4a3f02a4 Mon Sep 17 00:00:00 2001 From: "Paul \"LeoNerd\" Evans" Date: Wed, 30 Jan 2019 17:26:39 +0000 Subject: Rename 'cookie' parameter to 'watch' --- include/tickit.h | 2 +- src/tickit.c | 6 +++--- t/51tickit-timer.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/tickit.h b/include/tickit.h index 58ebcfa..b8f8555 100644 --- a/include/tickit.h +++ b/include/tickit.h @@ -670,7 +670,7 @@ void *tickit_watch_timer_after_tv(Tickit *t, const struct timeval *after, Tickit void *tickit_watch_later(Tickit *t, TickitBindFlags flags, TickitCallbackFn *fn, void *user); -void tickit_watch_cancel(Tickit *t, void *cookie); +void tickit_watch_cancel(Tickit *t, void *watch); /* Debug support */ diff --git a/src/tickit.c b/src/tickit.c index e98efd6..ae95998 100644 --- a/src/tickit.c +++ b/src/tickit.c @@ -353,9 +353,9 @@ void *tickit_watch_later(Tickit *t, TickitBindFlags flags, TickitCallbackFn *fn, return watch; } -void tickit_watch_cancel(Tickit *t, void *cookie) +void tickit_watch_cancel(Tickit *t, void *_watch) { - Watch *watch = cookie; + Watch *watch = _watch; Watch **prevp; switch(watch->type) { @@ -375,7 +375,7 @@ void tickit_watch_cancel(Tickit *t, void *cookie) while(*prevp) { Watch *this = *prevp; - if(this == cookie) { + if(this == watch) { *prevp = this->next; if(this->flags & TICKIT_BIND_UNBIND) diff --git a/t/51tickit-timer.c b/t/51tickit-timer.c index 4fc1faa..aecb689 100644 --- a/t/51tickit-timer.c +++ b/t/51tickit-timer.c @@ -70,10 +70,10 @@ int main(int argc, char *argv[]) int called = 0; tickit_watch_timer_after_msec(t, 10, 0, &on_call_incr, &called); int not_called = 0; - void *cookie = tickit_watch_timer_after_msec(t, 5, TICKIT_BIND_UNBIND, &on_call_incr, ¬_called); + void *watch = tickit_watch_timer_after_msec(t, 5, TICKIT_BIND_UNBIND, &on_call_incr, ¬_called); unbound_count = 0; - tickit_watch_cancel(t, cookie); + tickit_watch_cancel(t, watch); is_int(unbound_count, 1, "unbound_count after tickit_watch_cancel"); tickit_run(t); -- cgit v1.2.3