2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-09-01 06:55:30 +00:00

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]

Also cleaned up some const issues.
This commit is contained in:
David Lawrence
2000-12-26 21:00:41 +00:00
parent 0b3427d15c
commit 125a916d1a
3 changed files with 36 additions and 23 deletions

15
CHANGES
View File

@@ -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 636. [port] Shut up MSVC++ about a possible loss of precision
in the ISC__BUFFER_PUTUINT*() macros. [RT #592] in the ISC__BUFFER_PUTUINT*() macros. [RT #592]
@@ -24,11 +29,11 @@
628. [bug] If the root hints contained only AAAA addresses, 628. [bug] If the root hints contained only AAAA addresses,
named would be unable to perform resolution. named would be unable to perform resolution.
627. [bug] The EDNS0 blackhole detection code of 324. waited 627. [bug] The EDNS0 blackhole detection code of changed 324
for three retransmissions to each server, which waited for three retransmissions to each server,
takes much too long when a domain has many name which takes much too long when a domain has many
servers and all of them drop EDNS0 queries. Now name servers and all of them drop EDNS0 queries.
we retry without EDNS0 after three consecutive Now we retry without EDNS0 after three consecutive
timeouts, even if they are all from different timeouts, even if they are all from different
servers. [RT #143] servers. [RT #143]

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * 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 #ifndef ISC_PRINT_H
#define ISC_PRINT_H 1 #define ISC_PRINT_H 1
@@ -28,6 +28,16 @@
#include <isc/lang.h> #include <isc/lang.h>
#include <isc/platform.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 *** Macros
***/ ***/

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * 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 <config.h>
@@ -23,16 +23,14 @@
#include <stdio.h> /* for sprintf */ #include <stdio.h> /* for sprintf */
#include <stdlib.h> #include <stdlib.h>
#define ISC__PRINT_SOURCE /* Used to get the isc_print_* prototypes. */
#include <isc/assertions.h> #include <isc/assertions.h>
#include <isc/int.h>
#include <isc/msgs.h> #include <isc/msgs.h>
#include <isc/print.h> #include <isc/print.h>
#include <isc/platform.h>
#include <isc/util.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. * 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 space;
int neg; int neg;
long long tmpi; long long tmpi;
unsigned long long tmpui; isc_uint64_t tmpui;
unsigned long width; unsigned long width;
unsigned long precision; unsigned long precision;
unsigned int length; unsigned int length;
char buf[1024]; char buf[1024];
char *cp;
char *save = str;
char c; char c;
void *v; void *v;
char *head; char *save = str;
const char *cp;
const char *head;
int count = 0; int count = 0;
int pad; int pad;
int zeropad; int zeropad;
@@ -217,7 +215,7 @@ isc_print_vsnprintf(char *str, size_t size, const char *format, va_list ap) {
case 'i': case 'i':
case 'd': case 'd':
if (q) if (q)
tmpi = va_arg(ap, long long); tmpi = va_arg(ap, isc_int64_t);
else if (l) else if (l)
tmpi = va_arg(ap, long int); tmpi = va_arg(ap, long int);
else else
@@ -239,7 +237,7 @@ isc_print_vsnprintf(char *str, size_t size, const char *format, va_list ap) {
goto printint; goto printint;
case 'o': case 'o':
if (q) if (q)
tmpui = va_arg(ap, unsigned long long); tmpui = va_arg(ap, isc_uint64_t);
else if (l) else if (l)
tmpui = va_arg(ap, long int); tmpui = va_arg(ap, long int);
else else
@@ -251,7 +249,7 @@ isc_print_vsnprintf(char *str, size_t size, const char *format, va_list ap) {
goto printint; goto printint;
case 'u': case 'u':
if (q) if (q)
tmpui = va_arg(ap, unsigned long long); tmpui = va_arg(ap, isc_uint64_t);
else if (l) else if (l)
tmpui = va_arg(ap, unsigned long int); tmpui = va_arg(ap, unsigned long int);
else else
@@ -261,7 +259,7 @@ isc_print_vsnprintf(char *str, size_t size, const char *format, va_list ap) {
goto printint; goto printint;
case 'x': case 'x':
if (q) if (q)
tmpui = va_arg(ap, unsigned long long); tmpui = va_arg(ap, isc_uint64_t);
else if (l) else if (l)
tmpui = va_arg(ap, unsigned long int); tmpui = va_arg(ap, unsigned long int);
else else
@@ -276,7 +274,7 @@ isc_print_vsnprintf(char *str, size_t size, const char *format, va_list ap) {
goto printint; goto printint;
case 'X': case 'X':
if (q) if (q)
tmpui = va_arg(ap, unsigned long long); tmpui = va_arg(ap, isc_uint64_t);
else if (l) else if (l)
tmpui = va_arg(ap, unsigned long int); tmpui = va_arg(ap, unsigned long int);
else 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. * cp need not be NULL terminated.
*/ */
char *tp; const char *tp;
unsigned long n; unsigned long n;
n = precision; n = precision;
@@ -495,7 +493,7 @@ isc_print_vsnprintf(char *str, size_t size, const char *format, va_list ap) {
* MAX 1.7976931348623157E+308 * MAX 1.7976931348623157E+308
* VAX floating point has a smaller range than IEEE. * 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 * if we cap the precision at 512 we will not
* overflow buf. * overflow buf.
*/ */