--- libev/ev_select.c 2007/11/12 00:31:08 1.20 +++ libev/ev_select.c 2007/12/09 03:51:19 1.26 @@ -90,7 +90,7 @@ int word = fd / NFDBITS; int mask = 1UL << (fd % NFDBITS); - if (vec_max < word + 1) + if (expect_false (vec_max < word + 1)) { int new_max = word + 1; @@ -134,7 +134,7 @@ res = select (vec_max * NFDBITS, (fd_set *)vec_ro, (fd_set *)vec_wo, 0, &tv); - if (res < 0) + if (expect_false (res < 0)) { #if EV_SELECT_IS_WINSOCKET errno = WSAGetLastError (); @@ -168,7 +168,7 @@ if (FD_ISSET (handle, (fd_set *)vec_ro)) events |= EV_READ; if (FD_ISSET (handle, (fd_set *)vec_wo)) events |= EV_WRITE; - if (events) + if (expect_true (events)) fd_event (EV_A_ fd, events); } } @@ -191,7 +191,7 @@ events |= word_r & mask ? EV_READ : 0; events |= word_w & mask ? EV_WRITE : 0; - if (events) + if (expect_true (events)) fd_event (EV_A_ word * NFDBITS + bit, events); } } @@ -200,12 +200,12 @@ #endif } -static int +int inline_size select_init (EV_P_ int flags) { - method_fudge = 1e-2; /* needed to compensate for select returning early, very conservative */ - method_modify = select_modify; - method_poll = select_poll; + backend_fudge = 0.; /* posix says this is zero */ + backend_modify = select_modify; + backend_poll = select_poll; #if EV_SELECT_USE_FD_SET vec_max = FD_SETSIZE / 32; @@ -221,10 +221,10 @@ vec_wo = 0; #endif - return EVMETHOD_SELECT; + return EVBACKEND_SELECT; } -static void +void inline_size select_destroy (EV_P) { ev_free (vec_ri);