From: David Lamparter Date: Tue, 21 May 2019 02:53:30 +0000 (+0200) Subject: Revert "lib: Make _find functions treat the head as const" X-Git-Tag: base_7.2~319^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=refs%2Fpull%2F4373%2Fhead;p=mirror%2Ffrr.git Revert "lib: Make _find functions treat the head as const" This reverts commit 98d28ef55dd11a6efaa2bf3101ac57cf78e803bb. No longer needed with previous commit. Signed-off-by: David Lamparter --- diff --git a/lib/typesafe.h b/lib/typesafe.h index 7783d07072..6df3a07efe 100644 --- a/lib/typesafe.h +++ b/lib/typesafe.h @@ -490,7 +490,7 @@ macro_pure size_t prefix ## _count(struct prefix##_head *h) \ #define DECLARE_SORTLIST_UNIQ(prefix, type, field, cmpfn) \ _DECLARE_SORTLIST(prefix, type, field, cmpfn, cmpfn) \ \ -macro_inline type *prefix ## _find(const struct prefix##_head *h, const type *item) \ +macro_inline type *prefix ## _find(struct prefix##_head *h, const type *item) \ { \ struct ssort_item *sitem = h->sh.first; \ int cmpval = 0; \ @@ -598,7 +598,7 @@ macro_inline type *prefix ## _add(struct prefix##_head *h, type *item) \ *np = &item->field.hi; \ return NULL; \ } \ -macro_inline type *prefix ## _find(const struct prefix##_head *h, const type *item) \ +macro_inline type *prefix ## _find(struct prefix##_head *h, const type *item) \ { \ if (!h->hh.tabshift) \ return NULL; \ @@ -788,7 +788,7 @@ macro_inline int prefix ## __cmp(const struct sskip_item *a, \ return cmpfn(container_of(a, type, field.si), \ container_of(b, type, field.si)); \ } \ -macro_inline type *prefix ## _find(const struct prefix##_head *h, const type *item) \ +macro_inline type *prefix ## _find(struct prefix##_head *h, const type *item) \ { \ struct sskip_item *sitem = typesafe_skiplist_find(&h->sh, \ &item->field.si, &prefix ## __cmp); \