From 0d1d4c563b5f48697f98326c264d8fbaefee0cee Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Thu, 16 Apr 2009 20:35:18 -0300 Subject: [PATCH] Allows for compilation on 64-bit machines This is a sightly modified fix reported by Armen Babikyan. --- test/bench.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/test/bench.cpp b/test/bench.cpp index b466806..0236559 100644 --- a/test/bench.cpp +++ b/test/bench.cpp @@ -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) { @@ -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; -- 2.43.0