Replace ISC_PRINT_QUADFORMAT with inttypes.h format constants
This commit is contained in:
+3
-2
@@ -16,6 +16,7 @@
|
||||
#include <ctype.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
#include <isc/app.h>
|
||||
#include <isc/backtrace.h>
|
||||
@@ -1102,8 +1103,8 @@ setup(void) {
|
||||
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
|
||||
NAMED_LOGMODULE_MAIN, ISC_LOG_NOTICE,
|
||||
"adjusted limit on open files from "
|
||||
"%" ISC_PRINT_QUADFORMAT "u to "
|
||||
"%" ISC_PRINT_QUADFORMAT "u",
|
||||
"%" PRIu64 " to "
|
||||
"%" PRIu64,
|
||||
old_openfiles, named_g_initopenfiles);
|
||||
}
|
||||
|
||||
|
||||
+9
-8
@@ -19,6 +19,7 @@
|
||||
#include <ctype.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
#include <isc/aes.h>
|
||||
#include <isc/app.h>
|
||||
@@ -3463,7 +3464,7 @@ configure_dnstap(const cfg_obj_t **maps, dns_view_t *view) {
|
||||
cfg_obj_log(obj2, named_g_lctx,
|
||||
ISC_LOG_WARNING,
|
||||
"'dnstap-output size "
|
||||
"%" ISC_PRINT_QUADFORMAT "u' "
|
||||
"%" PRIu64 "' "
|
||||
"is too large for this "
|
||||
"system; reducing to %lu",
|
||||
max_size, (unsigned long)SIZE_MAX);
|
||||
@@ -3890,7 +3891,7 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist,
|
||||
cfg_obj_log(obj, named_g_lctx,
|
||||
ISC_LOG_WARNING,
|
||||
"'max-cache-size "
|
||||
"%" ISC_PRINT_QUADFORMAT "u' "
|
||||
"%" PRIu64 "' "
|
||||
"is too large for this "
|
||||
"system; reducing to %lu",
|
||||
value, (unsigned long)SIZE_MAX);
|
||||
@@ -3914,8 +3915,8 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist,
|
||||
cfg_obj_log(obj, named_g_lctx,
|
||||
ISC_LOG_INFO,
|
||||
"'max-cache-size %d%%' "
|
||||
"- setting to %" ISC_PRINT_QUADFORMAT "uMB "
|
||||
"(out of %" ISC_PRINT_QUADFORMAT "uMB)",
|
||||
"- setting to %" PRIu64 "MB "
|
||||
"(out of %" PRIu64 "MB)",
|
||||
max_cache_size_percent,
|
||||
(isc_uint64_t)(max_cache_size / (1024*1024)),
|
||||
totalphys / (1024*1024));
|
||||
@@ -6791,7 +6792,7 @@ set_limit(const cfg_obj_t **maps, const char *configname,
|
||||
NAMED_LOGMODULE_SERVER,
|
||||
result == ISC_R_SUCCESS ?
|
||||
ISC_LOG_DEBUG(3) : ISC_LOG_WARNING,
|
||||
"set maximum %s to %" ISC_PRINT_QUADFORMAT "u: %s",
|
||||
"set maximum %s to %" PRIu64 ": %s",
|
||||
description, value, isc_result_totext(result));
|
||||
}
|
||||
|
||||
@@ -7242,7 +7243,7 @@ setup_newzones(dns_view_t *view, cfg_obj_t *config, cfg_obj_t *vconfig,
|
||||
cfg_obj_log(obj, named_g_lctx,
|
||||
ISC_LOG_ERROR,
|
||||
"'lmdb-mapsize "
|
||||
"%" ISC_PRINT_QUADFORMAT "d' "
|
||||
"%" PRId64 "' "
|
||||
"is too small",
|
||||
mapsize);
|
||||
return (ISC_R_FAILURE);
|
||||
@@ -7250,7 +7251,7 @@ setup_newzones(dns_view_t *view, cfg_obj_t *config, cfg_obj_t *vconfig,
|
||||
cfg_obj_log(obj, named_g_lctx,
|
||||
ISC_LOG_ERROR,
|
||||
"'lmdb-mapsize "
|
||||
"%" ISC_PRINT_QUADFORMAT "d' "
|
||||
"%" PRId64 "' "
|
||||
"is too large",
|
||||
mapsize);
|
||||
return (ISC_R_FAILURE);
|
||||
@@ -7971,7 +7972,7 @@ load_configuration(const char *filename, named_server_t *server,
|
||||
if (result == ISC_R_SUCCESS && (isc_resourcevalue_t)maxsocks > nfiles) {
|
||||
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
|
||||
NAMED_LOGMODULE_SERVER, ISC_LOG_WARNING,
|
||||
"max open files (%" ISC_PRINT_QUADFORMAT "u)"
|
||||
"max open files (%" PRIu64 ")"
|
||||
" is smaller than max sockets (%u)",
|
||||
nfiles, maxsocks);
|
||||
}
|
||||
|
||||
+13
-11
@@ -13,6 +13,8 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <inttypes.h>
|
||||
|
||||
#include <isc/buffer.h>
|
||||
#include <isc/httpd.h>
|
||||
#include <isc/json.h>
|
||||
@@ -1106,7 +1108,7 @@ dump_counters(isc_stats_t *stats, isc_statsformat_t type, void *arg,
|
||||
switch (dumparg.type) {
|
||||
case isc_statsformat_file:
|
||||
fp = arg;
|
||||
fprintf(fp, "%20" ISC_PRINT_QUADFORMAT "u %s\n",
|
||||
fprintf(fp, "%20" PRIu64 " %s\n",
|
||||
value, desc[idx]);
|
||||
break;
|
||||
case isc_statsformat_xml:
|
||||
@@ -1134,7 +1136,7 @@ dump_counters(isc_stats_t *stats, isc_statsformat_t type, void *arg,
|
||||
ISC_XMLCHAR
|
||||
"counter"));
|
||||
TRY0(xmlTextWriterWriteFormatString(writer,
|
||||
"%" ISC_PRINT_QUADFORMAT "u", value));
|
||||
"%" PRIu64, value));
|
||||
|
||||
TRY0(xmlTextWriterEndElement(writer));
|
||||
/* </counter> */
|
||||
@@ -1151,7 +1153,7 @@ dump_counters(isc_stats_t *stats, isc_statsformat_t type, void *arg,
|
||||
ISC_XMLCHAR
|
||||
desc[idx]));
|
||||
TRY0(xmlTextWriterWriteFormatString(writer,
|
||||
"%" ISC_PRINT_QUADFORMAT "u", value));
|
||||
"%" PRIu64, value));
|
||||
TRY0(xmlTextWriterEndElement(writer));
|
||||
/* counter */
|
||||
}
|
||||
@@ -1203,7 +1205,7 @@ rdtypestat_dump(dns_rdatastatstype_t type, isc_uint64_t val, void *arg) {
|
||||
switch (dumparg->type) {
|
||||
case isc_statsformat_file:
|
||||
fp = dumparg->arg;
|
||||
fprintf(fp, "%20" ISC_PRINT_QUADFORMAT "u %s\n", val, typestr);
|
||||
fprintf(fp, "%20" PRIu64 " %s\n", val, typestr);
|
||||
break;
|
||||
case isc_statsformat_xml:
|
||||
#ifdef HAVE_LIBXML2
|
||||
@@ -1215,7 +1217,7 @@ rdtypestat_dump(dns_rdatastatstype_t type, isc_uint64_t val, void *arg) {
|
||||
ISC_XMLCHAR typestr));
|
||||
|
||||
TRY0(xmlTextWriterWriteFormatString(writer,
|
||||
"%" ISC_PRINT_QUADFORMAT "u",
|
||||
"%" PRIu64,
|
||||
val));
|
||||
|
||||
TRY0(xmlTextWriterEndElement(writer)); /* type */
|
||||
@@ -1282,7 +1284,7 @@ rdatasetstats_dump(dns_rdatastatstype_t type, isc_uint64_t val, void *arg) {
|
||||
switch (dumparg->type) {
|
||||
case isc_statsformat_file:
|
||||
fp = dumparg->arg;
|
||||
fprintf(fp, "%20" ISC_PRINT_QUADFORMAT "u %s%s%s\n", val,
|
||||
fprintf(fp, "%20" PRIu64 " %s%s%s\n", val,
|
||||
stale ? "#" : "", nxrrset ? "!" : "", typestr);
|
||||
break;
|
||||
case isc_statsformat_xml:
|
||||
@@ -1298,7 +1300,7 @@ rdatasetstats_dump(dns_rdatastatstype_t type, isc_uint64_t val, void *arg) {
|
||||
|
||||
TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR "counter"));
|
||||
TRY0(xmlTextWriterWriteFormatString(writer,
|
||||
"%" ISC_PRINT_QUADFORMAT "u",
|
||||
"%" PRIu64,
|
||||
val));
|
||||
TRY0(xmlTextWriterEndElement(writer)); /* counter */
|
||||
|
||||
@@ -1349,7 +1351,7 @@ opcodestat_dump(dns_opcode_t code, isc_uint64_t val, void *arg) {
|
||||
switch (dumparg->type) {
|
||||
case isc_statsformat_file:
|
||||
fp = dumparg->arg;
|
||||
fprintf(fp, "%20" ISC_PRINT_QUADFORMAT "u %s\n", val, codebuf);
|
||||
fprintf(fp, "%20" PRIu64 " %s\n", val, codebuf);
|
||||
break;
|
||||
case isc_statsformat_xml:
|
||||
#ifdef HAVE_LIBXML2
|
||||
@@ -1358,7 +1360,7 @@ opcodestat_dump(dns_opcode_t code, isc_uint64_t val, void *arg) {
|
||||
TRY0(xmlTextWriterWriteAttribute(writer, ISC_XMLCHAR "name",
|
||||
ISC_XMLCHAR codebuf ));
|
||||
TRY0(xmlTextWriterWriteFormatString(writer,
|
||||
"%" ISC_PRINT_QUADFORMAT "u",
|
||||
"%" PRIu64,
|
||||
val));
|
||||
TRY0(xmlTextWriterEndElement(writer)); /* counter */
|
||||
#endif
|
||||
@@ -1406,7 +1408,7 @@ rcodestat_dump(dns_rcode_t code, isc_uint64_t val, void *arg) {
|
||||
switch (dumparg->type) {
|
||||
case isc_statsformat_file:
|
||||
fp = dumparg->arg;
|
||||
fprintf(fp, "%20" ISC_PRINT_QUADFORMAT "u %s\n", val, codebuf);
|
||||
fprintf(fp, "%20" PRIu64 " %s\n", val, codebuf);
|
||||
break;
|
||||
case isc_statsformat_xml:
|
||||
#ifdef HAVE_LIBXML2
|
||||
@@ -1415,7 +1417,7 @@ rcodestat_dump(dns_rcode_t code, isc_uint64_t val, void *arg) {
|
||||
TRY0(xmlTextWriterWriteAttribute(writer, ISC_XMLCHAR "name",
|
||||
ISC_XMLCHAR codebuf ));
|
||||
TRY0(xmlTextWriterWriteFormatString(writer,
|
||||
"%" ISC_PRINT_QUADFORMAT "u",
|
||||
"%" PRIu64,
|
||||
val));
|
||||
TRY0(xmlTextWriterEndElement(writer)); /* counter */
|
||||
#endif
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <inttypes.h>
|
||||
|
||||
#include <isc/buffer.h>
|
||||
#include <isc/file.h>
|
||||
#include <isc/mem.h>
|
||||
@@ -1272,7 +1274,7 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
|
||||
cfg_obj_log(obj, named_g_lctx,
|
||||
ISC_LOG_ERROR,
|
||||
"'max-journal-size "
|
||||
"%" ISC_PRINT_QUADFORMAT "d' "
|
||||
"%" PRId64 "' "
|
||||
"is too large",
|
||||
value);
|
||||
RETERR(ISC_R_RANGE);
|
||||
@@ -1405,7 +1407,7 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
|
||||
cfg_obj_log(obj, named_g_lctx,
|
||||
ISC_LOG_ERROR,
|
||||
"'max-journal-size "
|
||||
"%" ISC_PRINT_QUADFORMAT "d' "
|
||||
"%" PRId64 "' "
|
||||
"is too large",
|
||||
value);
|
||||
RETERR(ISC_R_RANGE);
|
||||
|
||||
Reference in New Issue
Block a user