mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-30 14:07:59 +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:
15
CHANGES
15
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]
|
||||
|
||||
|
@@ -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 <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
|
||||
***/
|
||||
|
@@ -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>
|
||||
|
||||
@@ -23,16 +23,14 @@
|
||||
#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.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user