]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Replace ISC_PRINT_QUADFORMAT with inttypes.h format constants
authorOndřej Surý <ondrej@sury.org>
Wed, 28 Mar 2018 12:56:40 +0000 (14:56 +0200)
committerOndřej Surý <ondrej@sury.org>
Fri, 10 Aug 2018 13:20:57 +0000 (15:20 +0200)
(cherry picked from commit 64fe6bbaf2019f444475dfbf744eb6ea4e619c19)
(cherry picked from commit c863a076aea3cc899e8462a1bbf72b54a84dded4)

35 files changed:
bin/dig/dig.c
bin/named/main.c
bin/named/server.c
bin/named/statschannel.c
bin/named/update.c
bin/named/zoneconf.c
configure
configure.in
contrib/dnsperf-2.1.0.0-1/dnsperf.c
contrib/dnsperf-2.1.0.0-1/resperf.c
lib/bind9/check.c
lib/dns/badcache.c
lib/dns/cache.c
lib/dns/journal.c
lib/dns/rbt.c
lib/dns/rbtdb.c
lib/dns/resolver.c
lib/dns/rpz.c
lib/dns/tests/rbt_serialize_test.c
lib/dns/tests/rbt_test.c
lib/dns/tests/tsig_test.c
lib/dns/xfrin.c
lib/isc/buffer.c
lib/isc/include/isc/platform.h.in
lib/isc/include/isc/print.h
lib/isc/mem.c
lib/isc/tests/atomic_test.c
lib/isc/tests/hash_test.c
lib/isc/tests/print_test.c
lib/isc/tests/task_test.c
lib/isc/unix/socket.c
lib/isc/win32/include/isc/platform.h.in
lib/isccfg/parser.c
lib/lwres/include/lwres/platform.h.in
lib/lwres/print.c

index d4808ada67b90299fe233c11069dde261852fe8f..25e000d29a6d90bad17ca97536c022f92eff1be4 100644 (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>
@@ -286,7 +287,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 {
@@ -304,14 +305,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 (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
@@ -366,9 +367,9 @@ say_message(dns_rdata_t *rdata, dig_query_t *query, isc_buffer_t *buf) {
                ADD_STRING(buf, " from server ");
                ADD_STRING(buf, query->servname);
                if (use_usec)
-                       snprintf(store, sizeof(store), " in %" ISC_PLATFORM_QUADFORMAT "u us.", diff);
+                       snprintf(store, sizeof(store), " in %" PRIu64 " us.", diff);
                else
-                       snprintf(store, sizeof(store), " in %" ISC_PLATFORM_QUADFORMAT "u ms.", diff / 1000);
+                       snprintf(store, sizeof(store), " in %" PRIu64 " ms.", diff / 1000);
                ADD_STRING(buf, store);
        }
        ADD_STRING(buf, "\n");
index bb639d98c695b9282a17e55d5a0a4bc921ece48c..84d4c2fd47e3b04b5a6ded87c045684a9a2b4d5a 100644 (file)
@@ -16,6 +16,7 @@
 #include <ctype.h>
 #include <stdlib.h>
 #include <string.h>
+#include <inttypes.h>
 
 #include <isc/app.h>
 #include <isc/backtrace.h>
@@ -1201,8 +1202,8 @@ setup(void) {
                isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL,
                              NS_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, ns_g_initopenfiles);
        }
 
index f71f75c2db17a289de6abbb810689c287872402b..b89bd8f5c73501431f9258281798336796131d4c 100644 (file)
@@ -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>
@@ -3362,7 +3363,7 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist,
                                cfg_obj_log(obj, ns_g_lctx,
                                            ISC_LOG_WARNING,
                                            "'max-acache-size "
-                                           "%" ISC_PRINT_QUADFORMAT "u' "
+                                           "%" PRIu64 "' "
                                            "is too large for this "
                                            "system; reducing to %lu",
                                            value, (unsigned long)SIZE_MAX);
@@ -3511,7 +3512,7 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist,
                        cfg_obj_log(obj, ns_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);
@@ -3535,8 +3536,8 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist,
                        cfg_obj_log(obj, ns_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));
@@ -6375,7 +6376,7 @@ set_limit(const cfg_obj_t **maps, const char *configname,
        isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_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));
 }
 
