Commit 620620df authored by Tinderbox User's avatar Tinderbox User Committed by Mark Andrews
Browse files

silence pointer/int conversion warnings using uintptr_t, since we are using...

silence pointer/int conversion warnings using uintptr_t, since we are using stdio file offsets are longs
parent a5924ac6
......@@ -681,8 +681,8 @@ dns_rbt_destroy2(dns_rbt_t **rbtp, unsigned int quantum);
* \li ISC_R_QUOTA if 'quantum' nodes have been destroyed.
*/
inline isc_uint64_t
dns_rbt_serialize_align(isc_uint64_t target);
inline long
dns_rbt_serialize_align(long target);
/*%<
* Align the provided integer to a pointer-size boundary.
* This should be used if, during serialization of data to a will-be
......@@ -692,7 +692,7 @@ dns_rbt_serialize_align(isc_uint64_t target);
isc_result_t
dns_rbt_serialize_tree(FILE *file, dns_rbt_t *rbt,
dns_rbtdatawriter_t datawriter,
isc_uint32_t serial, isc_uint64_t *offset);
isc_uint32_t serial, long *offset);
/*%<
* Write out the RBT structure and its data to a file.
*
......
......@@ -143,14 +143,14 @@ static isc_result_t
write_header(FILE *file, dns_rbt_t *rbt, isc_uint64_t first_node_offset);
static isc_result_t
serialize_node(FILE *file, dns_rbtnode_t *node, isc_uint64_t left,
isc_uint64_t right, isc_uint64_t down,
isc_uint64_t parent, isc_uint64_t data);
serialize_node(FILE *file, dns_rbtnode_t *node, uintptr_t left,
uintptr_t right, uintptr_t down, uintptr_t parent,
uintptr_t data);
static isc_result_t
serialize_nodes(FILE *file, dns_rbtnode_t *node, isc_uint64_t parent,
serialize_nodes(FILE *file, dns_rbtnode_t *node, uintptr_t parent,
dns_rbtdatawriter_t datawriter, isc_uint32_t serial,
isc_uint64_t *where);
uintptr_t *where);
/*
* The following functions allow you to get the actual address of a pointer
* without having to use an if statement to check to see if that address is
......@@ -159,7 +159,7 @@ serialize_nodes(FILE *file, dns_rbtnode_t *node, isc_uint64_t parent,
static inline dns_rbtnode_t *
getparent(dns_rbtnode_t *node, file_header_t *header) {
char *adjusted_address = (char *)(node->parent);
adjusted_address += node->parent_is_relative * (isc_uint64_t)header;
adjusted_address += node->parent_is_relative * (uintptr_t)header;
return ((dns_rbtnode_t *)adjusted_address);
}
......@@ -167,7 +167,7 @@ getparent(dns_rbtnode_t *node, file_header_t *header) {
static inline dns_rbtnode_t *
getleft(dns_rbtnode_t *node, file_header_t *header) {
char *adjusted_address = (char *)(node->left);
adjusted_address += node->left_is_relative * (isc_uint64_t)header;
adjusted_address += node->left_is_relative * (uintptr_t)header;
return ((dns_rbtnode_t *)adjusted_address);
}
......@@ -175,7 +175,7 @@ getleft(dns_rbtnode_t *node, file_header_t *header) {
static inline dns_rbtnode_t *
getright(dns_rbtnode_t *node, file_header_t *header) {
char *adjusted_address = (char *)(node->right);
adjusted_address += node->right_is_relative * (isc_uint64_t)header;
adjusted_address += node->right_is_relative * (uintptr_t)header;
return ((dns_rbtnode_t *)adjusted_address);
}
......@@ -183,7 +183,7 @@ getright(dns_rbtnode_t *node, file_header_t *header) {
static inline dns_rbtnode_t *
getdown(dns_rbtnode_t *node, file_header_t *header) {
char *adjusted_address = (char *)(node->down);
adjusted_address += node->down_is_relative * (isc_uint64_t)header;
adjusted_address += node->down_is_relative * (uintptr_t)header;
return ((dns_rbtnode_t *)adjusted_address);
}
......@@ -191,7 +191,7 @@ getdown(dns_rbtnode_t *node, file_header_t *header) {
static inline dns_rbtnode_t *
getdata(dns_rbtnode_t *node, file_header_t *header) {
char *adjusted_address = (char *)(node->data);
adjusted_address += node->data_is_relative * (isc_uint64_t)header;
adjusted_address += node->data_is_relative * (uintptr_t)header;
return ((dns_rbtnode_t *)adjusted_address);
}
......@@ -428,12 +428,12 @@ write_header(FILE *file, dns_rbt_t *rbt, isc_uint64_t first_node_offset) {
}
static isc_result_t
serialize_node(FILE *file, dns_rbtnode_t *node, isc_uint64_t left,
isc_uint64_t right, isc_uint64_t down,
isc_uint64_t parent, isc_uint64_t data)
serialize_node(FILE *file, dns_rbtnode_t *node, uintptr_t left,
uintptr_t right, uintptr_t down, uintptr_t parent,
uintptr_t data)
{
dns_rbtnode_t temp_node;
isc_uint64_t file_position;
long file_position;
unsigned char *node_data;
size_t datasize;
isc_result_t result;
......@@ -492,12 +492,12 @@ serialize_node(FILE *file, dns_rbtnode_t *node, isc_uint64_t left,
}
static isc_result_t
serialize_nodes(FILE *file, dns_rbtnode_t *node, isc_uint64_t parent,
serialize_nodes(FILE *file, dns_rbtnode_t *node, uintptr_t parent,
dns_rbtdatawriter_t datawriter, isc_uint32_t serial,
isc_uint64_t *where)
uintptr_t *where)
{
isc_uint64_t left = 0, right = 0, down = 0, data = 0;
isc_uint64_t this_node_location = 0;
uintptr_t left = 0, right = 0, down = 0, data = 0;
long this_node_location = 0;
isc_uint64_t offset_adjust;
isc_result_t result;
......@@ -546,9 +546,9 @@ serialize_nodes(FILE *file, dns_rbtnode_t *node, isc_uint64_t parent,
return (result);
}
inline isc_uint64_t
dns_rbt_serialize_align(isc_uint64_t target) {
int offset = (isc_uint64_t)target % 8;
inline long
dns_rbt_serialize_align(long target) {
long offset = target % 8;
if (offset == 0)
return (target);
......@@ -559,7 +559,7 @@ dns_rbt_serialize_align(isc_uint64_t target) {
isc_result_t
dns_rbt_serialize_tree(FILE *file, dns_rbt_t *rbt,
dns_rbtdatawriter_t datawriter,
isc_uint32_t serial, isc_uint64_t *offset)
isc_uint32_t serial, long *offset)
{
isc_result_t result;
long header_position, node_position, end_position;
......
......@@ -1346,12 +1346,12 @@ update_newheader(rdatasetheader_t *new, rdatasetheader_t *old) {
if (old->next_is_relative) {
p = (char *) old;
p += (isc_uint64_t)old->next;
p += (uintptr_t)old->next;
new->next = (rdatasetheader_t *)p;
}
if (old->node_is_relative) {
p = (char *) old;
p += (isc_uint64_t)old->node;
p += (uintptr_t)old->node;
new->node = (dns_rbtnode_t *)p;
}
}
......@@ -7407,8 +7407,8 @@ rbtdb_zero_header(FILE *rbtfile) {
* itself that should be stored here.
*/
static isc_result_t
rbtdb_write_header(FILE *rbtfile, isc_uint64_t tree_location,
isc_uint64_t nsec_location, isc_uint64_t nsec3_location)
rbtdb_write_header(FILE *rbtfile, long tree_location, long nsec_location,
long nsec3_location)
{
rbtdb_file_header_t header;
isc_result_t result;
......@@ -7439,10 +7439,10 @@ serialize(dns_db_t *db, dns_dbversion_t *ver, FILE *rbtfile) {
rbtdb_version_t *version = (rbtdb_version_t *) ver;
dns_rbtdb_t *rbtdb;
isc_result_t result;
isc_uint64_t tree_location;
isc_uint64_t nsec_location;
isc_uint64_t nsec3_location;
isc_uint64_t rbtdb_header_location;
long tree_location;
long nsec_location;
long nsec3_location;
long rbtdb_header_location;
rbtdb = (dns_rbtdb_t *)db;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment