X-Git-Url: https://git.llucax.com/software/eventxx.git/blobdiff_plain/74586d2d5468117b218816eea646470c02a469f9..05c87a8111143c57ddf2f2111a4e2d0240a6a49e:/test/bench.cpp?ds=sidebyside diff --git a/test/bench.cpp b/test/bench.cpp index ca495a7..0236559 100644 --- a/test/bench.cpp +++ b/test/bench.cpp @@ -30,7 +30,7 @@ * Added chain event propagation to improve the sensitivity of * the measure respect to the event loop efficency. * - * Wed 2006-12-27 - Modified by Leandro Lucarella + * Wed 2006-12-27 - Modified by Leandro Lucarella * * Adapted to test the C++ inteface. * @@ -60,7 +60,7 @@ static int count, writes, fired; static int *pipes; -static int num_pipes, num_active, num_writes; +static unsigned num_pipes, num_active, num_writes; static std::vector< eventxx::cevent* > events; static eventxx::dispatcher d; @@ -68,7 +68,7 @@ static eventxx::dispatcher d; void read_cb(int fd, short which, void *arg) { - int idx = (int) arg, widx = idx + 1; + size_t idx = (size_t) arg, widx = idx + 1; u_char ch; count += read(fd, &ch, sizeof(ch)); @@ -84,7 +84,8 @@ read_cb(int fd, short which, void *arg) eventxx::time * run_once(void) { - int *cp, i, space; + size_t i; + int *cp, space; static eventxx::time ts, te; for (cp = pipes, i = 0; i < num_pipes; i++, cp += 2) { @@ -93,7 +94,7 @@ run_once(void) d.add(*events[i]); } - d.dispatch(EVLOOP_ONCE | EVLOOP_NONBLOCK); + d.dispatch(eventxx::ONCE | eventxx::NONBLOCK); fired = 0; space = num_pipes / num_active; @@ -130,9 +131,9 @@ int main (int argc, char **argv) { struct rlimit rl; - int i, c; + size_t i; eventxx::time* tv; - int *cp; + int c, *cp; extern char *optarg; num_pipes = 100;