2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 14:35:26 +00:00

implicitly declare list elements in ISC_LIST_FOREACH macros

ISC_LIST_FOREACH and related macros now use 'typeof(list.head)' to
declare the list elements automatically; the caller no longer needs
to do so.

ISC_LIST_FOREACH_SAFE also now implicitly declares its own 'next'
pointer, so it only needs three parameters instead of four.
This commit is contained in:
Evan Hunt
2025-03-20 15:46:35 -07:00
parent 6bbdb1980e
commit 5cff8f9017
23 changed files with 99 additions and 176 deletions

View File

@@ -437,9 +437,7 @@ isc_logconfig_destroy(isc_logconfig_t **lcfgp) {
}
for (size_t i = 0; i < ARRAY_SIZE(lcfg->channellists); i++) {
isc_logchannellist_t *item = NULL, *next = NULL;
ISC_LIST_FOREACH_SAFE (lcfg->channellists[i], item, link, next)
{
ISC_LIST_FOREACH_SAFE (lcfg->channellists[i], item, link) {
ISC_LIST_UNLINK(lcfg->channellists[i], item, link);
isc_mem_put(mctx, item, sizeof(*item));
}