memset(FILE_VERSION, 0, sizeof(FILE_VERSION));
n = snprintf(FILE_VERSION, sizeof(FILE_VERSION),
"RBTDB Image %s %s", dns_major, dns_mapapi);
- INSIST(n < sizeof(FILE_VERSION));
+ INSIST(n > 0 && (unsigned int)n < sizeof(FILE_VERSION));
}
/*
* 2log(n). This check verifies that the tree is balanced.
*/
dns_rbt_t *mytree = NULL;
- const int log_num_nodes = 16;
+ const unsigned int log_num_nodes = 16;
int i;
isc_result_t result;
}
/* 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
* 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 */
tree_ok = dns__rbt_checkproperties(mytree);
* 2log(n). This check verifies that the tree is balanced.
*/
dns_rbt_t *mytree = NULL;
- const int log_num_nodes = 16;
+ const unsigned int log_num_nodes = 16;
int i;
isc_result_t result;
}
/* 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
* 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 */
tree_ok = dns__rbt_checkproperties(mytree);