From 267472dcd3f8cb74aa26cbb64a945d575d14a56a Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Tue, 21 Jul 2009 17:57:31 +0000 Subject: [PATCH] Do a quick-and-dirty hack to fix a gcc warning on 1.4 with a 64-bit arch svn:r1368 --- test/bench.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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) {