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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user