diff --git a/test/bench.c b/test/bench.c index 33f2f43f..a4bfda0e 100644 --- a/test/bench.c +++ b/test/bench.c @@ -67,7 +67,7 @@ static struct event *events; static void read_cb(int fd, short which, void *arg) { - int idx = (int) arg, widx = idx + 1; + long idx = (long) arg, widx = idx + 1; u_char ch; count += read(fd, &ch, sizeof(ch)); @@ -83,7 +83,8 @@ read_cb(int fd, short which, void *arg) static struct timeval * run_once(void) { - int *cp, i, space; + int *cp, space; + long i; static struct timeval ts, te; for (cp = pipes, i = 0; i < num_pipes; i++, cp += 2) { diff --git a/test/bench_cascade.c b/test/bench_cascade.c index 761d1300..809b9993 100644 --- a/test/bench_cascade.c +++ b/test/bench_cascade.c @@ -65,7 +65,7 @@ static void read_cb(int fd, short which, void *arg) { char ch; - int idx = (int) arg; + long idx = (long) arg; read(fd, &ch, sizeof(ch)); if (idx >= 0) @@ -95,7 +95,7 @@ run_once(int num_pipes) } for (cp = pipes, i = 0; i < num_pipes; i++, cp += 2) { - int fd = i < num_pipes - 1 ? cp[3] : -1; + long fd = i < num_pipes - 1 ? cp[3] : -1; event_set(&events[i], cp[0], EV_READ, read_cb, (void *) fd); event_add(&events[i], NULL); }