mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2026-01-13 10:43:37 +00:00
common: add ring_get_length() for debugging purposes
Please notice it has a "static" modifier, like the rest of the inlined functions in ring.h, so it won't warn if it isn't used.
This commit is contained in:
parent
dc1d4bdb68
commit
2b78b4968a
@ -154,6 +154,19 @@ static inline RingItem *ring_prev(Ring *ring, RingItem *pos)
|
||||
(var) = ring_prev(ring, var))
|
||||
|
||||
|
||||
static inline unsigned int ring_get_length(Ring *ring)
|
||||
{
|
||||
RingItem *i;
|
||||
unsigned int ret = 0;
|
||||
|
||||
for (i = ring_get_head(ring);
|
||||
i != NULL;
|
||||
i = ring_next(ring, i))
|
||||
ret++;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
Loading…
Reference in New Issue
Block a user