mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-05-25 12:18:43 +00:00
Merge pull request #14365 from opensourcerouting/typesafe-const-declutter
Revert "lib: add a frr_each_const macro"
This commit is contained in:
commit
bf4e97c632
@ -127,10 +127,7 @@ _isis_flex_algo_elected(int algorithm, const struct isis_area *area,
|
|||||||
* Perform FAD comparison. First, compare the priority, and if they are
|
* Perform FAD comparison. First, compare the priority, and if they are
|
||||||
* the same, compare the sys-id.
|
* the same, compare the sys-id.
|
||||||
*/
|
*/
|
||||||
/* clang-format off */
|
frr_each (lspdb_const, &area->lspdb[ISIS_LEVEL1 - 1], lsp) {
|
||||||
frr_each_const(lspdb, &area->lspdb[ISIS_LEVEL1 - 1], lsp) {
|
|
||||||
/* clang-format on */
|
|
||||||
|
|
||||||
if (!lsp->tlvs || !lsp->tlvs->router_cap)
|
if (!lsp->tlvs || !lsp->tlvs->router_cap)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
@ -17,12 +17,14 @@ extern "C" {
|
|||||||
|
|
||||||
/* generic macros for all list-like types */
|
/* generic macros for all list-like types */
|
||||||
|
|
||||||
|
/* to iterate using the const variants of the functions, append "_const" to
|
||||||
|
* the name of the container, e.g. "frr_each (my_list, head, item)" becomes
|
||||||
|
* "frr_each (my_list_const, head, item)"
|
||||||
|
*/
|
||||||
|
|
||||||
#define frr_each(prefix, head, item) \
|
#define frr_each(prefix, head, item) \
|
||||||
for (item = prefix##_first(head); item; \
|
for (item = prefix##_first(head); item; \
|
||||||
item = prefix##_next(head, item))
|
item = prefix##_next(head, item))
|
||||||
#define frr_each_const(prefix, head, item) \
|
|
||||||
for (item = prefix##_const_first(head); item; \
|
|
||||||
item = prefix##_const_next(head, item))
|
|
||||||
#define frr_each_safe(prefix, head, item) \
|
#define frr_each_safe(prefix, head, item) \
|
||||||
for (typeof(prefix##_next_safe(head, NULL)) prefix##_safe = \
|
for (typeof(prefix##_next_safe(head, NULL)) prefix##_safe = \
|
||||||
prefix##_next_safe(head, \
|
prefix##_next_safe(head, \
|
||||||
|
Loading…
Reference in New Issue
Block a user