Commit 99d02c65 authored by Mark Andrews's avatar Mark Andrews

Clarify calculation precedence for '&' and '?'

parent a46e90b2
/*
* Copyright (C) 2012, 2015, 2016 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2012, 2015, 2016, 2018 Internet Systems Consortium, Inc. ("ISC")
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
......@@ -54,6 +54,7 @@ set_nxdomainstats(dns_stats_t *stats, isc_boolean_t stale) {
dns_rdatasetstats_increment(stats, which);
}
#define ATTRIBUTE_SET(y) ((attributes & (y)) != 0)
static void
checkit1(dns_rdatastatstype_t which, isc_uint64_t value, void *arg) {
unsigned int attributes;
......@@ -69,10 +70,10 @@ checkit1(dns_rdatastatstype_t which, isc_uint64_t value, void *arg) {
type = DNS_RDATASTATSTYPE_BASE(which);
fprintf(stderr, "%s%s%s%s/%u, %u\n",
attributes & DNS_RDATASTATSTYPE_ATTR_OTHERTYPE ? "O" : " ",
attributes & DNS_RDATASTATSTYPE_ATTR_NXRRSET ? "!" : " ",
attributes & DNS_RDATASTATSTYPE_ATTR_STALE ? "#" : " ",
attributes & DNS_RDATASTATSTYPE_ATTR_NXDOMAIN ? "X" : " ",
ATTRIBUTE_SET(DNS_RDATASTATSTYPE_ATTR_OTHERTYPE) ? "O" : " ",
ATTRIBUTE_SET(DNS_RDATASTATSTYPE_ATTR_NXRRSET) ? "!" : " ",
ATTRIBUTE_SET(DNS_RDATASTATSTYPE_ATTR_STALE) ? "#" : " ",
ATTRIBUTE_SET(DNS_RDATASTATSTYPE_ATTR_NXDOMAIN) ? "X" : " ",
type, (unsigned)value);
#endif
if ((attributes & DNS_RDATASTATSTYPE_ATTR_STALE) == 0)
......@@ -96,10 +97,10 @@ checkit2(dns_rdatastatstype_t which, isc_uint64_t value, void *arg) {
type = DNS_RDATASTATSTYPE_BASE(which);
fprintf(stderr, "%s%s%s%s/%u, %u\n",
attributes & DNS_RDATASTATSTYPE_ATTR_OTHERTYPE ? "O" : " ",
attributes & DNS_RDATASTATSTYPE_ATTR_NXRRSET ? "!" : " ",
attributes & DNS_RDATASTATSTYPE_ATTR_STALE ? "#" : " ",
attributes & DNS_RDATASTATSTYPE_ATTR_NXDOMAIN ? "X" : " ",
ATTRIBUTE_SET(DNS_RDATASTATSTYPE_ATTR_OTHERTYPE) ? "O" : " ",
ATTRIBUTE_SET(DNS_RDATASTATSTYPE_ATTR_NXRRSET) ? "!" : " ",
ATTRIBUTE_SET(DNS_RDATASTATSTYPE_ATTR_STALE) ? "#" : " ",
ATTRIBUTE_SET(DNS_RDATASTATSTYPE_ATTR_NXDOMAIN) ? "X" : " ",
type, (unsigned)value);
#endif
if ((attributes & DNS_RDATASTATSTYPE_ATTR_STALE) == 0)
......
......@@ -3697,7 +3697,7 @@
./lib/dns/tests/rbt_test.c C 2012,2013,2014,2015,2016,2017
./lib/dns/tests/rdata_test.c C 2012,2013,2015,2016,2017
./lib/dns/tests/rdataset_test.c C 2012,2016
./lib/dns/tests/rdatasetstats_test.c C 2012,2015,2016
./lib/dns/tests/rdatasetstats_test.c C 2012,2015,2016,2018
./lib/dns/tests/rsa_test.c C 2016
./lib/dns/tests/testdata/dbiterator/zone1.data ZONE 2011,2012,2016
./lib/dns/tests/testdata/dbiterator/zone2.data X 2011
......
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