Skip to content

Commit

Permalink
Eliminate compiler warnings (at least for gcc/linux)
Browse files Browse the repository at this point in the history
Signed-off-by: Philip Prindeville <[email protected]>
Closes: libevent#646 # cherry-picked from the PR
  • Loading branch information
pprindeville authored and azat committed Aug 17, 2018
1 parent ee12c51 commit be37116
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions test/regress_dns.c
Original file line number Diff line number Diff line change
Expand Up @@ -1020,7 +1020,7 @@ be_getaddrinfo_server_cb(struct evdns_server_request *req, void *data)
int added_any=0;
++*n_got_p;

for (i=0;i<req->nquestions;++i) {
for (i = 0; i < req->nquestions; ++i) {
const int qtype = req->questions[i]->type;
const int qclass = req->questions[i]->dns_question_class;
const char *qname = req->questions[i]->name;
Expand Down Expand Up @@ -1368,7 +1368,7 @@ test_getaddrinfo_async(void *arg)
struct evutil_addrinfo hints, *a;
struct gai_outcome local_outcome;
struct gai_outcome a_out[12];
int i;
unsigned i;
struct evdns_getaddrinfo_request *r;
char buf[128];
struct evdns_server_port *port = NULL;
Expand Down Expand Up @@ -1726,7 +1726,7 @@ test_getaddrinfo_async(void *arg)
end:
if (local_outcome.ai)
evutil_freeaddrinfo(local_outcome.ai);
for (i=0;i<(int)ARRAY_SIZE(a_out);++i) {
for (i = 0; i < ARRAY_SIZE(a_out); ++i) {
if (a_out[i].ai)
evutil_freeaddrinfo(a_out[i].ai);
}
Expand Down Expand Up @@ -2000,7 +2000,7 @@ test_getaddrinfo_async_cancel_stress(void *ptr)
struct sockaddr_in sin;
struct sockaddr_storage ss;
ev_socklen_t slen;
int i;
unsigned i;

base = event_base_new();
dns_base = evdns_base_new(base, 0);
Expand Down Expand Up @@ -2055,7 +2055,7 @@ dns_client_fail_requests_test(void *arg)
char buf[64];

struct generic_dns_callback_result r[20];
int i;
unsigned i;

dns_port = regress_get_dnsserver(base, &portnum, NULL,
regress_dns_server_cb, reissue_table);
Expand Down Expand Up @@ -2163,9 +2163,9 @@ race_busywait_run(void *arg)
static void
race_gai_cb(int result, struct evutil_addrinfo *res, void *arg)
{
struct race_param *rp = arg;
(void)result;
(void)res;
struct race_param *rp = arg;

--n_replies_left;
if (n_replies_left == 0) {
Expand All @@ -2177,7 +2177,6 @@ race_gai_cb(int result, struct evutil_addrinfo *res, void *arg)
static void
getaddrinfo_race_gotresolve_test(void *arg)
{
(void)arg;
struct race_param rp;
struct evdns_server_port *dns_port = NULL;
ev_uint16_t portnum = 0;
Expand All @@ -2194,6 +2193,8 @@ getaddrinfo_race_gotresolve_test(void *arg)
THREAD_T thread[n_threads];
struct timeval tv;

(void)arg;

evthread_use_pthreads();

rp.base = event_base_new();
Expand Down

0 comments on commit be37116

Please sign in to comment.