Skip to content

Commit

Permalink
Merge pull request #21130 from fabian18/pr/cib_const
Browse files Browse the repository at this point in the history
core/cib: add const to cib_peek()
  • Loading branch information
mguetschow authored Jan 13, 2025
2 parents 58adb81 + f704540 commit 529d1f8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions core/lib/include/cib.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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);
Expand All @@ -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);
}
Expand All @@ -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);
}
Expand Down

0 comments on commit 529d1f8

Please sign in to comment.