From f7045405c092d87faee6fd53b70e206504de6bdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20H=C3=BC=C3=9Fler?= Date: Wed, 16 Nov 2022 03:20:44 +0100 Subject: [PATCH] core/cib: add const to cib_peek() --- core/lib/include/cib.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/lib/include/cib.h b/core/lib/include/cib.h index 9d3b8e98dc9e..3a9f3debebca 100644 --- a/core/lib/include/cib.h +++ b/core/lib/include/cib.h @@ -135,7 +135,7 @@ static inline int cib_get(cib_t *__restrict cib) * @return index of item * @retval -1 if no item at @p offset exists in the buffer */ -static inline int cib_peek_at_unsafe(cib_t *__restrict cib, unsigned offset) +static inline int cib_peek_at_unsafe(const cib_t *__restrict cib, unsigned offset) { return (cib->read_count + offset) & cib->mask; } @@ -153,7 +153,7 @@ static inline int cib_peek_at_unsafe(cib_t *__restrict cib, unsigned offset) * @return index of item * @retval -1 if no item at @p offset exists in the buffer */ -static inline int cib_peek_at(cib_t *__restrict cib, unsigned offset) +static inline int cib_peek_at(const cib_t *__restrict cib, unsigned offset) { if (offset < cib_avail(cib)) { return cib_peek_at_unsafe(cib, offset); @@ -172,7 +172,7 @@ static inline int cib_peek_at(cib_t *__restrict cib, unsigned offset) * @return index of next item * @retval -1 if the buffer is empty */ -static inline int cib_peek_unsafe(cib_t *__restrict cib) +static inline int cib_peek_unsafe(const cib_t *__restrict cib) { return cib_peek_at_unsafe(cib, 0); } @@ -185,7 +185,7 @@ static inline int cib_peek_unsafe(cib_t *__restrict cib) * @return index of next item * @retval -1 if the buffer is empty */ -static inline int cib_peek(cib_t *__restrict cib) +static inline int cib_peek(const cib_t *__restrict cib) { return cib_peek_at(cib, 0); }