]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
637. [port] Use isc_u?int64_t instead of (unsigned) long long in
authorDavid Lawrence <source@isc.org>
Tue, 26 Dec 2000 21:00:41 +0000 (21:00 +0000)
committerDavid Lawrence <source@isc.org>
Tue, 26 Dec 2000 21:00:41 +0000 (21:00 +0000)
lib/isc/print.c.  Also allow lib/isc/print.c to
be compiled even if the platform does not need it.
[RT #592]

Also cleaned up some const issues.

CHANGES
lib/isc/include/isc/print.h
lib/isc/print.c

diff --git a/CHANGES b/CHANGES
index f8828bb7fff9f3afb99c46a5a9893bf64f2d877f..8f23bd06da01bba5936219a0ff69a074f2c016d3 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,9 @@
 
+ 637.  [port]          Use isc_u?int64_t instead of (unsigned) long long in
+                       lib/isc/print.c.  Also allow lib/isc/print.c to
+                       be compiled even if the platform does not need it.
+                       [RT #592]
+
  636.  [port]          Shut up MSVC++ about a possible loss of precision
                        in the ISC__BUFFER_PUTUINT*() macros. [RT #592]
 
  628.  [bug]           If the root hints contained only AAAA addresses,
                        named would be unable to perform resolution.
 
- 627.  [bug]           The EDNS0 blackhole detection code of 324. waited
-                       for three retransmissions to each server, which
-                       takes much too long when a domain has many name
-                       servers and all of them drop EDNS0 queries.  Now
-                       we retry without EDNS0 after three consecutive
+ 627.  [bug]           The EDNS0 blackhole detection code of changed 324
+                       waited for three retransmissions to each server,
+                       which takes much too long when a domain has many
+                       name servers and all of them drop EDNS0 queries.
+                       Now we retry without EDNS0 after three consecutive
                        timeouts, even if they are all from different
                        servers. [RT #143]
 
index d02715fefe88de229b474271ea30f28a2f109978..5eaad18e9c100f10d414e43e81e393063ff138c3 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: print.h,v 1.11 2000/11/14 23:40:31 tale Exp $ */
+/* $Id: print.h,v 1.12 2000/12/26 21:00:40 tale Exp $ */
 
 #ifndef ISC_PRINT_H
 #define ISC_PRINT_H 1
 #include <isc/lang.h>
 #include <isc/platform.h>
 
+/*
+ * This block allows lib/isc/print.c to be cleanly compiled even if
+ * the platform does not need it.  The standard Makefile will still
+ * not compile print.c or archive print.o, so this is just to make test
+ * compilation ("make print.o") easier.
+ */
+#if !defined(ISC_PLATFORM_NEEDVSNPRINTF) && define(ISC__PRINT_SOURCE)
+#define ISC_PLATFORM_NEEDVSNPRINTF
+#endif
+
 /***
  *** Macros
  ***/
index 3c208daecae737b78142132d42e9482f62e8cabc..68ff7dbf8b4edef6c5593505121ae8e232c7de03 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: print.c,v 1.15 2000/12/06 00:30:06 tale Exp $ */
+/* $Id: print.c,v 1.16 2000/12/26 21:00:41 tale Exp $ */
 
 #include <config.h>
 
 #include <stdio.h>             /* for sprintf */
 #include <stdlib.h>
 
+#define        ISC__PRINT_SOURCE       /* Used to get the isc_print_* prototypes. */
+
 #include <isc/assertions.h>
+#include <isc/int.h>
 #include <isc/msgs.h>
 #include <isc/print.h>
-#include <isc/platform.h>
 #include <isc/util.h>
 
-#ifndef ISC_PLATFORM_NEEDVSNPRINTF
-#error ISC_PLATFORM_NEEDVSPRINTF needs to be defined to compile this file.
-#endif
-
 /*
  * Return length of string that would have been written if not truncated.
  */
@@ -65,16 +63,16 @@ isc_print_vsnprintf(char *str, size_t size, const char *format, va_list ap) {
        int space;
        int neg;
        long long tmpi;
-       unsigned long long tmpui;
+       isc_uint64_t tmpui;
        unsigned long width;
        unsigned long precision;
        unsigned int length;
        char buf[1024];
-       char *cp;
-       char *save = str;
        char c;
        void *v;
-       char *head;
+       char *save = str;
+       const char *cp;
+       const char *head;
        int count = 0;
        int pad;
        int zeropad;
@@ -217,7 +215,7 @@ isc_print_vsnprintf(char *str, size_t size, const char *format, va_list ap) {
                        case 'i':
                        case 'd':
                                if (q)
-                                       tmpi = va_arg(ap, long long);
+                                       tmpi = va_arg(ap, isc_int64_t);
                                else if (l)
                                        tmpi = va_arg(ap, long int);
                                else
@@ -239,7 +237,7 @@ isc_print_vsnprintf(char *str, size_t size, const char *format, va_list ap) {
                                goto printint;
                        case 'o':
                                if (q)
-                                       tmpui = va_arg(ap, unsigned long long);
+                                       tmpui = va_arg(ap, isc_uint64_t);
                                else if (l)
                                        tmpui = va_arg(ap, long int);
                                else
@@ -251,7 +249,7 @@ isc_print_vsnprintf(char *str, size_t size, const char *format, va_list ap) {
                                goto printint;
                        case 'u':
                                if (q)
-                                       tmpui = va_arg(ap, unsigned long long);
+                                       tmpui = va_arg(ap, isc_uint64_t);
                                else if (l)
                                        tmpui = va_arg(ap, unsigned long int);
                                else
@@ -261,7 +259,7 @@ isc_print_vsnprintf(char *str, size_t size, const char *format, va_list ap) {
                                goto printint;
                        case 'x':
                                if (q)
-                                       tmpui = va_arg(ap, unsigned long long);
+                                       tmpui = va_arg(ap, isc_uint64_t);
                                else if (l)
                                        tmpui = va_arg(ap, unsigned long int);
                                else
@@ -276,7 +274,7 @@ isc_print_vsnprintf(char *str, size_t size, const char *format, va_list ap) {
                                goto printint;
                        case 'X':
                                if (q)
-                                       tmpui = va_arg(ap, unsigned long long);
+                                       tmpui = va_arg(ap, isc_uint64_t);
                                else if (l)
                                        tmpui = va_arg(ap, unsigned long int);
                                else
@@ -345,7 +343,7 @@ isc_print_vsnprintf(char *str, size_t size, const char *format, va_list ap) {
                                /*
                                 * cp need not be NULL terminated.
                                 */
-                               char *tp;
+                               const char *tp;
                                unsigned long n;
 
                                n = precision;
@@ -495,7 +493,7 @@ isc_print_vsnprintf(char *str, size_t size, const char *format, va_list ap) {
                         * MAX 1.7976931348623157E+308
                         * VAX floating point has a smaller range than IEEE.
                         *
-                        * precisions > 324 don't make much sence.
+                        * precisions > 324 don't make much sense.
                         * if we cap the precision at 512 we will not
                         * overflow buf.
                         */