Commit 6343df71 authored by Mark Andrews's avatar Mark Andrews
Browse files

silence signed vs unsigned

parent ba5c73b3
...@@ -7462,7 +7462,7 @@ init_file_version(void) { ...@@ -7462,7 +7462,7 @@ init_file_version(void) {
memset(FILE_VERSION, 0, sizeof(FILE_VERSION)); memset(FILE_VERSION, 0, sizeof(FILE_VERSION));
n = snprintf(FILE_VERSION, sizeof(FILE_VERSION), n = snprintf(FILE_VERSION, sizeof(FILE_VERSION),
"RBTDB Image %s %s", dns_major, dns_mapapi); "RBTDB Image %s %s", dns_major, dns_mapapi);
INSIST(n < sizeof(FILE_VERSION)); INSIST(n > 0 && (unsigned int)n < sizeof(FILE_VERSION));
} }
/* /*
......
...@@ -351,7 +351,7 @@ ATF_TC_BODY(rbt_check_distance_random, tc) { ...@@ -351,7 +351,7 @@ ATF_TC_BODY(rbt_check_distance_random, tc) {
* 2log(n). This check verifies that the tree is balanced. * 2log(n). This check verifies that the tree is balanced.
*/ */
dns_rbt_t *mytree = NULL; dns_rbt_t *mytree = NULL;
const int log_num_nodes = 16; const unsigned int log_num_nodes = 16;
int i; int i;
isc_result_t result; isc_result_t result;
...@@ -407,12 +407,12 @@ ATF_TC_BODY(rbt_check_distance_random, tc) { ...@@ -407,12 +407,12 @@ ATF_TC_BODY(rbt_check_distance_random, tc) {
} }
/* 1 (root . node) + (1 << log_num_nodes) */ /* 1 (root . node) + (1 << log_num_nodes) */
ATF_CHECK_EQ(1 + (1 << log_num_nodes), dns_rbt_nodecount(mytree)); ATF_CHECK_EQ(1U + (1U << log_num_nodes), dns_rbt_nodecount(mytree));
/* The distance from each node to its sub-tree root must be less /* The distance from each node to its sub-tree root must be less
* than 2 * log(n). * than 2 * log(n).
*/ */
ATF_CHECK((2 * log_num_nodes) >= dns__rbt_getheight(mytree)); ATF_CHECK((2U * log_num_nodes) >= dns__rbt_getheight(mytree));
/* Also check RB tree properties */ /* Also check RB tree properties */
tree_ok = dns__rbt_checkproperties(mytree); tree_ok = dns__rbt_checkproperties(mytree);
...@@ -435,7 +435,7 @@ ATF_TC_BODY(rbt_check_distance_ordered, tc) { ...@@ -435,7 +435,7 @@ ATF_TC_BODY(rbt_check_distance_ordered, tc) {
* 2log(n). This check verifies that the tree is balanced. * 2log(n). This check verifies that the tree is balanced.
*/ */
dns_rbt_t *mytree = NULL; dns_rbt_t *mytree = NULL;
const int log_num_nodes = 16; const unsigned int log_num_nodes = 16;
int i; int i;
isc_result_t result; isc_result_t result;
...@@ -479,12 +479,12 @@ ATF_TC_BODY(rbt_check_distance_ordered, tc) { ...@@ -479,12 +479,12 @@ ATF_TC_BODY(rbt_check_distance_ordered, tc) {
} }
/* 1 (root . node) + (1 << log_num_nodes) */ /* 1 (root . node) + (1 << log_num_nodes) */
ATF_CHECK_EQ(1 + (1 << log_num_nodes), dns_rbt_nodecount(mytree)); ATF_CHECK_EQ(1U + (1U << log_num_nodes), dns_rbt_nodecount(mytree));
/* The distance from each node to its sub-tree root must be less /* The distance from each node to its sub-tree root must be less
* than 2 * log(n). * than 2 * log(n).
*/ */
ATF_CHECK((2 * log_num_nodes) >= dns__rbt_getheight(mytree)); ATF_CHECK((2U * log_num_nodes) >= dns__rbt_getheight(mytree));
/* Also check RB tree properties */ /* Also check RB tree properties */
tree_ok = dns__rbt_checkproperties(mytree); tree_ok = dns__rbt_checkproperties(mytree);
......
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