Skip to content

Commit f704540

Browse files
committed
core/cib: add const to cib_peek()
1 parent 85a0968 commit f704540

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

core/lib/include/cib.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ static inline int cib_get(cib_t *__restrict cib)
135135
* @return index of item
136136
* @retval -1 if no item at @p offset exists in the buffer
137137
*/
138-
static inline int cib_peek_at_unsafe(cib_t *__restrict cib, unsigned offset)
138+
static inline int cib_peek_at_unsafe(const cib_t *__restrict cib, unsigned offset)
139139
{
140140
return (cib->read_count + offset) & cib->mask;
141141
}
@@ -153,7 +153,7 @@ static inline int cib_peek_at_unsafe(cib_t *__restrict cib, unsigned offset)
153153
* @return index of item
154154
* @retval -1 if no item at @p offset exists in the buffer
155155
*/
156-
static inline int cib_peek_at(cib_t *__restrict cib, unsigned offset)
156+
static inline int cib_peek_at(const cib_t *__restrict cib, unsigned offset)
157157
{
158158
if (offset < cib_avail(cib)) {
159159
return cib_peek_at_unsafe(cib, offset);
@@ -172,7 +172,7 @@ static inline int cib_peek_at(cib_t *__restrict cib, unsigned offset)
172172
* @return index of next item
173173
* @retval -1 if the buffer is empty
174174
*/
175-
static inline int cib_peek_unsafe(cib_t *__restrict cib)
175+
static inline int cib_peek_unsafe(const cib_t *__restrict cib)
176176
{
177177
return cib_peek_at_unsafe(cib, 0);
178178
}
@@ -185,7 +185,7 @@ static inline int cib_peek_unsafe(cib_t *__restrict cib)
185185
* @return index of next item
186186
* @retval -1 if the buffer is empty
187187
*/
188-
static inline int cib_peek(cib_t *__restrict cib)
188+
static inline int cib_peek(const cib_t *__restrict cib)
189189
{
190190
return cib_peek_at(cib, 0);
191191
}

0 commit comments

Comments
 (0)