From 894a8523cb0b363dbcca404a758d1af551298e3c Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Fri, 2 Nov 2012 14:32:14 +0100 Subject: [PATCH] test: fix signed/unsigned comparison warnings --- test/benchmark-fs-stat.c | 2 +- test/benchmark-udp-pummel.c | 6 +++--- test/test-poll.c | 2 +- test/test-stdio-over-pipes.c | 3 ++- test/test-timer.c | 3 ++- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/test/benchmark-fs-stat.c b/test/benchmark-fs-stat.c index 4404ab4c..b0d7fe57 100644 --- a/test/benchmark-fs-stat.c +++ b/test/benchmark-fs-stat.c @@ -45,7 +45,7 @@ struct async_req { static void warmup(const char* path) { uv_fs_t reqs[MAX_CONCURRENT_REQS]; - int i; + unsigned int i; /* warm up the thread pool */ for (i = 0; i < ARRAY_SIZE(reqs); i++) diff --git a/test/benchmark-udp-pummel.c b/test/benchmark-udp-pummel.c index a41dce64..d14b8122 100644 --- a/test/benchmark-udp-pummel.c +++ b/test/benchmark-udp-pummel.c @@ -143,13 +143,13 @@ static void timeout_cb(uv_timer_t* timer, int status) { } -static int do_packet_storm(int n_senders, - int n_receivers, +static int do_packet_storm(unsigned int n_senders, + unsigned int n_receivers, unsigned long timeout) { uv_timer_t timer_handle; uint64_t duration; uv_loop_t* loop; - int i; + unsigned int i; ASSERT(n_senders <= ARRAY_SIZE(senders)); ASSERT(n_receivers <= ARRAY_SIZE(receivers)); diff --git a/test/test-poll.c b/test/test-poll.c index b69f9f24..eb5cb848 100644 --- a/test/test-poll.c +++ b/test/test-poll.c @@ -205,7 +205,7 @@ static void destroy_connection_context(connection_context_t* context) { static void connection_poll_cb(uv_poll_t* handle, int status, int events) { connection_context_t* context = (connection_context_t*) handle->data; - int new_events; + unsigned int new_events; int r; ASSERT(status == 0); diff --git a/test/test-stdio-over-pipes.c b/test/test-stdio-over-pipes.c index 03e71071..aeb7bd92 100644 --- a/test/test-stdio-over-pipes.c +++ b/test/test-stdio-over-pipes.c @@ -196,7 +196,8 @@ int stdio_over_pipes_helper() { uv_write_t write_req[ARRAY_SIZE(buffers)]; uv_buf_t buf[ARRAY_SIZE(buffers)]; - int r, i; + unsigned int i; + int r; uv_loop_t* loop = uv_default_loop(); ASSERT(UV_NAMED_PIPE == uv_guess_handle(0)); diff --git a/test/test-timer.c b/test/test-timer.c index 5f634495..61b4926f 100644 --- a/test/test-timer.c +++ b/test/test-timer.c @@ -90,7 +90,8 @@ TEST_IMPL(timer) { uv_timer_t once_timers[10]; uv_timer_t *once; uv_timer_t repeat, never; - int i, r; + unsigned int i; + int r; start_time = uv_now(uv_default_loop()); ASSERT(0 < start_time);