@@ -6799,7 +6800,7 @@ setup_newzones(dns_view_t *view, cfg_obj_t *config, cfg_obj_t *vconfig,
                        cfg_obj_log(obj, ns_g_lctx,
                                    ISC_LOG_ERROR,
                                    "'lmdb-mapsize "
-                                   "%" ISC_PRINT_QUADFORMAT "d' "
+                                   "%" PRId64 "' "
                                    "is too small",
                                    mapsize);
                        return (ISC_R_FAILURE);
@@ -6807,7 +6808,7 @@ setup_newzones(dns_view_t *view, cfg_obj_t *config, cfg_obj_t *vconfig,
                        cfg_obj_log(obj, ns_g_lctx,
                                    ISC_LOG_ERROR,
                                    "'lmdb-mapsize "
-                                   "%" ISC_PRINT_QUADFORMAT "d' "
+                                   "%" PRId64 "' "
                                    "is too large",
                                    mapsize);
                        return (ISC_R_FAILURE);
@@ -7548,7 +7549,7 @@ load_configuration(const char *filename, ns_server_t *server,
        if (result == ISC_R_SUCCESS && (isc_resourcevalue_t)maxsocks > nfiles) {
                isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL,
                              NS_LOGMODULE_SERVER, ISC_LOG_WARNING,
-                             "max open files (%" ISC_PRINT_QUADFORMAT "u)"
+                             "max open files (%" PRIu64 ")"
                              " is smaller than max sockets (%u)",
                              nfiles, maxsocks);
        }
index 4511ec196a7a890844106b6cf52da42abc0c4cb7..50419940960c5d699bd82e57151542ef3d6175eb 100644 (file)
@@ -13,6 +13,8 @@
 
 #include <config.h>
 
+#include <inttypes.h>
+
 #include <isc/buffer.h>
 #include <isc/httpd.h>
 #include <isc/json.h>
@@ -1058,7 +1060,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:
@@ -1086,7 +1088,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> */
@@ -1103,7 +1105,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 */
                        }
@@ -1154,7 +1156,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
@@ -1166,7 +1168,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 */
@@ -1232,7 +1234,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:
@@ -1248,7 +1250,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 */
 
@@ -1298,7 +1300,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
@@ -1307,7 +1309,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
@@ -1354,7 +1356,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
@@ -1363,7 +1365,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
index fa8af62435dbe13f68f6c763ad2edb886cde8605..63e3dc47387479b5b87c2d1f9c784e08f76e6f5e 100644 (file)
@@ -11,6 +11,8 @@
 
 #include <config.h>
 
+#include <inttypes.h>
+
 #include <isc/netaddr.h>
 #include <isc/print.h>
 #include <isc/serial.h>
@@ -3189,8 +3191,8 @@ update_action(isc_task_t *task, isc_event_t *event) {
                        if (result == ISC_R_SUCCESS && records > maxrecords) {
                                update_log(client, zone, ISC_LOG_ERROR,
                                           "records in zone (%"
-                                          ISC_PRINT_QUADFORMAT
-                                          "u) exceeds max-records (%u)",
+                                          PRIu64
+                                          ") exceeds max-records (%u)",
                                           records, maxrecords);
                                result = DNS_R_TOOMANYRECORDS;
                                goto failure;
index 9bf5bfec2a5ef1ff38ae7f177420dbb8b800c4bd..89deff3d6e28e1d80e6e49545f09be7652e0ffff 100644 (file)
@@ -11,6 +11,8 @@
 
 #include <config.h>
 
+#include <inttypes.h>
+
 #include <isc/buffer.h>
 #include <isc/file.h>
 #include <isc/mem.h>
@@ -1195,7 +1197,7 @@ ns_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
                                cfg_obj_log(obj, ns_g_lctx,
                                            ISC_LOG_ERROR,
                                            "'max-journal-size "
-                                           "%" ISC_PRINT_QUADFORMAT "d' "
+                                           "%" PRId64 "' "
                                            "is too large",
                                            value);
                                RETERR(ISC_R_RANGE);
@@ -1315,7 +1317,7 @@ ns_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
                                cfg_obj_log(obj, ns_g_lctx,
                                            ISC_LOG_ERROR,
                                            "'max-journal-size "
-                                           "%" ISC_PRINT_QUADFORMAT "d' "
+                                           "%" PRId64 "' "
                                            "is too large",
                                            value);
                                RETERR(ISC_R_RANGE);
index 3460ddf14948f4529204b62ea6706aed07f9312f..1a1631e54c0c0d5b2a671819c46c63d864b5dca3 100755 (executable)
--- a/configure
+++ b/configure
@@ -732,8 +732,6 @@ ISC_PLATFORM_USEDECLSPEC
 ISC_PLATFORM_RLIMITTYPE
 ISC_PLATFORM_HAVESTATNSEC
 ISC_PLATFORM_HAVESYSUNH
-LWRES_PLATFORM_QUADFORMAT
-ISC_PLATFORM_QUADFORMAT
 DST_EXTRA_SRCS
 DST_EXTRA_OBJS
 USE_ISC_SPNEGO
 
 
 
-# Determine the printf format characters to use when printing
-# values of type isc_int64_t. This will normally be "ll", but where
-# the compiler treats "long long" as a alias for "long" and printf
-# doesn't know about "long long" use "l".  Hopefully the sprintf
-# will produce a inconsistent result in the later case.  If the compiler
-# fails due to seeing "%lld" we fall back to "l".
-#
-# Digital Unix 4.0 (gcc?) (long long) is 64 bits as is its long. It uses
-# %ld even for (long long)/
-#
-# Win32 uses "%I64d", but that's defined elsewhere since we don't use
-# configure on Win32.
-#
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking printf format modifier for 64-bit integers" >&5
-$as_echo_n "checking printf format modifier for 64-bit integers... " >&6; }
-if test "$cross_compiling" = yes; then :
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: assuming target platform uses ll" >&5
-$as_echo "assuming target platform uses ll" >&6; }
-       ISC_PLATFORM_QUADFORMAT='#define ISC_PLATFORM_QUADFORMAT "ll"'
-       LWRES_PLATFORM_QUADFORMAT='#define LWRES_PLATFORM_QUADFORMAT "ll"'
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-#include <stdio.h>
-main() {
-       long long int j = 0;
-       char buf[100];
-       buf[0] = 0;
-       sprintf(buf, "%lld", j);
-       exit((sizeof(long long int) != sizeof(long int))? 0 :
-            (strcmp(buf, "0") != 0));
-}
-
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ll" >&5
-$as_echo "ll" >&6; }
-       ISC_PLATFORM_QUADFORMAT='#define ISC_PLATFORM_QUADFORMAT "ll"'
-       LWRES_PLATFORM_QUADFORMAT='#define LWRES_PLATFORM_QUADFORMAT "ll"'
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: l" >&5
-$as_echo "l" >&6; }
-       ISC_PLATFORM_QUADFORMAT='#define ISC_PLATFORM_QUADFORMAT "l"'
-       LWRES_PLATFORM_QUADFORMAT='#define LWRES_PLATFORM_QUADFORMAT "l"'
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-
-
-
-
 #
 # Security Stuff
 #
index d80c2b8b5c86e372ee247780a3b563ad44f75dd9..641bb5ea7bb4b784787d683846c8ebeb378e0d6f 100644 (file)
@@ -29,7 +29,7 @@ case $build_os in
 sunos*)
     # Just set the maximum command line length for sunos as it otherwise
     # takes a exceptionally long time to work it out. Required for libtool.
-     
+
     lt_cv_sys_max_cmd_len=4096;
     ;;
 esac
@@ -149,7 +149,7 @@ case "$enable_seccomp" in
                                        return 1;
                                }
                        }
-                       ret = 
+                       ret =
                        prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, NULL, 0, 0);
                        if (ret < 0) {
                                switch (errno) {
@@ -164,8 +164,8 @@ case "$enable_seccomp" in
        return 1;
        }
        ]
-       , AC_DEFINE([HAVE_LIBSECCOMP], 1, 
-       [Define to use libseccomp system call filtering.])   
+       , AC_DEFINE([HAVE_LIBSECCOMP], 1,
+       [Define to use libseccomp system call filtering.])
        , []
        )
        fi
@@ -960,7 +960,7 @@ case "$use_gssapi" in
                DNS_GSSAPI_LIBS="-framework Kerberos"
                AC_MSG_RESULT(framework)
                ;;
-               
+
        *)
                AC_MSG_RESULT(looking in $use_gssapi/lib)
                USE_GSSAPI='-DGSSAPI'
@@ -1144,7 +1144,7 @@ case "$use_randomdev" in
                AC_CHECK_FILE($devrandom,
                              AC_DEFINE_UNQUOTED(PATH_RANDOMDEV,
                                                 "$devrandom"),)
-                             
+
                ;;
        yes)
                AC_MSG_ERROR([--with-randomdev must specify a path])
@@ -1923,7 +1923,7 @@ int main() {
                yes)
                        AC_DEFINE(HAVE_OPENSSL_ED448, 1,
                                  [Define if your OpenSSL version supports Ed448.])
-                       ;;         
+                       ;;
                *)
                        ;;
                esac
@@ -1968,7 +1968,7 @@ int main() {
                        ISC_OPENSSL_INC="$DST_OPENSSL_INC"
                        ISC_OPENSSL_LIBS="$DST_OPENSSL_LIBS"
                        ;;
-               yes)    
+               yes)
                        AC_DEFINE(HAVE_OPENSSL_AES, 1,
                                  [Define if your OpenSSL version supports AES])
                        ISC_OPENSSL_INC="$DST_OPENSSL_INC"
