fix: resolve cppcheck warnings for const pointer and static functions

Co-authored-by: aider (deepseek/deepseek-reasoner) <aider@aider.chat>
This commit is contained in:
Loic Coenen
2026-05-12 19:58:20 +00:00
parent fa9dbf2185
commit bb648d471b
3 changed files with 3 additions and 5 deletions

View File

@@ -135,7 +135,7 @@ int process_callback(jack_nframes_t nframes, void *arg) {
memory_order_acquire);
if (r != NULL) {
if (state == STATE_LOOPING && atomic_load(&channels[c].loop_count) > 0) {
float *outf = (float *)out;
const float *outf = (const float *)out;
ring_write(r, outf, nframes);
}
}

View File

@@ -30,7 +30,7 @@ void ring_destroy(RingBuf *r) {
r->capacity = 0;
}
size_t ring_readable(const RingBuf *r) {
static size_t ring_readable(const RingBuf *r) {
size_t h = load_head(r);
size_t t = load_tail(r);
if (h >= t)
@@ -39,7 +39,7 @@ size_t ring_readable(const RingBuf *r) {
return r->capacity - (t - h);
}
size_t ring_writeable(const RingBuf *r) {
static size_t ring_writeable(const RingBuf *r) {
return r->capacity - 1 - ring_readable(r);
}

View File

@@ -13,8 +13,6 @@ typedef struct {
int ring_init(RingBuf *r, size_t capacity);
void ring_destroy(RingBuf *r);
size_t ring_readable(const RingBuf *r);
size_t ring_writeable(const RingBuf *r);
size_t ring_write(RingBuf *r, const float *data, size_t count);
size_t ring_read(RingBuf *r, float *data, size_t count);