From fbe24f43ab56deb2fd50fa4ca1756069c2c9123e Mon Sep 17 00:00:00 2001 From: Niels Provos Date: Sun, 9 Dec 2007 05:07:20 +0000 Subject: [PATCH] remove obsoleted recalc code svn:r581 --- WIN32-Code/win32.c | 11 ----------- devpoll.c | 2 -- epoll.c | 2 -- event-internal.h | 1 - event.c | 4 ---- evport.c | 18 +----------------- kqueue.c | 8 -------- poll.c | 13 ------------- select.c | 17 ----------------- 9 files changed, 1 insertion(+), 75 deletions(-) diff --git a/WIN32-Code/win32.c b/WIN32-Code/win32.c index e6c424fc..945c949b 100644 --- a/WIN32-Code/win32.c +++ b/WIN32-Code/win32.c @@ -110,7 +110,6 @@ RB_GENERATE(event_map, event_entry, node, compare); void *win32_init (struct event_base *); int win32_insert (void *, struct event *); int win32_del (void *, struct event *); -int win32_recalc (struct event_base *base, void *, int); int win32_dispatch (struct event_base *base, void *, struct timeval *); void win32_dealloc (struct event_base *, void *); @@ -119,7 +118,6 @@ struct eventop win32ops = { win32_init, win32_insert, win32_del, - win32_recalc, win32_dispatch, win32_dealloc, 0 @@ -268,15 +266,6 @@ win32_init(struct event_base *_base) return (NULL); } -int -win32_recalc(struct event_base *base, void *arg, int max) -{ -#if 0 - return (evsignal_recalc()); -#endif - return (0); -} - int win32_insert(void *op, struct event *ev) { diff --git a/devpoll.c b/devpoll.c index eaa0aedf..9164ad0b 100644 --- a/devpoll.c +++ b/devpoll.c @@ -72,7 +72,6 @@ struct devpollop { void *devpoll_init (struct event_base *); int devpoll_add (void *, struct event *); int devpoll_del (void *, struct event *); -int devpoll_recalc (struct event_base *, void *, int); int devpoll_dispatch (struct event_base *, void *, struct timeval *); void devpoll_dealloc (struct event_base *, void *); @@ -81,7 +80,6 @@ struct eventop devpollops = { devpoll_init, devpoll_add, devpoll_del, - devpoll_recalc, devpoll_dispatch, devpoll_dealloc }; diff --git a/epoll.c b/epoll.c index 06ff66a3..bedab1d3 100644 --- a/epoll.c +++ b/epoll.c @@ -72,7 +72,6 @@ struct epollop { void *epoll_init (struct event_base *); int epoll_add (void *, struct event *); int epoll_del (void *, struct event *); -int epoll_recalc (struct event_base *, void *, int); int epoll_dispatch (struct event_base *, void *, struct timeval *); void epoll_dealloc (struct event_base *, void *); @@ -81,7 +80,6 @@ struct eventop epollops = { epoll_init, epoll_add, epoll_del, - epoll_recalc, epoll_dispatch, epoll_dealloc, 1 /* need reinit */ diff --git a/event-internal.h b/event-internal.h index 424ea3e9..f61757c1 100644 --- a/event-internal.h +++ b/event-internal.h @@ -41,7 +41,6 @@ struct eventop { void *(*init)(struct event_base *); int (*add)(void *, struct event *); int (*del)(void *, struct event *); - int (*recalc)(struct event_base *, void *, int); int (*dispatch)(struct event_base *, void *, struct timeval *); void (*dealloc)(struct event_base *, void *); /* set if we need to reinitialize the event base */ diff --git a/event.c b/event.c index da8fc8df..9b54cfcc 100644 --- a/event.c +++ b/event.c @@ -443,10 +443,6 @@ event_base_loop(struct event_base *base, int flags) evsignal_base = base; done = 0; while (!done) { - /* Calculate the initial events that we are waiting for */ - if (evsel->recalc(base, evbase, 0) == -1) - return (-1); - /* Terminate the loop if we have been asked to */ if (base->event_gotterm) { base->event_gotterm = 0; diff --git a/evport.c b/evport.c index 76688e0e..c5d24e70 100644 --- a/evport.c +++ b/evport.c @@ -47,8 +47,7 @@ * necessary when large fd's come in. reassociate() takes care of maintaining * the proper file-descriptor/event-port associations. * - * As in the select(2) implementation, signals are handled by evsignal, and - * evport_recalc does almost nothing. + * As in the select(2) implementation, signals are handled by evsignal. */ #ifdef HAVE_CONFIG_H @@ -119,7 +118,6 @@ struct evport_data { static void* evport_init (struct event_base *); static int evport_add (void *, struct event *); static int evport_del (void *, struct event *); -static int evport_recalc (struct event_base *, void *, int); static int evport_dispatch (struct event_base *, void *, struct timeval *); static void evport_dealloc (struct event_base *, void *); @@ -128,7 +126,6 @@ const struct eventop evportops = { evport_init, evport_add, evport_del, - evport_recalc, evport_dispatch, evport_dealloc }; @@ -395,19 +392,6 @@ evport_dispatch(struct event_base *base, void *arg, struct timeval *tv) } -/* - * Copied from the version in select.c - */ - -static int -evport_recalc(struct event_base *base, void *arg, int max) -{ - struct evport_data *evpd = arg; - check_evportop(evpd); - return (0); -} - - /* * Adds the given event (so that you will be notified when it happens via * the callback function). diff --git a/kqueue.c b/kqueue.c index b241a951..c80d0619 100644 --- a/kqueue.c +++ b/kqueue.c @@ -77,7 +77,6 @@ struct kqop { void *kq_init (struct event_base *); int kq_add (void *, struct event *); int kq_del (void *, struct event *); -int kq_recalc (struct event_base *, void *, int); int kq_dispatch (struct event_base *, void *, struct timeval *); int kq_insert (struct kqop *, struct kevent *); void kq_dealloc (struct event_base *, void *); @@ -87,7 +86,6 @@ const struct eventop kqops = { kq_init, kq_add, kq_del, - kq_recalc, kq_dispatch, kq_dealloc, 1 /* need reinit */ @@ -154,12 +152,6 @@ kq_init(struct event_base *base) return (kqueueop); } -int -kq_recalc(struct event_base *base, void *arg, int max) -{ - return (0); -} - int kq_insert(struct kqop *kqop, struct kevent *kev) { diff --git a/poll.c b/poll.c index 9be42e17..2f8f6fce 100644 --- a/poll.c +++ b/poll.c @@ -68,7 +68,6 @@ struct pollop { void *poll_init (struct event_base *); int poll_add (void *, struct event *); int poll_del (void *, struct event *); -int poll_recalc (struct event_base *, void *, int); int poll_dispatch (struct event_base *, void *, struct timeval *); void poll_dealloc (struct event_base *, void *); @@ -77,7 +76,6 @@ const struct eventop pollops = { poll_init, poll_add, poll_del, - poll_recalc, poll_dispatch, poll_dealloc, 0 @@ -100,17 +98,6 @@ poll_init(struct event_base *base) return (pollop); } -/* - * Called with the highest fd that we know about. If it is 0, completely - * recalculate everything. - */ - -int -poll_recalc(struct event_base *base, void *arg, int max) -{ - return (0); -} - #ifdef CHECK_INVARIANTS static void poll_check_ok(struct pollop *pop) diff --git a/select.c b/select.c index 92c3ed31..064c3961 100644 --- a/select.c +++ b/select.c @@ -73,7 +73,6 @@ struct selectop { void *select_init (struct event_base *); int select_add (void *, struct event *); int select_del (void *, struct event *); -int select_recalc (struct event_base *, void *, int); int select_dispatch (struct event_base *, void *, struct timeval *); void select_dealloc (struct event_base *, void *); @@ -82,7 +81,6 @@ const struct eventop selectops = { select_init, select_add, select_del, - select_recalc, select_dispatch, select_dealloc, 0 @@ -136,21 +134,6 @@ check_selectop(struct selectop *sop) #define check_selectop(sop) do { (void) sop; } while (0) #endif -/* - * Called with the highest fd that we know about. If it is 0, completely - * recalculate everything. - */ - -int -select_recalc(struct event_base *base, void *arg, int max) -{ - struct selectop *sop = arg; - - check_selectop(sop); - - return (0); -} - int select_dispatch(struct event_base *base, void *arg, struct timeval *tv) { -- 2.40.0