@@ -2629,7 +2629,7 @@ AC_CHECK_LIB(scf, smf_enable_instance)
 AC_CHECK_FUNC(flockfile, AC_DEFINE(HAVE_FLOCKFILE),)
 AC_CHECK_FUNC(getc_unlocked, AC_DEFINE(HAVE_GETCUNLOCKED),)
 
-# 
+#
 # Indicate what the final decision was regarding threads.
 #
 AC_MSG_CHECKING(whether to build with threads)
@@ -2639,7 +2639,7 @@ else
        AC_MSG_RESULT(no)
 fi
 
-# 
+#
 # End of pthreads stuff.
 #
 
@@ -3254,7 +3254,7 @@ AC_TRY_RUN([
 #include <netinet/in.h>
 #include <arpa/inet.h>
 main() { char a[16]; return (inet_pton(AF_INET, "1.2.3", a) == 1 ? 1 :
-                            inet_pton(AF_INET, "1.2.3.04", a) == 1 ? 1 : 
+                            inet_pton(AF_INET, "1.2.3.04", a) == 1 ? 1 :
                             (inet_pton(AF_INET6, "::1.2.3.4", a) != 1)); }],
        [AC_MSG_RESULT(yes)
        ISC_PLATFORM_NEEDPTON="#undef ISC_PLATFORM_NEEDPTON"],
@@ -3545,7 +3545,7 @@ AC_ARG_ENABLE(getifaddrs,
 # This interface iteration code for getifaddrs() will fall back to using
 # /proc/net/if_inet6 if getifaddrs() in glibc doesn't return any IPv6
 # addresses.
-# 
+#
 case $want_getifaddrs in
 glibc)
 AC_MSG_WARN("--enable-getifaddrs=glibc is no longer required")
@@ -3779,44 +3779,6 @@ AC_SUBST(USE_ISC_SPNEGO)
 AC_SUBST(DST_EXTRA_OBJS)
 AC_SUBST(DST_EXTRA_SRCS)
 
-# Determine the printf format characters to use when printing
-# values of type isc_int64_t. This will normally be "ll", but where
-# the compiler treats "long long" as a alias for "long" and printf
-# doesn't know about "long long" use "l".  Hopefully the sprintf
-# will produce a inconsistent result in the later case.  If the compiler
-# fails due to seeing "%lld" we fall back to "l".
-#
-# Digital Unix 4.0 (gcc?) (long long) is 64 bits as is its long. It uses
-# %ld even for (long long)/
-#
-# Win32 uses "%I64d", but that's defined elsewhere since we don't use
-# configure on Win32.
-#
-AC_MSG_CHECKING(printf format modifier for 64-bit integers)
-AC_TRY_RUN([
-#include <stdio.h>
-main() {
-       long long int j = 0;
-       char buf[100];
-       buf[0] = 0;
-       sprintf(buf, "%lld", j);
-       exit((sizeof(long long int) != sizeof(long int))? 0 :
-            (strcmp(buf, "0") != 0));
-} 
-],
-       [AC_MSG_RESULT(ll)
-       ISC_PLATFORM_QUADFORMAT='#define ISC_PLATFORM_QUADFORMAT "ll"'
-       LWRES_PLATFORM_QUADFORMAT='#define LWRES_PLATFORM_QUADFORMAT "ll"'],
-       [AC_MSG_RESULT(l)
-       ISC_PLATFORM_QUADFORMAT='#define ISC_PLATFORM_QUADFORMAT "l"'
-       LWRES_PLATFORM_QUADFORMAT='#define LWRES_PLATFORM_QUADFORMAT "l"'],
-       [AC_MSG_RESULT(assuming target platform uses ll)
-       ISC_PLATFORM_QUADFORMAT='#define ISC_PLATFORM_QUADFORMAT "ll"'
-       LWRES_PLATFORM_QUADFORMAT='#define LWRES_PLATFORM_QUADFORMAT "ll"'])
-AC_SUBST(ISC_PLATFORM_QUADFORMAT)
-AC_SUBST(LWRES_PLATFORM_QUADFORMAT)
-
-
 #
 # Security Stuff
 #
@@ -4250,7 +4212,7 @@ if test "yes" = "$have_atomic"; then
        else
                case "$host" in
                alpha*-dec-osf*)
