diff --git a/test/bench.c b/test/bench.c index e51b12a9..fde7d4ac 100644 --- a/test/bench.c +++ b/test/bench.c @@ -63,12 +63,16 @@ static int *pipes; static int num_pipes, num_active, num_writes; static struct event *events; - +#if SIZEOF_VOID_P == 4 +#define EV_INTPTR_T ev_int32_t +#elif SIZEOF_VOID_P == 8 +#define EV_INTPTR_T ev_int64_t +#endif static void read_cb(int fd, short which, void *arg) { - int idx = (int) arg, widx = idx + 1; + EV_INTPTR_T idx = (ev_uint64_t) arg, widx = idx + 1; u_char ch; count += read(fd, &ch, sizeof(ch)); @@ -84,7 +88,8 @@ read_cb(int fd, short which, void *arg) static struct timeval * run_once(void) { - int *cp, i, space; + int *cp, space; + EV_INTPTR_T i; static struct timeval ts, te; for (cp = pipes, i = 0; i < num_pipes; i++, cp += 2) {