diff --git a/CHANGES b/CHANGES index f8828bb7ff..8f23bd06da 100644 --- 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] @@ -24,11 +29,11 @@ 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] diff --git a/lib/isc/include/isc/print.h b/lib/isc/include/isc/print.h index d02715fefe..5eaad18e9c 100644 --- a/lib/isc/include/isc/print.h +++ b/lib/isc/include/isc/print.h @@ -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 @@ -28,6 +28,16 @@ #include #include +/* + * 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 ***/ diff --git a/lib/isc/print.c b/lib/isc/print.c index 3c208daeca..68ff7dbf8b 100644 --- a/lib/isc/print.c +++ b/lib/isc/print.c @@ -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 @@ -23,16 +23,14 @@ #include /* for sprintf */ #include +#define ISC__PRINT_SOURCE /* Used to get the isc_print_* prototypes. */ + #include +#include #include #include -#include #include -#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. */