]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
[master] address windows build warnings
authorEvan Hunt <each@isc.org>
Thu, 28 Mar 2013 22:37:47 +0000 (15:37 -0700)
committerEvan Hunt <each@isc.org>
Thu, 28 Mar 2013 22:37:47 +0000 (15:37 -0700)
bin/named/query.c
lib/dns/include/dns/rrl.h
lib/dns/rpz.c
lib/dns/rrl.c

index 85ecc6b3b78848d5626bef3dc4c84e2a15911dfb..b9d4891f9d0a07206ddf4c03b1cc72a6aa139f65 100644 (file)
@@ -4729,7 +4729,7 @@ rpz_rewrite_name(ns_client_t *client, dns_name_t *trig_name,
         * the bit mask of policy zones with policies for this trigger name.
         *      x&-x is the least significant bit set in x
         */
-       if (zbits != (zbits & -zbits)) {
+       if (zbits != (zbits & (~zbits + 1))) {
                zbits = dns_rpz_find_name(client->view->rpzs,
                                          rpz_type, zbits, trig_name);
                if (zbits == 0)
index d6974b7387d0ba8c603f63c17e321ea6e25dc1b9..4cabfa84c95751741f6146a5690dc1f96f6b448e 100644 (file)
@@ -94,7 +94,7 @@ union dns_rrl_key {
                isc_uint32_t        ip[DNS_RRL_MAX_PREFIX/32];
                isc_uint32_t        qname_hash;
                dns_rdatatype_t     qtype;
-               isc_uint8_t         qclass;
+               isc_uint8_t         qclass;
                dns_rrl_rtype_t     rtype   :4; /* 3 bits + sign bit */
                isc_boolean_t       ipv6    :1;
        } s;
index 628a331e36717043710d90cc1271667a226ec61f..9a5b33672436ed1b0b3af7f99b5fb91d335d2392 100644 (file)
@@ -834,7 +834,7 @@ trim_zbits(dns_rpz_zbits_t zbits, dns_rpz_zbits_t found) {
         * Make a mask of that bit and all smaller numbered bits.
         */
        x = zbits & found;
-       x &= -x;
+       x &= (~x + 1);
        x = (x << 1) - 1;
        return (zbits &= x);
 }
index d23ef21d18c5ca0b2d8ef90cefb0eca1c159d13d..cd07cf2838a76d780d96a83ccec52d06c009720f 100644 (file)
@@ -404,7 +404,7 @@ make_key(const dns_rrl_t *rrl, dns_rrl_key_t *key,
 
        key->s.rtype = rtype;
        if (rtype == DNS_RRL_RTYPE_QUERY || rtype == DNS_RRL_RTYPE_DELEGATION) {
-               key->s.qclass = qclass;
+               key->s.qclass = qclass & 0xff;
                key->s.qtype = qtype;
        }
 
@@ -645,7 +645,7 @@ debit_rrl_entry(dns_rrl_t *rrl, dns_rrl_entry_t *e, double qps, double scale,
                }
        }
        if (scale < 1.0) {
-               new_rate = rate * scale;
+               new_rate = (int) (rate * scale);
                if (new_rate < 1)
                        new_rate = 1;
                if (*ratep != new_rate) {
@@ -738,7 +738,7 @@ debit_rrl_entry(dns_rrl_t *rrl, dns_rrl_entry_t *e, double qps, double scale,
         */
        slip = rrl->slip;
        if (slip > 2 && scale < 1.0) {
-               new_slip = slip * scale;
+               new_slip = (int) (slip * scale);
                if (new_slip < 2)
                        new_slip = 2;
                if (rrl->scaled_slip != new_slip) {
@@ -759,7 +759,7 @@ debit_rrl_entry(dns_rrl_t *rrl, dns_rrl_entry_t *e, double qps, double scale,
                        if (isc_log_wouldlog(dns_lctx, DNS_RRL_LOG_DEBUG3))
                                debit_log(e, age, "slip");
                        return (DNS_RRL_RESULT_SLIP);
-               } else if (e->slip_cnt >= slip) {
+               } else if ((int) e->slip_cnt >= slip) {
                        e->slip_cnt = 0;
                }
        }