-                       # Tru64 compiler has its own syntax for inline 
+                       # Tru64 compiler has its own syntax for inline
                        # assembly.
                        AC_TRY_COMPILE(, [
 #ifndef __DECC
@@ -4655,11 +4617,11 @@ AC_SUBST(CURL)
 #   NOM_PATH_FILE(VARIABLE, FILENAME, DIRECTORIES)
 #
 # If the file FILENAME is found in one of the DIRECTORIES, the shell
-# variable VARIABLE is defined to its absolute pathname.  Otherwise, 
+# variable VARIABLE is defined to its absolute pathname.  Otherwise,
 # it is set to FILENAME, with no directory prefix (that's not terribly
 # useful, but looks less confusing in substitutions than leaving it
 # empty).  The variable VARIABLE will be substituted into output files.
-# 
+#
 
 AC_DEFUN(NOM_PATH_FILE, [
 $1=""
@@ -5065,7 +5027,7 @@ DLZ_SYSTEM_TEST=""
 DLZ_DRIVER_MYSQL_INCLUDES=""
 DLZ_DRIVER_MYSQL_LIBS=""
 
-# 
+#
 # Configure support for building a shared library object
 #
 # Even when libtool is available it can't always be relied upon
@@ -5214,8 +5176,8 @@ if test "yes" = "$cross_compiling"; then
        BUILD_LDFLAGS="$BUILD_LDFLAGS"
        BUILD_LIBS="$BUILD_LIBS"
 else
-       BUILD_CC="$CC" 
-       BUILD_CFLAGS="$CFLAGS" 
+       BUILD_CC="$CC"
+       BUILD_CFLAGS="$CFLAGS"
        BUILD_CPPFLAGS="$CPPFLAGS $GEN_NEED_OPTARG"
        BUILD_LDFLAGS="$LDFLAGS"
        BUILD_LIBS="$LIBS"
@@ -5543,7 +5505,7 @@ report() {
        echo "        Algorithm: $with_cc_alg"
     fi
 
-    # these lines are only printed if run with --enable-full-report 
+    # these lines are only printed if run with --enable-full-report
     if test "yes" = "$enable_full_report"; then
        test "no" = "$enable_ipv6" -o "no" = "$found_ipv6" || \
            echo "    IPv6 support (--enable-ipv6)"
@@ -5679,7 +5641,7 @@ if test "yes" != "$silent"; then
 fi
 
 if test "X$CRYPTO" = "X"; then
-cat << \EOF                                                             
+cat << \EOF
 BIND 9 is being built without cryptography support. This means it will
 not have DNSSEC support. Use --with-openssl, or --with-pkcs11 and
 --enable-native-pkcs11 to enable cryptography.
index 67c5fc3ddb72374e4fca9c318dd857e3e1ba4bef..ba84de1a51a84053e7b29be83841a46ca6f13796 100644 (file)
@@ -36,6 +36,8 @@
  ***   DNS Performance Testing Tool
  ***/
 
+#include <inttypes.h>
+
 #include <errno.h>
 #include <math.h>
 #include <pthread.h>
@@ -278,16 +280,16 @@ print_statistics(const config_t *config, const times_t *times, stats_t *stats)
 
        printf("Statistics:\n\n");
 
-       printf("  %s sent:         %" ISC_PRINT_QUADFORMAT "u\n",
+       printf("  %s sent:         %" PRIu64 "\n",
                units, stats->num_sent);
-       printf("  %s completed:    %" ISC_PRINT_QUADFORMAT "u (%.2lf%%)\n",
+       printf("  %s completed:    %" PRIu64 " (%.2lf%%)\n",
               units, stats->num_completed,
               SAFE_DIV(100.0 * stats->num_completed, stats->num_sent));
-       printf("  %s lost:         %" ISC_PRINT_QUADFORMAT "u (%.2lf%%)\n",
+       printf("  %s lost:         %" PRIu64 " (%.2lf%%)\n",
               units, stats->num_timedout,
               SAFE_DIV(100.0 * stats->num_timedout, stats->num_sent));
        if (stats->num_interrupted > 0)
-               printf("  %s interrupted:  %" ISC_PRINT_QUADFORMAT "u "
+               printf("  %s interrupted:  %" PRIu64 " "
                        "(%.2lf%%)\n",
                       units, stats->num_interrupted,
                       SAFE_DIV(100.0 * stats->num_interrupted,
@@ -303,7 +305,7 @@ print_statistics(const config_t *config, const times_t *times, stats_t *stats)
                        first_rcode = ISC_FALSE;
                else
                        printf(", ");
-               printf("%s %" ISC_PRINT_QUADFORMAT "u (%.2lf%%)",
+               printf("%s %" PRIu64 " (%.2lf%%)",
                       perf_dns_rcode_strings[i], stats->rcodecounts[i],
                       (stats->rcodecounts[i] * 100.0) / stats->num_completed);
        }
index e94528e8025c0fbedc91c6ff81388c83b1624e76..7744d32d651f55225c0e85122fe0f3067f9c21f2 100644 (file)
@@ -41,6 +41,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
+#include <inttypes.h>
 
 #include <sys/time.h>
 
@@ -387,11 +388,11 @@ print_statistics(void) {
 
        printf("\nStatistics:\n\n");
 
-       printf("  Queries sent:         %" ISC_PRINT_QUADFORMAT "u\n",
+       printf("  Queries sent:         %" PRIu64 "\n",
                num_queries_sent);
-       printf("  Queries completed:    %" ISC_PRINT_QUADFORMAT "u\n",
+       printf("  Queries completed:    %" PRIu64 "\n",
                num_responses_received);
-       printf("  Queries lost:         %" ISC_PRINT_QUADFORMAT "u\n",
+       printf("  Queries lost:         %" PRIu64 "\n",
               num_queries_sent - num_responses_received);
        printf("  Response codes:       ");
        first_rcode = ISC_TRUE;
@@ -402,7 +403,7 @@ print_statistics(void) {
                        first_rcode = ISC_FALSE;
                else
                        printf(", ");
-               printf("%s %" ISC_PRINT_QUADFORMAT "u (%.2lf%%)",
+               printf("%s %" PRIu64 " (%.2lf%%)",
                       perf_dns_rcode_strings[i], rcodecounts[i],
                       (rcodecounts[i] * 100.0) / num_responses_received);
        }
index 3da83a7ae2169c825c10e6f35694081ca6a10982..c89f3a0f5d2430c23644814585c2b1e40fcfcebb 100644 (file)
@@ -14,6 +14,7 @@
 #include <config.h>
 
 #include <stdlib.h>
+#include <inttypes.h>
 
 #include <isc/aes.h>
 #include <isc/base64.h>
@@ -1488,7 +1489,7 @@ check_options(const cfg_obj_t *options, isc_log_t *logctx, isc_mem_t *mctx,
                        cfg_obj_log(obj, logctx,
                                    ISC_LOG_ERROR,
                                    "'lmdb-mapsize "
-                                   "%" ISC_PRINT_QUADFORMAT "d' "
+                                   "%" PRId64 "' "
                                    "is too small",
                                    mapsize);
                        return (ISC_R_RANGE);
@@ -1496,7 +1497,7 @@ check_options(const cfg_obj_t *options, isc_log_t *logctx, isc_mem_t *mctx,
                        cfg_obj_log(obj, logctx,
                                    ISC_LOG_ERROR,
                                    "'lmdb-mapsize "
-                                   "%" ISC_PRINT_QUADFORMAT "d' "
+                                   "%" PRId64 "' "
                                    "is too large",
                                    mapsize);
                        return (ISC_R_RANGE);
index 2aa55c211048cc47212cfcafd27fc4e4bf8c5f4b..8923d3f0e1f30932643a3648b996fa7ea3665556 100644 (file)
@@ -13,6 +13,8 @@
 
 #include <config.h>
 
+#include <inttypes.h>
+
 #include <isc/buffer.h>
 #include <isc/log.h>
 #include <isc/hash.h>
@@ -429,7 +431,7 @@ dns_badcache_print(dns_badcache_t *bc, const char *cachename, FILE *fp) {
                        t = isc_time_microdiff(&bad->expire, &now);
                        t /= 1000;
                        fprintf(fp, "; %s/%s [ttl "
-                               "%" ISC_PLATFORM_QUADFORMAT "u]\n",
+                               "%" PRIu64 "]\n",
                                namebuf, typebuf, t);
                }
        }
index 85d037d922b0a4132bd9c8f32b69beaa7c0b401e..b1197c0d9e1f38185d7c9b4452e583f9dfc59612 100644 (file)
@@ -14,6 +14,8 @@
 
 #include <config.h>
 
+#include <inttypes.h>
+
 #include <isc/json.h>
 #include <isc/mem.h>
 #include <isc/print.h>
@@ -1388,47 +1390,47 @@ dns_cache_dumpstats(dns_cache_t *cache, FILE *fp) {
        getcounters(cache->stats, isc_statsformat_file,
                    dns_cachestatscounter_max, indices, values);
 
-       fprintf(fp, "%20" ISC_PRINT_QUADFORMAT "u %s\n",
+       fprintf(fp, "%20" PRIu64 " %s\n",
                values[dns_cachestatscounter_hits],
                "cache hits");
-       fprintf(fp, "%20" ISC_PRINT_QUADFORMAT "u %s\n",
+       fprintf(fp, "%20" PRIu64 " %s\n",
                values[dns_cachestatscounter_misses],
                "cache misses");
-       fprintf(fp, "%20" ISC_PRINT_QUADFORMAT "u %s\n",
+       fprintf(fp, "%20" PRIu64 " %s\n",
                values[dns_cachestatscounter_queryhits],
                "cache hits (from query)");
-       fprintf(fp, "%20" ISC_PRINT_QUADFORMAT "u %s\n",
+       fprintf(fp, "%20" PRIu64 " %s\n",
                values[dns_cachestatscounter_querymisses],
                "cache misses (from query)");
-       fprintf(fp, "%20" ISC_PRINT_QUADFORMAT "u %s\n",
+       fprintf(fp, "%20" PRIu64 " %s\n",
                values[dns_cachestatscounter_deletelru],
                "cache records deleted due to memory exhaustion");
-       fprintf(fp, "%20" ISC_PRINT_QUADFORMAT "u %s\n",
+       fprintf(fp, "%20" PRIu64 " %s\n",
                values[dns_cachestatscounter_deletettl],
                "cache records deleted due to TTL expiration");
        fprintf(fp, "%20u %s\n", dns_db_nodecount(cache->db),
                "cache database nodes");
-       fprintf(fp, "%20" ISC_PLATFORM_QUADFORMAT "u %s\n",
+       fprintf(fp, "%20" PRIu64 " %s\n",
                (isc_uint64_t) dns_db_hashsize(cache->db),
                "cache database hash buckets");
 
-       fprintf(fp, "%20" ISC_PLATFORM_QUADFORMAT "u %s\n",
+       fprintf(fp, "%20" PRIu64 " %s\n",
                (isc_uint64_t) isc_mem_total(cache->mctx),
                "cache tree memory total");
-       fprintf(fp, "%20" ISC_PLATFORM_QUADFORMAT "u %s\n",
+       fprintf(fp, "%20" PRIu64 " %s\n",
                (isc_uint64_t) isc_mem_inuse(cache->mctx),
                "cache tree memory in use");
-       fprintf(fp, "%20" ISC_PLATFORM_QUADFORMAT "u %s\n",
+       fprintf(fp, "%20" PRIu64 " %s\n",
                (isc_uint64_t) isc_mem_maxinuse(cache->mctx),
                "cache tree highest memory in use");
 
-       fprintf(fp, "%20" ISC_PLATFORM_QUADFORMAT "u %s\n",
+       fprintf(fp, "%20" PRIu64 " %s\n",
                (isc_uint64_t) isc_mem_total(cache->hmctx),
                "cache heap memory total");
-       fprintf(fp, "%20" ISC_PLATFORM_QUADFORMAT "u %s\n",
+       fprintf(fp, "%20" PRIu64 " %s\n",
                (isc_uint64_t) isc_mem_inuse(cache->hmctx),
                "cache heap memory in use");
-       fprintf(fp, "%20" ISC_PLATFORM_QUADFORMAT "u %s\n",
+       fprintf(fp, "%20" PRIu64 " %s\n",
                (isc_uint64_t) isc_mem_maxinuse(cache->hmctx),
                "cache heap highest memory in use");
 }
@@ -1443,7 +1445,7 @@ renderstat(const char *name, isc_uint64_t value, xmlTextWriterPtr writer) {
        TRY0(xmlTextWriterWriteAttribute(writer,
                                         ISC_XMLCHAR "name", ISC_XMLCHAR name));
        TRY0(xmlTextWriterWriteFormatString(writer,
-                                           "%" ISC_PRINT_QUADFORMAT "u",
+                                           "%" PRIu64,
                                            value));
        TRY0(xmlTextWriterEndElement(writer)); /* counter */
 
index e44efc9598fbcc77fbe889a005d7d64d11a15b94..cca77ce843fedd46fe14d562beadbe3135863cea 100644 (file)
@@ -1043,8 +1043,8 @@ dns_journal_writediff(dns_journal_t *j, dns_diff_t *diff) {
        if (size >= ISC_INT32_MAX) {
                isc_log_write(JOURNAL_COMMON_LOGARGS, ISC_LOG_ERROR,
                              "dns_journal_writediff: %s: journal entry "
-                             "too big to be stored: %llu bytes", j->filename,
-                             size);
+                             "too big to be stored: %" PRIu64 " bytes",
+                             j->filename, size);
                return (ISC_R_NOSPACE);
        }
 
@@ -1158,7 +1158,7 @@ dns_journal_commit(dns_journal_t *j) {
        if (total >= ISC_INT32_MAX) {
                isc_log_write(JOURNAL_COMMON_LOGARGS, ISC_LOG_ERROR,
                             "transaction too big to be stored in journal: "
-                            "%llub (max is %llub)", total,
+                            "%" PRIu64 "b (max is %" PRIu64 "b)", total,
                             (isc_uint64_t)ISC_INT32_MAX);
                return (ISC_R_UNEXPECTED);
        }
index 49ed2d6fe3d79ac54f4748bd28881d0fad1b0f4c..a71e30f1abc95ea06644dec605fc5760f8c337d8 100644 (file)
@@ -14,9 +14,7 @@
 #include <config.h>
 
 #include <sys/stat.h>
-#ifdef HAVE_INTTYPES_H
 #include <inttypes.h> /* uintptr_t */
-#endif
 
 #include <isc/crc64.h>
 #include <isc/file.h>
index 7d9329a57e9101d850ada3446f8cc4438bd619d7..332f3e31fadbbeb6d31ad354283bcf75f7ea958c 100644 (file)
@@ -15,9 +15,7 @@
 
 /* #define inline */
 
-#ifdef HAVE_INTTYPES_H
-#include <inttypes.h> /* uintptr_t */
-#endif
+#include <inttypes.h>
 
 #include <isc/crc64.h>
 #include <isc/event.h>
index 41d1385f97b90ce41fa01ab3b6e7b1c97bd1aee9..72cbc574ba763bcdc4d86630e94ee6a4db7e20cb 100644 (file)
@@ -13,6 +13,7 @@
 
 #include <config.h>
 #include <ctype.h>
+#include <inttypes.h>
 
 #include <isc/counter.h>
 #include <isc/log.h>
@@ -9664,8 +9665,8 @@ dns_resolver_logfetch(dns_fetch_t *fetch, isc_log_t *lctx,
                dns_name_format(&fctx->domain, domainbuf, sizeof(domainbuf));
                isc_log_write(lctx, category, module, level,
                              "fetch completed at %s:%d for %s in "
-                             "%" ISC_PRINT_QUADFORMAT "u."
-                             "%06" ISC_PRINT_QUADFORMAT "u: %s/%s "
+                             "%" PRIu64 "."
+                             "%06" PRIu64 ": %s/%s "
                              "[domain:%s,referral:%u,restart:%u,qrysent:%u,"
                              "timeout:%u,lame:%u,quota:%u,neterr:%u,"
                              "badresp:%u,adberr:%u,findfail:%u,valfail:%u]",
index ca5b5d60100358fa581a30d790156717854fb032..3fe35a78095afa8b705e8bd0eaaaf3fe23ac1fb5 100644 (file)
@@ -13,6 +13,8 @@
 
 #include <config.h>
 
+#include <inttypes.h>
+
 #include <isc/buffer.h>
 #include <isc/mem.h>
 #include <isc/net.h>
@@ -536,7 +538,7 @@ fix_qname_skip_recurse(dns_rpz_zones_t *rpzs) {
  set:
        isc_log_write(dns_lctx, DNS_LOGCATEGORY_RPZ, DNS_LOGMODULE_RBTDB,
                      DNS_RPZ_DEBUG_QUIET,
-                     "computed RPZ qname_skip_recurse mask=0x%llx",
+                     "computed RPZ qname_skip_recurse mask=0x%" PRIx64,
                      (isc_uint64_t) mask);
        rpzs->have.qname_skip_recurse = mask;
 }
index 11923f8639e0b1e35778225e9d8e61c41e2d1231..57db837aa18e36b1e4ed5f557e106e2217a25217 100644 (file)
@@ -22,9 +22,7 @@
 #include <unistd.h>
 #include <sys/mman.h>
 
-#ifdef HAVE_INTTYPES_H
 #include <inttypes.h> /* uintptr_t */
-#endif
 
 #include <dns/rbt.h>
 #include <dns/fixedname.h>
index cfcf8f9614c2e547a63f785a26a123e56070c6e9..cdd408b6c85323b671ae14be79fb46073c0ea785 100644 (file)
@@ -19,9 +19,7 @@
 #include <fcntl.h>
 #include <unistd.h>
 
-#ifdef HAVE_INTTYPES_H
 #include <inttypes.h> /* uintptr_t */
-#endif
 
 #include <dns/rbt.h>
 #include <dns/fixedname.h>
index ee025c2387dc45a472811f003f2773168a0cfddb..e4b55fbda19d58b7da457f50660f496d2dc948d8 100644 (file)
@@ -23,9 +23,6 @@
 
 #include "dnstest.h"
 
-#ifdef HAVE_INTTYPES_H
-#include <inttypes.h> /* uintptr_t */
-#endif
 
 static int debug = 0;
 
index 679ed5cc416177ba4920ebaf69d8c722f5e9b084..eeb0b5798bb14bc4436d401608aa04f345829c4b 100644 (file)
@@ -14,6 +14,8 @@
 
 #include <config.h>
 
+#include <inttypes.h>
+
 #include <isc/mem.h>
 #include <isc/print.h>
 #include <isc/random.h>
@@ -1506,7 +1508,7 @@ maybe_free(dns_xfrin_ctx_t *xfr) {
        persec = (xfr->nbytes * 1000) / msecs;
        xfrin_log(xfr, ISC_LOG_INFO,
                  "Transfer completed: %d messages, %d records, "
-                 "%" ISC_PRINT_QUADFORMAT "u bytes, "
+                 "%" PRIu64 " bytes, "
                  "%u.%03u secs (%u bytes/sec)",
                  xfr->nmsg, xfr->nrecs, xfr->nbytes,
                  (unsigned int) (msecs / 1000), (unsigned int) (msecs % 1000),
index eec08443fb668d68177eb77b231dd4229eb11b37..e952d3fd51b9b6bc1df304befd4cff1a59eb5858 100644 (file)
@@ -13,6 +13,9 @@
 
 #include <config.h>
 
+#include <inttypes.h>
+#include <stdarg.h>
+
 #include <isc/buffer.h>
 #include <isc/mem.h>
 #include <isc/print.h>
@@ -474,7 +477,7 @@ isc_buffer_putdecint(isc_buffer_t *b, isc_int64_t v) {
        REQUIRE(ISC_BUFFER_VALID(b));
 
        /* xxxwpk do it more low-level way ? */
-       l = snprintf(buf, 21, "%" ISC_PRINT_QUADFORMAT "d", v);
+       l = snprintf(buf, 21, "%" PRId64, v);
        RUNTIME_CHECK(l <= 21);
        if (ISC_UNLIKELY(b->autore)) {
                result = isc_buffer_reserve(&b, l);
index 2ff522342ff21c9b3a5aebeef80867351bd0741c..c902d4643d0930f1a704ea97cd67c77e69140315 100644 (file)
  */
 @ISC_PLATFORM_NEEDFPRINTF@
 
-/*! \brief
- * The printf format string modifier to use with isc_uint64_t values.
- */
-@ISC_PLATFORM_QUADFORMAT@
-
 /***
  *** String functions.
  ***/
index 303bd445b72e72ee12ecd7456ccfeda585605aea..e4fa76caef7221e15d1c6679c63fe09fd5b9c5e6 100644 (file)
 #undef printf
 #endif
 
-/***
- *** Macros
- ***/
-#define ISC_PRINT_QUADFORMAT ISC_PLATFORM_QUADFORMAT
-
 /***
  *** Functions
  ***/
index 9448f04439ac5552fb71b30ea9ba4d5f7f7d67a1..fa4c19b2f25cefcacbcdc6820748f8285c07728f 100644 (file)
@@ -16,7 +16,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <stddef.h>
-
+#include <inttypes.h>
 #include <limits.h>
 
 #include <isc/bind9.h>
@@ -2376,20 +2376,20 @@ xml_renderctx(isc__mem_t *ctx, summarystat_t *summary,
        summary->total += ctx->total;
        TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR "total"));
        TRY0(xmlTextWriterWriteFormatString(writer,
-                                           "%" ISC_PRINT_QUADFORMAT "u",
+                                           "%" PRIu64,
                                            (isc_uint64_t)ctx->total));
        TRY0(xmlTextWriterEndElement(writer)); /* total */
 
        summary->inuse += ctx->inuse;
        TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR "inuse"));
        TRY0(xmlTextWriterWriteFormatString(writer,
-                                           "%" ISC_PRINT_QUADFORMAT "u",
+                                           "%" PRIu64,
                                            (isc_uint64_t)ctx->inuse));
        TRY0(xmlTextWriterEndElement(writer)); /* inuse */
 
        TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR "maxinuse"));
        TRY0(xmlTextWriterWriteFormatString(writer,
-                                           "%" ISC_PRINT_QUADFORMAT "u",
+                                           "%" PRIu64,
                                            (isc_uint64_t)ctx->maxinuse));
        TRY0(xmlTextWriterEndElement(writer)); /* maxinuse */
 
@@ -2398,7 +2398,7 @@ xml_renderctx(isc__mem_t *ctx, summarystat_t *summary,
                summary->blocksize += ctx->basic_table_count *
                        NUM_BASIC_BLOCKS * ctx->mem_target;
                TRY0(xmlTextWriterWriteFormatString(writer,
-                                              "%" ISC_PRINT_QUADFORMAT "u",
+                                              "%" PRIu64,
                                               (isc_uint64_t)
                                               ctx->basic_table_count *
                                               NUM_BASIC_BLOCKS *
@@ -2414,13 +2414,13 @@ xml_renderctx(isc__mem_t *ctx, summarystat_t *summary,
 
        TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR "hiwater"));
        TRY0(xmlTextWriterWriteFormatString(writer,
-                                           "%" ISC_PRINT_QUADFORMAT "u",
+                                           "%" PRIu64,
                                            (isc_uint64_t)ctx->hi_water));
        TRY0(xmlTextWriterEndElement(writer)); /* hiwater */
 
        TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR "lowater"));
        TRY0(xmlTextWriterWriteFormatString(writer,
-                                           "%" ISC_PRINT_QUADFORMAT "u",
+                                           "%" PRIu64,
                                            (isc_uint64_t)ctx->lo_water));
        TRY0(xmlTextWriterEndElement(writer)); /* lowater */
 
@@ -2464,31 +2464,31 @@ isc_mem_renderxml(xmlTextWriterPtr writer) {
 
        TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR "TotalUse"));
        TRY0(xmlTextWriterWriteFormatString(writer,
-                                           "%" ISC_PRINT_QUADFORMAT "u",
+                                           "%" PRIu64,
                                            summary.total));
        TRY0(xmlTextWriterEndElement(writer)); /* TotalUse */
 
        TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR "InUse"));
        TRY0(xmlTextWriterWriteFormatString(writer,
-                                           "%" ISC_PRINT_QUADFORMAT "u",
+                                           "%" PRIu64,
                                            summary.inuse));
        TRY0(xmlTextWriterEndElement(writer)); /* InUse */
 
        TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR "BlockSize"));
        TRY0(xmlTextWriterWriteFormatString(writer,
-                                           "%" ISC_PRINT_QUADFORMAT "u",
+                                           "%" PRIu64,
                                            summary.blocksize));
        TRY0(xmlTextWriterEndElement(writer)); /* BlockSize */
 
        TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR "ContextSize"));
        TRY0(xmlTextWriterWriteFormatString(writer,
-                                           "%" ISC_PRINT_QUADFORMAT "u",
+                                           "%" PRIu64,
                                            summary.contextsize));
        TRY0(xmlTextWriterEndElement(writer)); /* ContextSize */
 
        TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR "Lost"));
        TRY0(xmlTextWriterWriteFormatString(writer,
-                                           "%" ISC_PRINT_QUADFORMAT "u",
+                                           "%" PRIu64,
                                            lost));
        TRY0(xmlTextWriterEndElement(writer)); /* Lost */
 
index d38d84774bbc38dc9f9a9e4dd5fa9ef4ec0b26af..3d1e1352377781c8417bfad67d8c4c6d00a58227 100644 (file)
@@ -10,7 +10,9 @@
  */
 
 #include <config.h>
+
 #include <stdlib.h>
+#include <inttypes.h>
 
 #include <atf-c.h>
 
@@ -149,8 +151,8 @@ ATF_TC_BODY(atomic_xaddq, tc) {
 
        isc_test_end();
 
-       printf("64-bit counter %"ISC_PRINT_QUADFORMAT"d, "
-              "expected %"ISC_PRINT_QUADFORMAT"d\n",
+       printf("64-bit counter %" PRId64 ", "
+              "expected %" PRId64 "\n",
               counter_64, EXPECTED_COUNT_64);
 
        ATF_CHECK_EQ(counter_64, EXPECTED_COUNT_64);
@@ -304,8 +306,8 @@ ATF_TC_BODY(atomic_storeq, tc) {
               (isc_uint64_t) r);
        val |= ((isc_uint64_t) val << 32);
 
-       printf("64-bit store 0x%"ISC_PRINT_QUADFORMAT"x, "
-              "expected 0x%"ISC_PRINT_QUADFORMAT"x\n",
+       printf("64-bit store 0x%" PRIx64 ", "
+              "expected 0x%" PRIx64 "\n",
               (isc_uint64_t) store_64, val);
 
        ATF_CHECK_EQ((isc_uint64_t) store_64, val);
index 18759903be19f15832b3e0550ce454fdf8ded464..48698312f6d82ece0fbb9a312f3966e9a3c51d7f 100644 (file)
@@ -17,6 +17,7 @@
 
 #include <stdio.h>
 #include <string.h>
+#include <inttypes.h>
 
 #include <isc/hash.h>
 
@@ -1839,7 +1840,7 @@ ATF_TC_BODY(isc_crc64, tc) {
                }
                isc_crc64_final(&crc);
                snprintf(str, sizeof(str),
-                        "0x%016" ISC_PRINT_QUADFORMAT "X", crc);
+                        "0x%016" PRIX64, crc);
                ATF_CHECK_STREQ(str, testcase->result);
 
                testcase++;
index 81220c4c64abf6464dbd12ae91450ecc6b724938..0f5402e557e4ef5eb0b9a89bf8620ad83158d4cf 100644 (file)
@@ -13,6 +13,7 @@
 
 #include <atf-c.h>
 
+#include <inttypes.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -62,37 +63,37 @@ ATF_TC_BODY(snprintf, tc) {
         */
 
        memset(buf, 0xff, sizeof(buf));
-       n = isc_print_snprintf(buf, sizeof(buf), "%qu", ll);
+       n = isc_print_snprintf(buf, sizeof(buf), "%" PRIu64, ll);
        ATF_CHECK_EQ(n, 10);
        ATF_CHECK_STREQ(buf, "8589934592");
 
        memset(buf, 0xff, sizeof(buf));
-       n = isc_print_snprintf(buf, sizeof(buf), "%llu", ll);
+       n = isc_print_snprintf(buf, sizeof(buf), "%" PRIu64, ll);
        ATF_CHECK_EQ(n, 10);
        ATF_CHECK_STREQ(buf, "8589934592");
 
        memset(buf, 0xff, sizeof(buf));
-       n = isc_print_snprintf(buf, sizeof(buf), "%qu", nn);
+       n = isc_print_snprintf(buf, sizeof(buf), "%" PRIu64, nn);
        ATF_CHECK_EQ(n, 14);
        ATF_CHECK_STREQ(buf, "20000000000000");
 
        memset(buf, 0xff, sizeof(buf));
-       n = isc_print_snprintf(buf, sizeof(buf), "%llu", nn);
+       n = isc_print_snprintf(buf, sizeof(buf), "%" PRIu64, nn);
        ATF_CHECK_EQ(n, 14);
        ATF_CHECK_STREQ(buf, "20000000000000");
 
        memset(buf, 0xff, sizeof(buf));
-       n = isc_print_snprintf(buf, sizeof(buf), "%qu", zz);
+       n = isc_print_snprintf(buf, sizeof(buf), "%" PRIu64, zz);
        ATF_CHECK_EQ(n, 20);
        ATF_CHECK_STREQ(buf, "10000000000000000000");
 
        memset(buf, 0xff, sizeof(buf));
-       n = isc_print_snprintf(buf, sizeof(buf), "%llu", zz);
+       n = isc_print_snprintf(buf, sizeof(buf), "%" PRIu64, zz);
        ATF_CHECK_EQ(n, 20);
        ATF_CHECK_STREQ(buf, "10000000000000000000");
 
        memset(buf, 0xff, sizeof(buf));
-       n = isc_print_snprintf(buf, sizeof(buf), "%lld", nn);
+       n = isc_print_snprintf(buf, sizeof(buf), "%" PRId64, nn);
        ATF_CHECK_EQ(n, 14);
        ATF_CHECK_STREQ(buf, "20000000000000");
 
@@ -116,7 +117,7 @@ ATF_TC_BODY(snprintf, tc) {
 
        zz = 0xf5f5f5f5f5f5f5f5ULL;
        memset(buf, 0xff, sizeof(buf));
-       n = isc_print_snprintf(buf, sizeof(buf), "0x%"ISC_PRINT_QUADFORMAT"x", zz);
+       n = isc_print_snprintf(buf, sizeof(buf), "0x%" PRIx64, zz);
        ATF_CHECK_EQ(n, 18);
        ATF_CHECK_STREQ(buf, "0xf5f5f5f5f5f5f5f5");
 
index de54f601c2dd09830a4d06da6202661d6bff95e1..09abc1798972b60adac177ee1edfdb3521be55fd 100644 (file)
 
 #include <atf-c.h>
 
-#ifdef HAVE_INTTYPES_H
-#include <inttypes.h>  /* uintptr_t */
-#endif
 #include <stdlib.h>
 #include <unistd.h>
+#include <inttypes.h>
 
 #include <isc/condition.h>
 #include <isc/mem.h>
index 1ce2623e6b7054d6b842795c2997a001a5edd9cc..f4f2b7bcfa4b43fb67a7e71b8d796980a1e0d631 100644 (file)
@@ -34,9 +34,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
-#ifdef HAVE_INTTYPES_H
-#include <inttypes.h> /* uintptr_t */
-#endif
+#include <inttypes.h>
 
 #include <isc/buffer.h>
 #include <isc/bufferlist.h>
index de6a4344ea73f7ac652ea334dac12bbb1ec82ffe..588e23dbb29277f3ae0d5ed56c252479ae47b700 100644 (file)
@@ -40,8 +40,6 @@
 #define ISC_PLATFORM_HAVETFO
 #endif
 
-#define ISC_PLATFORM_QUADFORMAT "I64"
-
 #define ISC_PLATFORM_NEEDSTRSEP
 #define ISC_PLATFORM_NEEDSTRLCPY
 #define ISC_PLATFORM_NEEDSTRLCAT
index 105c1c51805134c537aa0a2f928f9611ab81df08..d0907380bd4b915c76a3ef3b3035ce66f2ea411a 100644 (file)
@@ -14,6 +14,7 @@
 #include <config.h>
 
 #include <stdlib.h>
+#include <inttypes.h>
 
 #include <isc/buffer.h>
 #include <isc/dir.h>
@@ -976,7 +977,7 @@ void
 cfg_print_uint64(cfg_printer_t *pctx, const cfg_obj_t *obj) {
        char buf[32];
 
-       snprintf(buf, sizeof(buf), "%" ISC_PRINT_QUADFORMAT "u",
+       snprintf(buf, sizeof(buf), "%" PRIu64,
                 obj->value.uint64);
        cfg_print_cstr(pctx, buf);
 }
index f1d947caa04acd3e2221c16d99a8784bef2bd3e7..52c7192d13d37e0597a34845c4f67873e0bd2a77 100644 (file)
  */
 @LWRES_PLATFORM_NEEDSPRINTF@
 
-/*
- * The printf format string modifier to use with lwres_uint64_t values.
- */
-@LWRES_PLATFORM_QUADFORMAT@
-
 /*! \brief
  * Define if this system needs strtoul.
  */
index 156b6ebff40f57e54e543f8fa1259065ac378879..005a4ec7a2736d861d4dbe07991d0e471c149708 100644 (file)
@@ -12,6 +12,7 @@
 #include <config.h>
 
 #include <ctype.h>
+#include <inttypes.h>
 #include <stdio.h>             /* for sprintf */
 #include <string.h>
 
@@ -23,8 +24,6 @@
 #include "assert_p.h"
 #include "print_p.h"
 
-#define LWRES_PRINT_QUADFORMAT LWRES_PLATFORM_QUADFORMAT
-
 int
 lwres__print_sprintf(char *str, const char *format, ...) {
        va_list ap;
@@ -249,7 +248,7 @@ lwres__print_vsnprintf(char *str, size_t size, const char *format, va_list ap) {
                                                head = "";
                                        tmpui = tmpi;
                                }
-                               sprintf(buf, "%" LWRES_PRINT_QUADFORMAT "u",
+                               sprintf(buf, "%llu",
                                        tmpui);
                                goto printint;
                        case 'o':
@@ -263,8 +262,8 @@ lwres__print_vsnprintf(char *str, size_t size, const char *format, va_list ap) {
                                else
                                        tmpui = va_arg(ap, int);
                                sprintf(buf,
-                                       alt ? "%#" LWRES_PRINT_QUADFORMAT "o"
-                                           : "%" LWRES_PRINT_QUADFORMAT "o",
+                                       alt ? "%#llo"
+                                           : "%llo",
                                        tmpui);
                                goto printint;
                        case 'u':
@@ -277,7 +276,7 @@ lwres__print_vsnprintf(char *str, size_t size, const char *format, va_list ap) {
                                        tmpui = va_arg(ap, size_t);
                                else
                                        tmpui = va_arg(ap, unsigned int);
-                               sprintf(buf, "%" LWRES_PRINT_QUADFORMAT "u",
+                               sprintf(buf, "%llu",
                                        tmpui);
                                goto printint;
                        case 'x':
@@ -295,7 +294,7 @@ lwres__print_vsnprintf(char *str, size_t size, const char *format, va_list ap) {
                                        if (precision > 2U)
                                                precision -= 2;
                                }
-                               sprintf(buf, "%" LWRES_PRINT_QUADFORMAT "x",
+                               sprintf(buf, "%llx",
                                        tmpui);
                                goto printint;
                        case 'X':
@@ -313,7 +312,7 @@ lwres__print_vsnprintf(char *str, size_t size, const char *format, va_list ap) {
                                        if (precision > 2U)
                                                precision -= 2;
                                }
-                               sprintf(buf, "%" LWRES_PRINT_QUADFORMAT "X",
+                               sprintf(buf, "%llX",
                                        tmpui);
                                goto printint;
                        printint: