]> git.proxmox.com Git - mirror_frr.git/commitdiff
lib: Add const to _count() in new list APIs
authorStephen Worley <sworley@cumulusnetworks.com>
Wed, 31 Jul 2019 00:26:31 +0000 (20:26 -0400)
committerStephen Worley <sworley@cumulusnetworks.com>
Wed, 31 Jul 2019 15:35:21 +0000 (11:35 -0400)
Add const to the datastructure being passed to the new list APIs
for the `_count()` calls.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
lib/typerb.h
lib/typesafe.h

index 063d924be4647691c475dea15f14251c0356869f..2d7b0ba63791f1dd34942aa2e8578852e2c7d1fe 100644 (file)
@@ -133,7 +133,7 @@ macro_pure type *prefix ## _next_safe(struct prefix##_head *h, type *item)     \
        re = item ? typed_rb_next(&item->field.re) : NULL;                     \
        return container_of_null(re, type, field.re);                          \
 }                                                                              \
-macro_pure size_t prefix ## _count(struct prefix##_head *h)                    \
+macro_pure size_t prefix ## _count(const struct prefix##_head *h)              \
 {                                                                              \
        return h->rr.count;                                                    \
 }                                                                              \
index 08460687437c009240bcd8dd224c7b02c2318541..c30d73d1b3ed1a29d944e9e35fb8352ae77ce927 100644 (file)
@@ -150,7 +150,7 @@ macro_pure type *prefix ## _next_safe(struct prefix##_head *h, type *item)     \
        sitem = &item->field.si;                                               \
        return container_of_null(sitem->next, type, field.si);                 \
 }                                                                              \
-macro_pure size_t prefix ## _count(struct prefix##_head *h)                    \
+macro_pure size_t prefix ## _count(const struct prefix##_head *h)              \
 {                                                                              \
        return h->sh.count;                                                    \
 }                                                                              \
@@ -252,7 +252,7 @@ macro_pure type *prefix ## _next_safe(struct prefix##_head *h, type *item)     \
                return NULL;                                                   \
        return prefix ## _next(h, item);                                       \
 }                                                                              \
-macro_pure size_t prefix ## _count(struct prefix##_head *h)                    \
+macro_pure size_t prefix ## _count(const struct prefix##_head *h)              \
 {                                                                              \
        return h->dh.count;                                                    \
 }                                                                              \
@@ -357,7 +357,7 @@ macro_pure type *prefix ## _next_safe(struct prefix##_head *h, type *item)     \
                return NULL;                                                   \
        return prefix ## _next(h, item);                                       \
 }                                                                              \
-macro_pure size_t prefix ## _count(struct prefix##_head *h)                    \
+macro_pure size_t prefix ## _count(const struct prefix##_head *h)              \
 {                                                                              \
        return h->hh.count;                                                    \
 }                                                                              \
@@ -489,7 +489,7 @@ macro_pure type *prefix ## _next_safe(struct prefix##_head *h, type *item)     \
        sitem = &item->field.si;                                               \
        return container_of_null(sitem->next, type, field.si);                 \
 }                                                                              \
-macro_pure size_t prefix ## _count(struct prefix##_head *h)                    \
+macro_pure size_t prefix ## _count(const struct prefix##_head *h)              \
 {                                                                              \
        return h->sh.count;                                                    \
 }                                                                              \
@@ -680,7 +680,7 @@ macro_pure type *prefix ## _next_safe(struct prefix##_head *h, type *item)     \
                return NULL;                                                   \
        return prefix ## _next(h, item);                                       \
 }                                                                              \
-macro_pure size_t prefix ## _count(struct prefix##_head *h)                    \
+macro_pure size_t prefix ## _count(const struct prefix##_head *h)              \
 {                                                                              \
        return h->hh.count;                                                    \
 }                                                                              \
@@ -783,7 +783,7 @@ macro_pure type *prefix ## _next_safe(struct prefix##_head *h, type *item)     \
        next = item ? item->field.si.next[0] : NULL;                           \
        return container_of_null(next, type, field.si);                        \
 }                                                                              \
-macro_pure size_t prefix ## _count(struct prefix##_head *h)                    \
+macro_pure size_t prefix ## _count(const struct prefix##_head *h)              \
 {                                                                              \
        return h->sh.count;                                                    \
 }                                                                              \