2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 14:35:26 +00:00

Replace custom isc_u?intNN_t types with C99 u?intNN_t types

This commit is contained in:
Ondřej Surý
2018-03-28 14:19:37 +02:00
parent 055278c936
commit cb6a185c69
390 changed files with 2812 additions and 2528 deletions

View File

@@ -13,8 +13,8 @@
#include <config.h>
#include <inttypes.h>
#include <sys/stat.h>
#include <inttypes.h> /* uintptr_t */
#include <isc/crc64.h>
#include <isc/file.h>
@@ -99,16 +99,16 @@ static char FILE_VERSION[32] = "\0";
struct file_header {
char version1[32];
isc_uint64_t first_node_offset; /* usually 1024 */
uint64_t first_node_offset; /* usually 1024 */
/*
* information about the system on which the map file was generated
* will be used to tell if we can load the map file or not
*/
isc_uint32_t ptrsize;
uint32_t ptrsize;
unsigned int bigendian:1; /* big or little endian system */
unsigned int rdataset_fixed:1; /* compiled with --enable-rrset-fixed */
unsigned int nodecount; /* shadow from rbt structure */
isc_uint64_t crc;
uint64_t crc;
char version2[32]; /* repeated; must match version1 */
};
@@ -135,8 +135,8 @@ static isc_result_t
dns_rbt_zero_header(FILE *file);
static isc_result_t
write_header(FILE *file, dns_rbt_t *rbt, isc_uint64_t first_node_offset,
isc_uint64_t crc);
write_header(FILE *file, dns_rbt_t *rbt, uint64_t first_node_offset,
uint64_t crc);
static isc_boolean_t
match_header_version(file_header_t *header);
@@ -144,12 +144,12 @@ match_header_version(file_header_t *header);
static isc_result_t
serialize_node(FILE *file, dns_rbtnode_t *node, uintptr_t left,
uintptr_t right, uintptr_t down, uintptr_t parent,
uintptr_t data, isc_uint64_t *crc);
uintptr_t data, uint64_t *crc);
static isc_result_t
serialize_nodes(FILE *file, dns_rbtnode_t *node, uintptr_t parent,
dns_rbtdatawriter_t datawriter, void *writer_arg,
uintptr_t *where, isc_uint64_t *crc);
uintptr_t *where, uint64_t *crc);
/*
* The following functions allow you to get the actual address of a pointer
@@ -415,7 +415,7 @@ static isc_result_t
treefix(dns_rbt_t *rbt, void *base, size_t size,
dns_rbtnode_t *n, const dns_name_t *name,
dns_rbtdatafixer_t datafixer, void *fixer_arg,
isc_uint64_t *crc);
uint64_t *crc);
static void
deletetreeflat(dns_rbt_t *rbt, unsigned int quantum, isc_boolean_t unhash,
@@ -469,8 +469,8 @@ init_file_version(void) {
* here.
*/
static isc_result_t
write_header(FILE *file, dns_rbt_t *rbt, isc_uint64_t first_node_offset,
isc_uint64_t crc)
write_header(FILE *file, dns_rbt_t *rbt, uint64_t first_node_offset,
uint64_t crc)
{
file_header_t header;
isc_result_t result;
@@ -482,7 +482,7 @@ write_header(FILE *file, dns_rbt_t *rbt, isc_uint64_t first_node_offset,
memmove(header.version1, FILE_VERSION, sizeof(header.version1));
memmove(header.version2, FILE_VERSION, sizeof(header.version2));
header.first_node_offset = first_node_offset;
header.ptrsize = (isc_uint32_t) sizeof(void *);
header.ptrsize = (uint32_t) sizeof(void *);
header.bigendian = (1 == htonl(1)) ? 1 : 0;
#ifdef DNS_RDATASET_FIXED
@@ -526,7 +526,7 @@ match_header_version(file_header_t *header) {
static isc_result_t
serialize_node(FILE *file, dns_rbtnode_t *node, uintptr_t left,
uintptr_t right, uintptr_t down, uintptr_t parent,
uintptr_t data, isc_uint64_t *crc)
uintptr_t data, uint64_t *crc)
{
dns_rbtnode_t temp_node;
off_t file_position;
@@ -596,9 +596,9 @@ serialize_node(FILE *file, dns_rbtnode_t *node, uintptr_t left,
hexdump("node data", node_data, datasize);
#endif
isc_crc64_update(crc, (const isc_uint8_t *) &temp_node,
isc_crc64_update(crc, (const uint8_t *) &temp_node,
sizeof(dns_rbtnode_t));
isc_crc64_update(crc, (const isc_uint8_t *) node_data, datasize);
isc_crc64_update(crc, (const uint8_t *) node_data, datasize);
cleanup:
return (result);
@@ -607,7 +607,7 @@ serialize_node(FILE *file, dns_rbtnode_t *node, uintptr_t left,
static isc_result_t
serialize_nodes(FILE *file, dns_rbtnode_t *node, uintptr_t parent,
dns_rbtdatawriter_t datawriter, void *writer_arg,
uintptr_t *where, isc_uint64_t *crc)
uintptr_t *where, uint64_t *crc)
{
uintptr_t left = 0, right = 0, down = 0, data = 0;
off_t location = 0, offset_adjust;
@@ -684,7 +684,7 @@ dns_rbt_serialize_tree(FILE *file, dns_rbt_t *rbt,
{
isc_result_t result;
off_t header_position, node_position, end_position;
isc_uint64_t crc;
uint64_t crc;
REQUIRE(file != NULL);
@@ -736,7 +736,7 @@ dns_rbt_serialize_tree(FILE *file, dns_rbt_t *rbt,
static isc_result_t
treefix(dns_rbt_t *rbt, void *base, size_t filesize, dns_rbtnode_t *n,
const dns_name_t *name, dns_rbtdatafixer_t datafixer,
void *fixer_arg, isc_uint64_t *crc)
void *fixer_arg, uint64_t *crc)
{
isc_result_t result = ISC_R_SUCCESS;
dns_fixedname_t fixed;
@@ -836,9 +836,9 @@ treefix(dns_rbt_t *rbt, void *base, size_t filesize, dns_rbtnode_t *n,
sizeof(dns_rbtnode_t));
hexdump("node data", node_data, datasize);
#endif
isc_crc64_update(crc, (const isc_uint8_t *) &header,
isc_crc64_update(crc, (const uint8_t *) &header,
sizeof(dns_rbtnode_t));
isc_crc64_update(crc, (const isc_uint8_t *) node_data,
isc_crc64_update(crc, (const uint8_t *) node_data,
datasize);
cleanup:
@@ -855,7 +855,7 @@ dns_rbt_deserialize_tree(void *base_address, size_t filesize,
isc_result_t result = ISC_R_SUCCESS;
file_header_t *header;
dns_rbt_t *rbt = NULL;
isc_uint64_t crc;
uint64_t crc;
unsigned int host_big_endian;
REQUIRE(originp == NULL || *originp == NULL);
@@ -886,7 +886,7 @@ dns_rbt_deserialize_tree(void *base_address, size_t filesize,
}
#endif
if (header->ptrsize != (isc_uint32_t) sizeof(void *)) {
if (header->ptrsize != (uint32_t) sizeof(void *)) {
result = ISC_R_INVALIDFILE;
goto cleanup;
}