New upstream version 18.0.1+dfsg1

This commit is contained in:
Sebastian Ramacher 2017-04-19 21:54:15 +02:00
parent 6efda2859e
commit f2cf6cce50
1337 changed files with 41178 additions and 84670 deletions

View file

@ -254,6 +254,20 @@ static inline void circlebuf_pop_back(struct circlebuf *cb, void *data,
cb->end_pos -= size;
}
static inline void *circlebuf_data(struct circlebuf *cb, size_t idx)
{
uint8_t *ptr = (uint8_t*)cb->data;
size_t offset = cb->start_pos + idx;
if (idx > cb->size)
return NULL;
if (offset >= cb->capacity)
offset -= cb->capacity;
return ptr + offset;
}
#ifdef __cplusplus
}
#endif