From: Alessio Podda Date: Tue, 9 Dec 2025 16:41:33 +0000 (+0100) Subject: Fix formatting after refactor X-Git-Tag: v9.21.17~43^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4d698ee0e3d944662ce54192eb5ee5a738a272c2;p=thirdparty%2Fbind9.git Fix formatting after refactor The removal of the foundname and name parameters from various qp.c functions led to formatting issues. Restore the correct formatting via clang-format. --- diff --git a/lib/dns/forward.c b/lib/dns/forward.c index 795d67f644c..84efbc47725 100644 --- a/lib/dns/forward.c +++ b/lib/dns/forward.c @@ -163,8 +163,8 @@ dns_fwdtable_find(dns_fwdtable_t *fwdtable, const dns_name_t *name, REQUIRE(VALID_FWDTABLE(fwdtable)); dns_qpmulti_query(fwdtable->table, &qpr); - result = dns_qp_lookup(&qpr, name, DNS_DBNAMESPACE_NORMAL, NULL, - NULL, &pval, NULL); + result = dns_qp_lookup(&qpr, name, DNS_DBNAMESPACE_NORMAL, NULL, NULL, + &pval, NULL); if (result == ISC_R_SUCCESS || result == DNS_R_PARTIALMATCH) { dns_forwarders_t *fwdrs = pval; *forwardersp = fwdrs; diff --git a/lib/dns/include/dns/qp.h b/lib/dns/include/dns/qp.h index 00dc4610670..b88451a64da 100644 --- a/lib/dns/include/dns/qp.h +++ b/lib/dns/include/dns/qp.h @@ -541,8 +541,8 @@ dns_qp_getname(dns_qpreadable_t qpr, const dns_name_t *name, isc_result_t dns_qp_lookup(dns_qpreadable_t qpr, const dns_name_t *name, - dns_namespace_t space, dns_qpiter_t *iter, - dns_qpchain_t *chain, void **pval_r, uint32_t *ival_r); + dns_namespace_t space, dns_qpiter_t *iter, dns_qpchain_t *chain, + void **pval_r, uint32_t *ival_r); /*%< * Look up a leaf in a qp-trie that is equal to, or an ancestor domain of, * 'name' in the namespace 'space'. @@ -679,7 +679,6 @@ dns_qpiter_prev(dns_qpiter_t *qpi, void **pval_r, uint32_t *ival_r); * \li ISC_R_NOMORE otherwise */ - isc_result_t dns_qpiter_current(dns_qpiter_t *qpi, void **pval_r, uint32_t *ival_r); /*%< @@ -697,7 +696,6 @@ dns_qpiter_current(dns_qpiter_t *qpi, void **pval_r, uint32_t *ival_r); * at a leaf node */ - void dns_qpchain_init(dns_qpreadable_t qpr, dns_qpchain_t *chain); /*%< @@ -718,8 +716,8 @@ dns_qpchain_length(dns_qpchain_t *chain); */ void -dns_qpchain_node(dns_qpchain_t *chain, unsigned int level, - void **pval_r, uint32_t *ival_r); +dns_qpchain_node(dns_qpchain_t *chain, unsigned int level, void **pval_r, + uint32_t *ival_r); /*%< * Sets 'name' to the name of the leaf referenced at `chain->stack[level]`. * diff --git a/lib/dns/keytable.c b/lib/dns/keytable.c index 04fe2277b7c..21b9e955e48 100644 --- a/lib/dns/keytable.c +++ b/lib/dns/keytable.c @@ -511,8 +511,8 @@ dns_keytable_finddeepestmatch(dns_keytable_t *keytable, const dns_name_t *name, REQUIRE(foundname != NULL); dns_qpmulti_query(keytable->table, &qpr); - result = dns_qp_lookup(&qpr, name, DNS_DBNAMESPACE_NORMAL, NULL, - NULL, &pval, NULL); + result = dns_qp_lookup(&qpr, name, DNS_DBNAMESPACE_NORMAL, NULL, NULL, + &pval, NULL); keynode = pval; if (result == ISC_R_SUCCESS || result == DNS_R_PARTIALMATCH) { @@ -541,8 +541,8 @@ dns_keytable_issecuredomain(dns_keytable_t *keytable, const dns_name_t *name, REQUIRE(dns_name_isabsolute(name)); dns_qpmulti_query(keytable->table, &qpr); - result = dns_qp_lookup(&qpr, name, DNS_DBNAMESPACE_NORMAL, NULL, - NULL, &pval, NULL); + result = dns_qp_lookup(&qpr, name, DNS_DBNAMESPACE_NORMAL, NULL, NULL, + &pval, NULL); if (result == ISC_R_SUCCESS || result == DNS_R_PARTIALMATCH) { keynode = pval; if (foundname != NULL) { diff --git a/lib/dns/nametree.c b/lib/dns/nametree.c index 41387bdf67b..987b0cbeab8 100644 --- a/lib/dns/nametree.c +++ b/lib/dns/nametree.c @@ -283,8 +283,8 @@ dns_nametree_covered(dns_nametree_t *nametree, const dns_name_t *name, REQUIRE(VALID_NAMETREE(nametree)); dns_qpmulti_query(nametree->table, &qpr); - result = dns_qp_lookup(&qpr, name, DNS_DBNAMESPACE_NORMAL, NULL, - NULL, (void **)&node, NULL); + result = dns_qp_lookup(&qpr, name, DNS_DBNAMESPACE_NORMAL, NULL, NULL, + (void **)&node, NULL); if (result == ISC_R_SUCCESS || result == DNS_R_PARTIALMATCH) { if (found != NULL) { dns_name_copy(&node->name, found); diff --git a/lib/dns/nta.c b/lib/dns/nta.c index e4cf9ab46d6..39c6242e7b3 100644 --- a/lib/dns/nta.c +++ b/lib/dns/nta.c @@ -413,8 +413,8 @@ dns_ntatable_covered(dns_ntatable_t *ntatable, isc_stdtime_t now, RWLOCK(&ntatable->rwlock, isc_rwlocktype_read); dns_qpmulti_query(ntatable->table, &qpr); - result = dns_qp_lookup(&qpr, name, DNS_DBNAMESPACE_NORMAL, NULL, - NULL, &pval, NULL); + result = dns_qp_lookup(&qpr, name, DNS_DBNAMESPACE_NORMAL, NULL, NULL, + &pval, NULL); nta = pval; switch (result) { diff --git a/lib/dns/qp.c b/lib/dns/qp.c index b38ee5f5c2d..3317514f25d 100644 --- a/lib/dns/qp.c +++ b/lib/dns/qp.c @@ -1881,8 +1881,8 @@ dns_qpchain_length(dns_qpchain_t *chain) { } void -dns_qpchain_node(dns_qpchain_t *chain, unsigned int level, - void **pval_r, uint32_t *ival_r) { +dns_qpchain_node(dns_qpchain_t *chain, unsigned int level, void **pval_r, + uint32_t *ival_r) { dns_qpnode_t *node = NULL; REQUIRE(QPCHAIN_VALID(chain)); @@ -2029,8 +2029,6 @@ dns_qpiter_prev(dns_qpiter_t *qpi, void **pval_r, uint32_t *ival_r) { return iterate(false, qpi, pval_r, ival_r); } - - isc_result_t dns_qpiter_current(dns_qpiter_t *qpi, void **pval_r, uint32_t *ival_r) { dns_qpnode_t *node = NULL; @@ -2047,7 +2045,6 @@ dns_qpiter_current(dns_qpiter_t *qpi, void **pval_r, uint32_t *ival_r) { return ISC_R_SUCCESS; } - /*********************************************************************** * * search @@ -2271,8 +2268,8 @@ fix_chain(dns_qpchain_t *chain, size_t offset) { isc_result_t dns_qp_lookup(dns_qpreadable_t qpr, const dns_name_t *name, - dns_namespace_t space, dns_qpiter_t *iter, - dns_qpchain_t *chain, void **pval_r, uint32_t *ival_r) { + dns_namespace_t space, dns_qpiter_t *iter, dns_qpchain_t *chain, + void **pval_r, uint32_t *ival_r) { dns_qpreader_t *qp = dns_qpreader(qpr); dns_qpkey_t search, found; size_t searchlen, foundlen; diff --git a/lib/dns/qp_p.h b/lib/dns/qp_p.h index 6ce46f3c221..ef9f1e33621 100644 --- a/lib/dns/qp_p.h +++ b/lib/dns/qp_p.h @@ -945,7 +945,6 @@ extern uint8_t dns_qp_byte_for_bit[]; /**********************************************************************/ - void dns__qp_initialize(void); void diff --git a/lib/dns/qpcache.c b/lib/dns/qpcache.c index 660d592da13..50218a3e25e 100644 --- a/lib/dns/qpcache.c +++ b/lib/dns/qpcache.c @@ -1637,8 +1637,7 @@ qpcache_find(dns_db_t *db, const dns_name_t *name, dns_dbversion_t *version, isc_result_t zcresult; qpcnode_t *encloser = NULL; - dns_qpchain_node(&search.chain, i, (void **)&encloser, - NULL); + dns_qpchain_node(&search.chain, i, (void **)&encloser, NULL); zcresult = check_zonecut(encloser, (void *)&search DNS__DB_FLARG_PASS); @@ -2072,8 +2071,8 @@ qpcache_findzonecut(dns_db_t *db, const dns_name_t *name, unsigned int options, INSIST(len >= 2); node = NULL; - dns_qpchain_node(&search.chain, len - 2, - (void **)&node, NULL); + dns_qpchain_node(&search.chain, len - 2, (void **)&node, + NULL); search.chain.len = len - 1; } @@ -3516,8 +3515,8 @@ resume_iteration(qpc_dbit_t *qpdbiter, bool continuing) { if (continuing && qpdbiter->node != NULL) { isc_result_t result; result = dns_qp_lookup(qpdb->tree, qpdbiter->name, - DNS_DBNAMESPACE_NORMAL, - &qpdbiter->iter, NULL, NULL, NULL); + DNS_DBNAMESPACE_NORMAL, &qpdbiter->iter, + NULL, NULL, NULL); INSIST(result == ISC_R_SUCCESS); } @@ -3567,8 +3566,8 @@ dbiterator_first(dns_dbiterator_t *iterator DNS__DB_FLARG) { dereference_iter_node(qpdbiter DNS__DB_FLARG_PASS); dns_qpiter_init(qpdb->tree, &qpdbiter->iter); - result = dns_qpiter_next(&qpdbiter->iter, - (void **)&qpdbiter->node, NULL); + result = dns_qpiter_next(&qpdbiter->iter, (void **)&qpdbiter->node, + NULL); if (result == ISC_R_SUCCESS && qpdbiter->node->nspace == DNS_DBNAMESPACE_NORMAL) @@ -3657,8 +3656,8 @@ dbiterator_next(dns_dbiterator_t *iterator DNS__DB_FLARG) { dereference_iter_node(qpdbiter DNS__DB_FLARG_PASS); - result = dns_qpiter_next(&qpdbiter->iter, - (void **)&qpdbiter->node, NULL); + result = dns_qpiter_next(&qpdbiter->iter, (void **)&qpdbiter->node, + NULL); if (result == ISC_R_SUCCESS && qpdbiter->node->nspace == DNS_DBNAMESPACE_NORMAL) diff --git a/lib/dns/qpzone.c b/lib/dns/qpzone.c index 44a5addfb5a..9a3273ddfd1 100644 --- a/lib/dns/qpzone.c +++ b/lib/dns/qpzone.c @@ -2876,8 +2876,8 @@ find_wildcard(qpz_search_t *search, qpznode_t **nodep, const dns_name_t *qname, } result = dns_qp_lookup(&search->qpr, wname, nspace, - &wit, NULL, - (void **)&wnode, NULL); + &wit, NULL, (void **)&wnode, + NULL); if (result == ISC_R_SUCCESS) { /* * We have found the wildcard node. If it @@ -2973,7 +2973,8 @@ previous_closest_nsec(dns_rdatatype_t type, qpz_search_t *search, * NSEC record; we want the previous node * in the NSEC tree. */ - result = dns_qpiter_prev(nit, (void **)&node, NULL); + result = dns_qpiter_prev(nit, (void **)&node, + NULL); if (result == ISC_R_SUCCESS) { dns_name_copy(&node->name, name); } @@ -2984,7 +2985,8 @@ previous_closest_nsec(dns_rdatatype_t type, qpz_search_t *search, * node in the NSEC namespace, which is * what we want. */ - isc_result_t iresult = dns_qpiter_current(nit, (void **)&node, NULL); + isc_result_t iresult = dns_qpiter_current( + nit, (void **)&node, NULL); if (iresult == ISC_R_SUCCESS) { dns_name_copy(&node->name, name); } @@ -3009,9 +3011,9 @@ previous_closest_nsec(dns_rdatatype_t type, qpz_search_t *search, } *nodep = NULL; - result = dns_qp_lookup( - &search->qpr, name, DNS_DBNAMESPACE_NORMAL, - &search->iter, &search->chain, (void **)nodep, NULL); + result = dns_qp_lookup(&search->qpr, name, + DNS_DBNAMESPACE_NORMAL, &search->iter, + &search->chain, (void **)nodep, NULL); if (result == ISC_R_SUCCESS) { break; } @@ -3177,8 +3179,7 @@ again: } while (empty_node && result == ISC_R_SUCCESS); if (result == ISC_R_NOMORE && wraps) { - result = dns_qpiter_prev(&search->iter, (void **)&node, - NULL); + result = dns_qpiter_prev(&search->iter, (void **)&node, NULL); if (result == ISC_R_SUCCESS) { dns_name_copy(&node->name, name); wraps = false; @@ -4153,8 +4154,8 @@ dbiterator_first(dns_dbiterator_t *iterator DNS__DB_FLARG) { dereference_iter_node(qpdbiter DNS__DB_FLARG_PASS); dns_qpiter_init(qpdbiter->snap, &qpdbiter->iter); - result = dns_qpiter_next(&qpdbiter->iter, - (void **)&qpdbiter->node, NULL); + result = dns_qpiter_next(&qpdbiter->iter, (void **)&qpdbiter->node, + NULL); switch (qpdbiter->nsec3mode) { case nonsec3: @@ -4199,9 +4200,8 @@ dbiterator_first(dns_dbiterator_t *iterator DNS__DB_FLARG) { * origin node. */ result = dns_qp_lookup(qpdbiter->snap, &qpdb->common.origin, - DNS_DBNAMESPACE_NSEC3, - &qpdbiter->iter, NULL, - (void **)&qpdbiter->node, NULL); + DNS_DBNAMESPACE_NSEC3, &qpdbiter->iter, + NULL, (void **)&qpdbiter->node, NULL); if (result != ISC_R_SUCCESS || QPDBITER_NSEC3_ORIGIN_NODE(qpdb, qpdbiter)) { @@ -4241,8 +4241,8 @@ dbiterator_last(dns_dbiterator_t *iterator DNS__DB_FLARG) { dereference_iter_node(qpdbiter DNS__DB_FLARG_PASS); dns_qpiter_init(qpdbiter->snap, &qpdbiter->iter); - result = dns_qpiter_prev(&qpdbiter->iter, - (void **)&qpdbiter->node, NULL); + result = dns_qpiter_prev(&qpdbiter->iter, (void **)&qpdbiter->node, + NULL); switch (qpdbiter->nsec3mode) { case nsec3only: @@ -4289,9 +4289,8 @@ dbiterator_last(dns_dbiterator_t *iterator DNS__DB_FLARG) { * The final non-nsec node is before the the NSEC origin node. */ result = dns_qp_lookup(qpdbiter->snap, &qpdb->common.origin, - DNS_DBNAMESPACE_NSEC, - &qpdbiter->iter, NULL, - (void **)&qpdbiter->node, NULL); + DNS_DBNAMESPACE_NSEC, &qpdbiter->iter, + NULL, (void **)&qpdbiter->node, NULL); if (result == ISC_R_SUCCESS) { INSIST(QPDBITER_NSEC_ORIGIN_NODE(qpdb, qpdbiter)); /* skip the NSEC origin node */ @@ -4343,19 +4342,19 @@ dbiterator_seek(dns_dbiterator_t *iterator, switch (qpdbiter->nsec3mode) { case nsec3only: - result = dns_qp_lookup( - qpdbiter->snap, name, DNS_DBNAMESPACE_NSEC3, - &qpdbiter->iter, NULL, (void **)&qpdbiter->node, NULL); + result = dns_qp_lookup(qpdbiter->snap, name, + DNS_DBNAMESPACE_NSEC3, &qpdbiter->iter, + NULL, (void **)&qpdbiter->node, NULL); break; case nonsec3: - result = dns_qp_lookup( - qpdbiter->snap, name, DNS_DBNAMESPACE_NORMAL, - &qpdbiter->iter, NULL, (void **)&qpdbiter->node, NULL); + result = dns_qp_lookup(qpdbiter->snap, name, + DNS_DBNAMESPACE_NORMAL, &qpdbiter->iter, + NULL, (void **)&qpdbiter->node, NULL); break; case full: - result = dns_qp_lookup( - qpdbiter->snap, name, DNS_DBNAMESPACE_NORMAL, - &qpdbiter->iter, NULL, (void **)&qpdbiter->node, NULL); + result = dns_qp_lookup(qpdbiter->snap, name, + DNS_DBNAMESPACE_NORMAL, &qpdbiter->iter, + NULL, (void **)&qpdbiter->node, NULL); if (result != ISC_R_SUCCESS) { tresult = dns_qp_lookup(qpdbiter->snap, name, DNS_DBNAMESPACE_NSEC3, @@ -4403,8 +4402,8 @@ dbiterator_prev(dns_dbiterator_t *iterator DNS__DB_FLARG) { node = qpdbiter->node; qpdbiter->node = NULL; - result = dns_qpiter_prev(&qpdbiter->iter, - (void **)&qpdbiter->node, NULL); + result = dns_qpiter_prev(&qpdbiter->iter, (void **)&qpdbiter->node, + NULL); switch (qpdbiter->nsec3mode) { case nsec3only: @@ -4446,9 +4445,8 @@ dbiterator_prev(dns_dbiterator_t *iterator DNS__DB_FLARG) { INSIST(qpdbiter->node->nspace == DNS_DBNAMESPACE_NSEC); result = dns_qp_lookup(qpdbiter->snap, &qpdb->common.origin, - DNS_DBNAMESPACE_NSEC, - &qpdbiter->iter, NULL, - (void **)&qpdbiter->node, NULL); + DNS_DBNAMESPACE_NSEC, &qpdbiter->iter, + NULL, (void **)&qpdbiter->node, NULL); if (result == ISC_R_SUCCESS) { INSIST(QPDBITER_NSEC_ORIGIN_NODE(qpdb, qpdbiter)); @@ -4516,8 +4514,8 @@ dbiterator_next(dns_dbiterator_t *iterator DNS__DB_FLARG) { node = qpdbiter->node; qpdbiter->node = NULL; - result = dns_qpiter_next(&qpdbiter->iter, - (void **)&qpdbiter->node, NULL); + result = dns_qpiter_next(&qpdbiter->iter, (void **)&qpdbiter->node, + NULL); switch (qpdbiter->nsec3mode) { case nonsec3: @@ -4553,9 +4551,8 @@ dbiterator_next(dns_dbiterator_t *iterator DNS__DB_FLARG) { INSIST(qpdbiter->node->nspace == DNS_DBNAMESPACE_NSEC); result = dns_qp_lookup(qpdbiter->snap, &qpdb->common.origin, - DNS_DBNAMESPACE_NSEC3, - &qpdbiter->iter, NULL, - (void **)&qpdbiter->node, NULL); + DNS_DBNAMESPACE_NSEC3, &qpdbiter->iter, + NULL, (void **)&qpdbiter->node, NULL); if (result != ISC_R_SUCCESS || QPDBITER_NSEC3_ORIGIN_NODE(qpdb, qpdbiter)) { @@ -4666,8 +4663,8 @@ qpzone_createiterator(dns_db_t *db, unsigned int options, * seek the NSEC3 origin node. */ result = dns_qp_lookup(iter->snap, &qpdb->common.origin, - DNS_DBNAMESPACE_NSEC3, &iter->iter, - NULL, NULL, NULL); + DNS_DBNAMESPACE_NSEC3, &iter->iter, NULL, + NULL, NULL); INSIST(result == ISC_R_SUCCESS); break; default: diff --git a/lib/dns/rpz.c b/lib/dns/rpz.c index 676917d517f..a7a9408438c 100644 --- a/lib/dns/rpz.c +++ b/lib/dns/rpz.c @@ -2496,8 +2496,8 @@ dns_rpz_find_name(dns_rpz_zones_t *rpzs, dns_rpz_type_t rpz_type, dns_qpmulti_query(rpzs->table, &qpr); dns_qpchain_init(&qpr, &chain); - result = dns_qp_lookup(&qpr, trig_name, DNS_DBNAMESPACE_NORMAL, - NULL, &chain, (void **)&data, NULL); + result = dns_qp_lookup(&qpr, trig_name, DNS_DBNAMESPACE_NORMAL, NULL, + &chain, (void **)&data, NULL); switch (result) { case ISC_R_SUCCESS: INSIST(data != NULL); diff --git a/lib/dns/zt.c b/lib/dns/zt.c index 831fb7190fa..f946a87da1e 100644 --- a/lib/dns/zt.c +++ b/lib/dns/zt.c @@ -183,15 +183,14 @@ dns_zt_find(dns_zt_t *zt, const dns_name_t *name, dns_ztfind_t options, result = dns_qp_getname(&qpr, name, DNS_DBNAMESPACE_NORMAL, &pval, NULL); } else { - result = dns_qp_lookup(&qpr, name, DNS_DBNAMESPACE_NORMAL, - NULL, &chain, &pval, NULL); + result = dns_qp_lookup(&qpr, name, DNS_DBNAMESPACE_NORMAL, NULL, + &chain, &pval, NULL); if (exactopts == DNS_ZTFIND_NOEXACT && result == ISC_R_SUCCESS) { /* get pval from the previous chain link */ int len = dns_qpchain_length(&chain); if (len >= 2) { - dns_qpchain_node(&chain, len - 2, &pval, - NULL); + dns_qpchain_node(&chain, len - 2, &pval, NULL); result = DNS_R_PARTIALMATCH; } else { result = ISC_R_NOTFOUND; diff --git a/tests/bench/qplookups.c b/tests/bench/qplookups.c index 4617c1b84d4..b1e19c0952e 100644 --- a/tests/bench/qplookups.c +++ b/tests/bench/qplookups.c @@ -239,8 +239,8 @@ main(int argc, char **argv) { start = isc_time_monotonic(); for (i = 0; i < n; i++) { name = dns_fixedname_name(&items[i]); - dns_qp_lookup(qp, name, DNS_DBNAMESPACE_NORMAL, NULL, - NULL, NULL, NULL); + dns_qp_lookup(qp, name, DNS_DBNAMESPACE_NORMAL, NULL, NULL, + NULL, NULL); } stop = isc_time_monotonic(); @@ -265,8 +265,8 @@ main(int argc, char **argv) { ++search->ndata[1]; } - dns_qp_lookup(qp, search, DNS_DBNAMESPACE_NORMAL, NULL, - NULL, NULL, NULL); + dns_qp_lookup(qp, search, DNS_DBNAMESPACE_NORMAL, NULL, NULL, + NULL, NULL); } stop = isc_time_monotonic(); diff --git a/tests/dns/qp_test.c b/tests/dns/qp_test.c index 03c65be43e9..fdfa07b8cbd 100644 --- a/tests/dns/qp_test.c +++ b/tests/dns/qp_test.c @@ -96,7 +96,7 @@ qpiter_prev_with_name(dns_qpiter_t *qpi, dns_name_t *name, void **pval_r, static isc_result_t qpiter_current_with_name(dns_qpiter_t *qpi, dns_name_t *name, void **pval_r, - uint32_t *ival_r) { + uint32_t *ival_r) { isc_result_t result; void *pval = NULL; uint32_t ival = 0; @@ -352,9 +352,7 @@ ISC_RUN_TEST_IMPL(qpiter) { /* check that we see only valid items in the correct order */ uint32_t prev = 0; dns_qpiter_init(qp, &qpi); - while (dns_qpiter_next(&qpi, &pval, &ival) == - ISC_R_SUCCESS) - { + while (dns_qpiter_next(&qpi, &pval, &ival) == ISC_R_SUCCESS) { assert_in_range(ival, prev + 1, ITER_ITEMS - 1); assert_int_equal(ival, item[ival]); assert_ptr_equal(pval, &item[ival]); @@ -373,9 +371,7 @@ ISC_RUN_TEST_IMPL(qpiter) { /* now iterate backward and check correctness */ n = inserted; - while (dns_qpiter_prev(&qpi, NULL, &ival) == - ISC_R_SUCCESS) - { + while (dns_qpiter_prev(&qpi, NULL, &ival) == ISC_R_SUCCESS) { --n; assert_int_equal(ival, order[n]); @@ -389,9 +385,7 @@ ISC_RUN_TEST_IMPL(qpiter) { assert_int_equal(n, 0); /* ...and forward again */ - while (dns_qpiter_next(&qpi, NULL, &ival) == - ISC_R_SUCCESS) - { + while (dns_qpiter_next(&qpi, NULL, &ival) == ISC_R_SUCCESS) { assert_int_equal(ival, order[n]); /* and check current iterator value as well */ @@ -410,34 +404,28 @@ ISC_RUN_TEST_IMPL(qpiter) { * to confirm we can change directions while iterating. */ if (inserted > 3) { - assert_int_equal( - dns_qpiter_next(&qpi, NULL, &ival), - ISC_R_SUCCESS); + assert_int_equal(dns_qpiter_next(&qpi, NULL, &ival), + ISC_R_SUCCESS); assert_int_equal(ival, order[0]); - assert_int_equal( - dns_qpiter_next(&qpi, NULL, &ival), - ISC_R_SUCCESS); + assert_int_equal(dns_qpiter_next(&qpi, NULL, &ival), + ISC_R_SUCCESS); assert_int_equal(ival, order[1]); - assert_int_equal( - dns_qpiter_prev(&qpi, NULL, &ival), - ISC_R_SUCCESS); + assert_int_equal(dns_qpiter_prev(&qpi, NULL, &ival), + ISC_R_SUCCESS); assert_int_equal(ival, order[0]); - assert_int_equal( - dns_qpiter_next(&qpi, NULL, &ival), - ISC_R_SUCCESS); + assert_int_equal(dns_qpiter_next(&qpi, NULL, &ival), + ISC_R_SUCCESS); assert_int_equal(ival, order[1]); - assert_int_equal( - dns_qpiter_prev(&qpi, NULL, &ival), - ISC_R_SUCCESS); + assert_int_equal(dns_qpiter_prev(&qpi, NULL, &ival), + ISC_R_SUCCESS); assert_int_equal(ival, order[0]); - assert_int_equal( - dns_qpiter_prev(&qpi, NULL, &ival), - ISC_R_NOMORE); + assert_int_equal(dns_qpiter_prev(&qpi, NULL, &ival), + ISC_R_NOMORE); } } @@ -487,8 +475,8 @@ check_partialmatch(dns_qp_t *qp, struct check_partialmatch check[], dns_test_namefromstring(check[i].query, &fn1); dns_qpchain_init(qp, &chain); - result = dns_qp_lookup(qp, name, space, NULL, - &chain, &pval, NULL); + result = dns_qp_lookup(qp, name, space, NULL, &chain, &pval, + NULL); /* Extract the found name if we found something */ if ((result == ISC_R_SUCCESS || result == DNS_R_PARTIALMATCH) && @@ -658,8 +646,8 @@ check_qpchainiter(dns_qp_t *qp, struct check_qpchain check[], dns_qpchain_init(qp, &chain); dns_test_namefromstring(check[i].query, &fn1); - result = dns_qp_lookup(qp, name, check[i].space, iter, - &chain, NULL, NULL); + result = dns_qp_lookup(qp, name, check[i].space, iter, &chain, + NULL, NULL); #if 0 fprintf(stderr, "%s %s (expected %s), " @@ -887,8 +875,8 @@ check_predecessors_withchain(dns_qp_t *qp, struct check_predecessors check[], result = dns_name_tostring(expred, &predstr, isc_g_mctx); assert_int_equal(result, ISC_R_SUCCESS); - result = dns_qp_lookup(qp, name, check[i].space, &it, - chain, NULL, NULL); + result = dns_qp_lookup(qp, name, check[i].space, &it, chain, + NULL, NULL); #if 0 fprintf(stderr, "%s %s: expected %s got %s\n", check[i].query, check[i].space == DNS_DBNAMESPACE_NSEC3 @@ -909,14 +897,15 @@ check_predecessors_withchain(dns_qp_t *qp, struct check_predecessors check[], result = qpiter_prev_with_name(&it, pred, NULL, &ival); if (result == ISC_R_NOMORE) { result = qpiter_prev_with_name(&it, pred, NULL, - &ival); + &ival); } } else { /* * we didn't find a match, so the iterator should * already be pointed at the predecessor node. */ - result = qpiter_current_with_name(&it, pred, NULL, &ival); + result = qpiter_current_with_name(&it, pred, NULL, + &ival); } assert_int_equal(result, ISC_R_SUCCESS); @@ -936,7 +925,8 @@ check_predecessors_withchain(dns_qp_t *qp, struct check_predecessors check[], isc_mem_free(isc_g_mctx, predstr); int j = 0; - while (qpiter_next_with_name(&it, name, NULL, NULL) == ISC_R_SUCCESS) + while (qpiter_next_with_name(&it, name, NULL, NULL) == + ISC_R_SUCCESS) { #if 0 result = dns_name_tostring(name, &namestr, isc_g_mctx);