]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
fix: dev: Switch to ISC_LIST_FOREACH everywhere
authorEvan Hunt <each@isc.org>
Mon, 31 Mar 2025 21:21:06 +0000 (21:21 +0000)
committerEvan Hunt <each@isc.org>
Mon, 31 Mar 2025 21:21:06 +0000 (21:21 +0000)
The pattern `for (x = ISC_LIST_HEAD(...); x != NULL; ISC_LIST_NEXT(...)` has been changed to `ISC_LIST_FOREACH` throughout BIND, except in a few
cases where the change would be excessively complex.

In most cases this was a straightforward change. In some places, however, the list element variable was referenced after the loop ended. Where possible, code has now been refactored to avoid this necessity.

`ISC_LIST_FOREACH` has also been modified to use `typeof(list.head)` to declare list elements automatically. When the list object to be iterated is declared with a `const` qualifier, the qualifier is passed along to the element declaration, causing a compilation failure. To avoid this problem, some `const` qualifiers have been removed; where that was not possible, `UNCONST` was used.

Merge branch 'each-isc-list-foreach' into 'main'

See merge request isc-projects/bind9!10310


Trivial merge