X-Git-Url: https://git.llucax.com/software/libev.git/blobdiff_plain/0b7b062fb0b1c4f1ab22a52bd91f3c86195a084e..cff78812ebbcab7601919f479447150fb7c2c9f4:/ev_kqueue.c?ds=sidebyside diff --git a/ev_kqueue.c b/ev_kqueue.c index 4933270..76ac012 100644 --- a/ev_kqueue.c +++ b/ev_kqueue.c @@ -39,7 +39,8 @@ kqueue_change (EV_P_ int fd, int filter, int flags, int fflags) { struct kevent *ke; - array_needsize (struct kevent, kqueue_changes, kqueue_changemax, ++kqueue_changecnt, ); + ++kqueue_changecnt; + array_needsize (struct kevent, kqueue_changes, kqueue_changemax, kqueue_changecnt, EMPTY2); ke = &kqueue_changes [kqueue_changecnt - 1]; memset (ke, 0, sizeof (struct kevent)); @@ -83,11 +84,11 @@ kqueue_poll (EV_P_ ev_tstamp timeout) { ev_free (kqueue_events); kqueue_eventmax = array_roundsize (struct kevent, kqueue_changecnt); - kqueue_events = ev_malloc (sizeof (struct kevent) * kqueue_eventmax); + kqueue_events = (struct kevent *)ev_malloc (sizeof (struct kevent) * kqueue_eventmax); } ts.tv_sec = (time_t)timeout; - ts.tv_nsec = (long)(timeout - (ev_tstamp)ts.tv_sec) * 1e9; + ts.tv_nsec = (long)((timeout - (ev_tstamp)ts.tv_sec) * 1e9); res = kevent (kqueue_fd, kqueue_changes, kqueue_changecnt, kqueue_events, kqueue_eventmax, &ts); kqueue_changecnt = 0; @@ -147,7 +148,7 @@ kqueue_poll (EV_P_ ev_tstamp timeout) { ev_free (kqueue_events); kqueue_eventmax = array_roundsize (struct kevent, kqueue_eventmax << 1); - kqueue_events = ev_malloc (sizeof (struct kevent) * kqueue_eventmax); + kqueue_events = (struct kevent *)ev_malloc (sizeof (struct kevent) * kqueue_eventmax); } } @@ -186,13 +187,13 @@ kqueue_init (EV_P_ int flags) method_poll = kqueue_poll; kqueue_eventmax = 64; /* intiial number of events receivable per poll */ - kqueue_events = ev_malloc (sizeof (struct kevent) * kqueue_eventmax); + kqueue_events = (struct kevent *)ev_malloc (sizeof (struct kevent) * kqueue_eventmax); kqueue_changes = 0; kqueue_changemax = 0; kqueue_changecnt = 0; - return EVMETHOD_KQUEUE; + return EVBACKEND_KQUEUE; } static void