Commit 73b30197 authored by Evan Hunt's avatar Evan Hunt
Browse files

[master] address windows build warnings

parent df4ebd82
......@@ -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)
......
......@@ -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;
......
......@@ -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);
}
......
......@@ -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;
}
}
......
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