2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 06:25:31 +00:00

Replace ISC_PRINT_QUADFORMAT with inttypes.h format constants

This commit is contained in:
Ondřej Surý
2018-03-28 14:56:40 +02:00
parent 9e493798c6
commit 64fe6bbaf2
31 changed files with 122 additions and 204 deletions

View File

@@ -15,6 +15,7 @@
#include <stdlib.h>
#include <time.h>
#include <ctype.h>
#include <inttypes.h>
#include <isc/app.h>
#include <isc/netaddr.h>
@@ -281,7 +282,7 @@ received(unsigned int bytes, isc_sockaddr_t *from, dig_query_t *query) {
#endif
if (query->lookup->doing_xfr) {
printf(";; XFR size: %u records (messages %u, "
"bytes %" ISC_PRINT_QUADFORMAT "u)\n",
"bytes %" PRIu64 ")\n",
query->rr_count, query->msg_count,
query->byte_count);
} else {
@@ -299,14 +300,14 @@ received(unsigned int bytes, isc_sockaddr_t *from, dig_query_t *query) {
} else if (query->lookup->identify && !short_form) {
diff = isc_time_microdiff(&query->time_recv, &query->time_sent);
if (query->lookup->use_usec)
printf(";; Received %" ISC_PRINT_QUADFORMAT "u bytes "
printf(";; Received %" PRIu64 " bytes "
"from %s(%s) in %ld us\n\n",
query->lookup->doing_xfr
? query->byte_count
: (isc_uint64_t)bytes,
fromtext, query->userarg, (long) diff);
else
printf(";; Received %" ISC_PRINT_QUADFORMAT "u bytes "
printf(";; Received %" PRIu64 " bytes "
"from %s(%s) in %ld ms\n\n",
query->lookup->doing_xfr
? query->byte_count
@@ -360,10 +361,11 @@ say_message(dns_rdata_t *rdata, dig_query_t *query, isc_buffer_t *buf) {
diff = isc_time_microdiff(&query->time_recv, &query->time_sent);
ADD_STRING(buf, " from server ");
ADD_STRING(buf, query->servname);
if (query->lookup->use_usec)
snprintf(store, sizeof(store), " in %" ISC_PLATFORM_QUADFORMAT "u us.", diff);
else
snprintf(store, sizeof(store), " in %" ISC_PLATFORM_QUADFORMAT "u ms.", diff / 1000);
if (query->lookup->use_usec) {
snprintf(store, sizeof(store), " in %" PRIu64 " us.", diff);
} else {
snprintf(store, sizeof(store), " in %" PRIu64 " ms.", diff / 1000);
}
ADD_STRING(buf, store);
}
ADD_STRING(buf, "\n");