]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
silence signed vs unsigned
authorMark Andrews <marka@isc.org>
Tue, 24 Jun 2014 14:19:17 +0000 (00:19 +1000)
committerMark Andrews <marka@isc.org>
Tue, 24 Jun 2014 14:19:17 +0000 (00:19 +1000)
lib/dns/rbtdb.c
lib/dns/tests/rbt_test.c

index b9fb3f339df2005682419c36771a40821ddb8c81..28815cede2f7ce117f038b9d820eb265958c6875 100644 (file)
@@ -7462,7 +7462,7 @@ init_file_version(void) {
        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));
 }
 
 /*
index d2df4e511684e91634a2d7a87c7af21a538c89e9..7b2f42d72273bef11e5bd9969b57a99a4866db87 100644 (file)
@@ -351,7 +351,7 @@ ATF_TC_BODY(rbt_check_distance_random, tc) {
         * 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;
@@ -407,12 +407,12 @@ ATF_TC_BODY(rbt_check_distance_random, tc) {
        }
 
        /* 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);
@@ -435,7 +435,7 @@ ATF_TC_BODY(rbt_check_distance_ordered, tc) {
         * 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;
@@ -479,12 +479,12 @@ ATF_TC_BODY(rbt_check_distance_ordered, tc) {
        }
 
        /* 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);