mirror of
https://github.com/neovim/neovim.git
synced 2024-12-24 21:25:04 -07:00
353a4be7e8
We already have an extensive suite of static analysis tools we use, which causes a fair bit of redundancy as we get duplicate warnings. PVS is also prone to give false warnings which creates a lot of work to identify and disable.
29 lines
569 B
C
29 lines
569 B
C
#include "nvim/rbuffer.h"
|
|
#include "rbuffer.h"
|
|
|
|
|
|
void ut_rbuffer_each_read_chunk(RBuffer *buf, each_ptr_cb cb)
|
|
{
|
|
RBUFFER_UNTIL_EMPTY(buf, rptr, rcnt) {
|
|
cb(rptr, rcnt);
|
|
rbuffer_consumed(buf, rcnt);
|
|
}
|
|
}
|
|
|
|
void ut_rbuffer_each_write_chunk(RBuffer *buf, each_ptr_cb cb)
|
|
{
|
|
RBUFFER_UNTIL_FULL(buf, wptr, wcnt) {
|
|
cb(wptr, wcnt);
|
|
rbuffer_produced(buf, wcnt);
|
|
}
|
|
}
|
|
void ut_rbuffer_each(RBuffer *buf, each_cb cb)
|
|
{
|
|
RBUFFER_EACH(buf, c, i) cb(c, i);
|
|
}
|
|
|
|
void ut_rbuffer_each_reverse(RBuffer *buf, each_cb cb)
|
|
{
|
|
RBUFFER_EACH_REVERSE(buf, c, i) cb(c, i);
|
|
}
|