mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-30 22:15:20 +00:00
Replace custom isc_u?intNN_t types with C99 u?intNN_t types
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <inttypes.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <isc/buffer.h>
|
||||
@@ -36,7 +37,7 @@
|
||||
} while (0)
|
||||
|
||||
|
||||
static isc_result_t bind_ttl(isc_textregion_t *source, isc_uint32_t *ttl);
|
||||
static isc_result_t bind_ttl(isc_textregion_t *source, uint32_t *ttl);
|
||||
|
||||
/*
|
||||
* Helper for dns_ttl_totext().
|
||||
@@ -71,7 +72,7 @@ ttlfmt(unsigned int t, const char *s, isc_boolean_t verbose,
|
||||
* Derived from bind8 ns_format_ttl().
|
||||
*/
|
||||
isc_result_t
|
||||
dns_ttl_totext(isc_uint32_t src, isc_boolean_t verbose,
|
||||
dns_ttl_totext(uint32_t src, isc_boolean_t verbose,
|
||||
isc_boolean_t upcase, isc_buffer_t *target)
|
||||
{
|
||||
unsigned secs, mins, hours, days, weeks, x;
|
||||
@@ -128,12 +129,12 @@ dns_ttl_totext(isc_uint32_t src, isc_boolean_t verbose,
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dns_counter_fromtext(isc_textregion_t *source, isc_uint32_t *ttl) {
|
||||
dns_counter_fromtext(isc_textregion_t *source, uint32_t *ttl) {
|
||||
return (bind_ttl(source, ttl));
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dns_ttl_fromtext(isc_textregion_t *source, isc_uint32_t *ttl) {
|
||||
dns_ttl_fromtext(isc_textregion_t *source, uint32_t *ttl) {
|
||||
isc_result_t result;
|
||||
|
||||
result = bind_ttl(source, ttl);
|
||||
@@ -143,9 +144,9 @@ dns_ttl_fromtext(isc_textregion_t *source, isc_uint32_t *ttl) {
|
||||
}
|
||||
|
||||
static isc_result_t
|
||||
bind_ttl(isc_textregion_t *source, isc_uint32_t *ttl) {
|
||||
isc_uint64_t tmp = 0ULL;
|
||||
isc_uint32_t n;
|
||||
bind_ttl(isc_textregion_t *source, uint32_t *ttl) {
|
||||
uint64_t tmp = 0ULL;
|
||||
uint32_t n;
|
||||
char *s;
|
||||
char buf[64];
|
||||
char nbuf[64]; /* Number buffer */
|
||||
@@ -174,27 +175,27 @@ bind_ttl(isc_textregion_t *source, isc_uint32_t *ttl) {
|
||||
switch (*s) {
|
||||
case 'w':
|
||||
case 'W':
|
||||
tmp += (isc_uint64_t) n * 7 * 24 * 3600;
|
||||
tmp += (uint64_t) n * 7 * 24 * 3600;
|
||||
s++;
|
||||
break;
|
||||
case 'd':
|
||||
case 'D':
|
||||
tmp += (isc_uint64_t) n * 24 * 3600;
|
||||
tmp += (uint64_t) n * 24 * 3600;
|
||||
s++;
|
||||
break;
|
||||
case 'h':
|
||||
case 'H':
|
||||
tmp += (isc_uint64_t) n * 3600;
|
||||
tmp += (uint64_t) n * 3600;
|
||||
s++;
|
||||
break;
|
||||
case 'm':
|
||||
case 'M':
|
||||
tmp += (isc_uint64_t) n * 60;
|
||||
tmp += (uint64_t) n * 60;
|
||||
s++;
|
||||
break;
|
||||
case 's':
|
||||
case 'S':
|
||||
tmp += (isc_uint64_t) n;
|
||||
tmp += (uint64_t) n;
|
||||
s++;
|
||||
break;
|
||||
case '\0':
|
||||
@@ -211,6 +212,6 @@ bind_ttl(isc_textregion_t *source, isc_uint32_t *ttl) {
|
||||
if (tmp > 0xffffffffULL)
|
||||
return (ISC_R_RANGE);
|
||||
|
||||
*ttl = (isc_uint32_t)(tmp & 0xffffffffUL);
|
||||
*ttl = (uint32_t)(tmp & 0xffffffffUL);
|
||||
return (ISC_R_SUCCESS);
|
||||
}
|
||||
|
Reference in New Issue
Block a user