From b060852a7c5e8972a85129cb746f21f4aa5626d8 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Wed, 14 Feb 2018 17:41:30 +1100 Subject: [PATCH] signed vs unsigned fixes --- bin/dig/dig.c | 6 +++--- bin/dig/dighost.c | 8 ++++---- bin/dig/host.c | 2 +- bin/dig/include/dig/dig.h | 2 +- bin/dig/nslookup.c | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/bin/dig/dig.c b/bin/dig/dig.c index ec923acdae..b53c44d414 100644 --- a/bin/dig/dig.c +++ b/bin/dig/dig.c @@ -233,7 +233,7 @@ help(void) { * Callback from dighost.c to print the received message. */ static void -received(int bytes, isc_sockaddr_t *from, dig_query_t *query) { +received(unsigned int bytes, isc_sockaddr_t *from, dig_query_t *query) { isc_uint64_t diff; time_t tnow; struct tm tmnow; @@ -1311,11 +1311,11 @@ plus_option(const char *option, isc_boolean_t is_batchfile, result = parse_uint(&splitwidth, value, 1023, "split"); - if (splitwidth % 4 != 0) { + if ((splitwidth % 4) != 0U) { splitwidth = ((splitwidth + 3) / 4) * 4; fprintf(stderr, ";; Warning, split must be " "a multiple of 4; adjusting " - "to %d\n", splitwidth); + "to %u\n", splitwidth); } /* * There is an adjustment done in the diff --git a/bin/dig/dighost.c b/bin/dig/dighost.c index ac2db2a020..e02f301018 100644 --- a/bin/dig/dighost.c +++ b/bin/dig/dighost.c @@ -202,7 +202,7 @@ isc_result_t isc_boolean_t headers); void -(*dighost_received)(int bytes, isc_sockaddr_t *from, dig_query_t *query); +(*dighost_received)(unsigned int bytes, isc_sockaddr_t *from, dig_query_t *query); void (*dighost_trying)(char *frm, dig_lookup_t *lookup); @@ -266,7 +266,7 @@ hex_dump(isc_buffer_t *b) { isc_buffer_usedregion(b, &r); - printf("%d bytes\n", r.length); + printf("%u bytes\n", r.length); for (len = 0; len < r.length; len++) { printf("%02x ", r.base[len]); if (len % 16 == 15) { @@ -437,7 +437,7 @@ debug(const char *format, ...) { fflush(stdout); if (debugtiming) { TIME_NOW(&t); - fprintf(stderr, "%d.%06d: ", isc_time_seconds(&t), + fprintf(stderr, "%u.%06u: ", isc_time_seconds(&t), isc_time_nanoseconds(&t) / 1000); } va_start(args, format); @@ -3738,7 +3738,7 @@ recv_done(isc_task_t *task, isc_event_t *event) { */ if (l->comments) printf(";; BADVERS, retrying with EDNS version %u.\n", - newedns); + (unsigned int)newedns); l->edns = newedns; n = requeue_lookup(l, ISC_TRUE); if (l->trace && l->trace_root) diff --git a/bin/dig/host.c b/bin/dig/host.c index 13800472e1..950f9a1e56 100644 --- a/bin/dig/host.c +++ b/bin/dig/host.c @@ -169,7 +169,7 @@ host_shutdown(void) { } static void -received(int bytes, isc_sockaddr_t *from, dig_query_t *query) { +received(unsigned int bytes, isc_sockaddr_t *from, dig_query_t *query) { isc_time_t now; int diff; diff --git a/bin/dig/include/dig/dig.h b/bin/dig/include/dig/dig.h index 748a0a5ead..c132efd5d9 100644 --- a/bin/dig/include/dig/dig.h +++ b/bin/dig/include/dig/dig.h @@ -382,7 +382,7 @@ extern isc_result_t */ extern void -(*dighost_received)(int bytes, isc_sockaddr_t *from, dig_query_t *query); +(*dighost_received)(unsigned int bytes, isc_sockaddr_t *from, dig_query_t *query); /*%< * Print a message about where and when the response * was received from, like the final comment in the diff --git a/bin/dig/nslookup.c b/bin/dig/nslookup.c index 131c9d6b4f..66232bf06a 100644 --- a/bin/dig/nslookup.c +++ b/bin/dig/nslookup.c @@ -387,7 +387,7 @@ detailsection(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers, } static void -received(int bytes, isc_sockaddr_t *from, dig_query_t *query) +received(unsigned int bytes, isc_sockaddr_t *from, dig_query_t *query) { UNUSED(bytes); UNUSED(from); @@ -549,7 +549,7 @@ show_settings(isc_boolean_t full, isc_boolean_t serv_only) { printf(" %s\t\t%s\n", usesearch ? "search" : "nosearch", recurse ? "recurse" : "norecurse"); - printf(" timeout = %d\t\tretry = %d\tport = %d\tndots = %d\n", + printf(" timeout = %u\t\tretry = %d\tport = %u\tndots = %d\n", timeout, tries, port, ndots); printf(" querytype = %-8s\tclass = %s\n", deftype, defclass); printf(" srchlist = ");