From e72dff13d9ecfee512aa03bfcbdba39ea84bde48 Mon Sep 17 00:00:00 2001 From: Niels Provos Date: Sat, 1 Mar 2003 20:31:28 +0000 Subject: [PATCH] replace references to __FUNCTION__ with __func__ svn:r40 --- event.c | 10 +++++----- kqueue.c | 17 +++++++++-------- poll.c | 7 ++----- select.c | 3 +-- 4 files changed, 17 insertions(+), 20 deletions(-) diff --git a/event.c b/event.c index 617a11c8..48073c79 100644 --- a/event.c +++ b/event.c @@ -207,7 +207,7 @@ event_loop(int flags) struct timeval off; LOG_DBG((LOG_MIST, 10, "%s: time is running backwards, corrected", - __FUNCTION__)); + __func__)); timersub(&event_tv, &tv, &off); timeout_correct(&off); @@ -464,7 +464,7 @@ void event_queue_remove(struct event *ev, int queue) { if (!(ev->ev_flags & queue)) - errx(1, "%s: %p(fd %d) not on queue %x", __FUNCTION__, + errx(1, "%s: %p(fd %d) not on queue %x", __func__, ev, ev->ev_fd, queue); ev->ev_flags &= ~queue; @@ -482,7 +482,7 @@ event_queue_remove(struct event *ev, int queue) TAILQ_REMOVE(&eventqueue, ev, ev_next); break; default: - errx(1, "%s: unknown queue %x", __FUNCTION__, queue); + errx(1, "%s: unknown queue %x", __func__, queue); } } @@ -490,7 +490,7 @@ void event_queue_insert(struct event *ev, int queue) { if (ev->ev_flags & queue) - errx(1, "%s: %p(fd %d) already on queue %x", __FUNCTION__, + errx(1, "%s: %p(fd %d) already on queue %x", __func__, ev, ev->ev_fd, queue); ev->ev_flags |= queue; @@ -508,6 +508,6 @@ event_queue_insert(struct event *ev, int queue) TAILQ_INSERT_TAIL(&eventqueue, ev, ev_next); break; default: - errx(1, "%s: unknown queue %x", __FUNCTION__, queue); + errx(1, "%s: unknown queue %x", __func__, queue); } } diff --git a/kqueue.c b/kqueue.c index 28a66263..9894064f 100644 --- a/kqueue.c +++ b/kqueue.c @@ -47,12 +47,13 @@ #include #include #include +#include #ifdef USE_LOG #include "log.h" #else #define LOG_DBG(x) -#define log_error(x) perror(x) +#define log_error warn #endif #include "event.h" @@ -142,7 +143,7 @@ kq_insert(struct kqop *kqop, struct kevent *kev) newchange = realloc(kqop->changes, nevents * sizeof(struct kevent)); if (newchange == NULL) { - log_error(__FUNCTION__": malloc"); + log_error("%s: malloc", __func__); return (-1); } kqop->changes = newchange; @@ -155,7 +156,7 @@ kq_insert(struct kqop *kqop, struct kevent *kev) * the next realloc will pick it up. */ if (newresult == NULL) { - log_error(__FUNCTION__": malloc"); + log_error("%s: malloc", __func__); return (-1); } kqop->events = newchange; @@ -165,8 +166,8 @@ kq_insert(struct kqop *kqop, struct kevent *kev) memcpy(&kqop->changes[kqop->nchanges++], kev, sizeof(struct kevent)); - LOG_DBG((LOG_MISC, 70, __FUNCTION__": fd %d %s%s", - kev->ident, + LOG_DBG((LOG_MISC, 70, "%s: fd %d %s%s", + __func__, kev->ident, kev->filter == EVFILT_READ ? "EVFILT_READ" : "EVFILT_WRITE", kev->flags == EV_DELETE ? " (del)" : "")); @@ -203,7 +204,7 @@ kq_dispatch(void *arg, struct timeval *tv) return (0); } - LOG_DBG((LOG_MISC, 80, __FUNCTION__": kevent reports %d", res)); + LOG_DBG((LOG_MISC, 80, "%s: kevent reports %d", __func__, res)); for (i = 0; i < res; i++) { int which = 0; @@ -225,7 +226,7 @@ kq_dispatch(void *arg, struct timeval *tv) return (-1); } - ev = events[i].udata; + ev = (struct event *)events[i].udata; if (events[i].filter == EVFILT_READ) { which |= EV_READ; @@ -250,7 +251,7 @@ kq_dispatch(void *arg, struct timeval *tv) if (events[i].flags & EV_ERROR || events[i].filter == NULL) continue; - ev = events[i].udata; + ev = (struct event *)events[i].udata; if (ev->ev_events & EV_PERSIST) continue; diff --git a/poll.c b/poll.c index 95328907..36284059 100644 --- a/poll.c +++ b/poll.c @@ -122,7 +122,7 @@ int poll_dispatch(void *arg, struct timeval *tv) { int res, i, count, sec, nfds; - struct event *ev, *next; + struct event *ev; struct pollop *pop = arg; count = pop->event_count; @@ -192,8 +192,7 @@ poll_dispatch(void *arg, struct timeval *tv) } else if (evsignal_caught) evsignal_process(); - LOG_DBG((LOG_MISC, 80, __FUNCTION__": poll reports %d", - res)); + LOG_DBG((LOG_MISC, 80, "%s: poll reports %d", __func__, res)); if (res == 0) return (0); @@ -240,8 +239,6 @@ poll_del(void *arg, struct event *ev) { struct pollop *pop = arg; - int signal; - if (!(ev->ev_events & EV_SIGNAL)) return (0); diff --git a/select.c b/select.c index 11411983..00046c73 100644 --- a/select.c +++ b/select.c @@ -194,8 +194,7 @@ select_dispatch(void *arg, struct timeval *tv) } else if (evsignal_caught) evsignal_process(); - LOG_DBG((LOG_MISC, 80, __FUNCTION__": select reports %d", - res)); + LOG_DBG((LOG_MISC, 80, "%s: select reports %d", __func__, res)); maxfd = 0; for (ev = TAILQ_FIRST(&eventqueue); ev != NULL; ev = next) { -- 2.50.1