From: Evan Hunt Date: Thu, 28 Mar 2013 22:37:47 +0000 (-0700) Subject: [master] address windows build warnings X-Git-Tag: v9.10.0a1~448^2~10 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=73b3019760ed11af0598135c72739f4a98c95fe8;p=thirdparty%2Fbind9.git [master] address windows build warnings --- diff --git a/bin/named/query.c b/bin/named/query.c index 85ecc6b3b78..b9d4891f9d0 100644 --- a/bin/named/query.c +++ b/bin/named/query.c @@ -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) diff --git a/lib/dns/include/dns/rrl.h b/lib/dns/include/dns/rrl.h index d6974b7387d..4cabfa84c95 100644 --- a/lib/dns/include/dns/rrl.h +++ b/lib/dns/include/dns/rrl.h @@ -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; diff --git a/lib/dns/rpz.c b/lib/dns/rpz.c index 628a331e367..9a5b3367243 100644 --- a/lib/dns/rpz.c +++ b/lib/dns/rpz.c @@ -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); } diff --git a/lib/dns/rrl.c b/lib/dns/rrl.c index d23ef21d18c..cd07cf2838a 100644 --- a/lib/dns/rrl.c +++ b/lib/dns/rrl.c @@ -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; } }