From cf21da4ed1aacc0bb11f12dba059a0d2ea962cd5 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Mon, 13 Mar 2023 21:47:34 +0100 Subject: [PATCH] glib-aux/prioq: rename NM_PRIOQ_FOREACH_ITEM() to nm_prioq_for_each() Our for-each macros are usually lower-case and are spelled differently. Rename. Also add to clang-format as this is a for-each macro. --- .clang-format | 1 + src/libnm-glib-aux/nm-prioq.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.clang-format b/.clang-format index 4099440415..fb100bb1cd 100644 --- a/.clang-format +++ b/.clang-format @@ -120,6 +120,7 @@ ForEachMacros: [ 'nm_manager_for_each_device', 'nm_manager_for_each_device_safe', 'nm_platform_iter_obj_for_each', + 'nm_prioq_for_each', 'nmp_cache_iter_for_each', 'nmp_cache_iter_for_each_link', 'nmp_cache_iter_for_each_reverse', diff --git a/src/libnm-glib-aux/nm-prioq.h b/src/libnm-glib-aux/nm-prioq.h index 86a019c065..51e5b059fb 100644 --- a/src/libnm-glib-aux/nm-prioq.h +++ b/src/libnm-glib-aux/nm-prioq.h @@ -55,7 +55,7 @@ nm_prioq_peek(NMPrioq *q) void *nm_prioq_pop(NMPrioq *q); -#define NM_PRIOQ_FOREACH_ITEM(q, p) for (unsigned _i = 0; (p = nm_prioq_peek_by_index(q, _i)); _i++) +#define nm_prioq_for_each(q, p) for (unsigned _i = 0; (p = nm_prioq_peek_by_index((q), _i)); _i++) _nm_pure static inline unsigned nm_prioq_size(NMPrioq *q)