From b6724b60593ef8c3935f95c159460cbb2deb3ccf Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Sat, 16 Mar 2019 16:52:05 +0300 Subject: [PATCH] bench: suppress int conversion warnings (cherry picked from commit efcc18442b338d931f6dfe71d5ebaff3c6fa2b03) --- test/bench.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/test/bench.c b/test/bench.c index c2c8983d..3a6886db 100644 --- a/test/bench.c +++ b/test/bench.c @@ -34,6 +34,7 @@ */ #include "event2/event-config.h" +#include "../util-internal.h" #include #include @@ -64,7 +65,8 @@ #include #include -static int count, writes, fired, failures; +static ev_ssize_t count, fired; +static int writes, failures; static evutil_socket_t *pipes; static int num_pipes, num_active, num_writes; static struct event *events; @@ -117,15 +119,18 @@ run_once(void) count = 0; writes = num_writes; - { int xcount = 0; - evutil_gettimeofday(&ts, NULL); - do { - event_loop(EVLOOP_ONCE | EVLOOP_NONBLOCK); - xcount++; - } while (count != fired); - evutil_gettimeofday(&te, NULL); + { + int xcount = 0; + evutil_gettimeofday(&ts, NULL); + do { + event_loop(EVLOOP_ONCE | EVLOOP_NONBLOCK); + xcount++; + } while (count != fired); + evutil_gettimeofday(&te, NULL); - if (xcount != count) fprintf(stderr, "Xcount: %d, Rcount: %d\n", xcount, count); + if (xcount != count) + fprintf(stderr, "Xcount: %d, Rcount: " EV_SSIZE_FMT "\n", + xcount, count); } evutil_timersub(&te, &ts, &te);