adding return macros to ringbuffer

This commit is contained in:
yagoda 2020-03-10 00:30:13 +01:00 committed by Xavier Arteaga
parent 943d90bc48
commit 4f818b04ae
1 changed files with 5 additions and 5 deletions

View File

@ -30,7 +30,7 @@ int srslte_ringbuffer_init(srslte_ringbuffer_t* q, int capacity)
{
q->buffer = srslte_vec_malloc(capacity);
if (!q->buffer) {
return -1;
return SRSLTE_ERROR;
}
q->active = true;
q->capacity = capacity;
@ -39,7 +39,7 @@ int srslte_ringbuffer_init(srslte_ringbuffer_t* q, int capacity)
pthread_cond_init(&q->read_cvar, NULL);
srslte_ringbuffer_reset(q);
return 0;
return SRSLTE_SUCCESS;
}
void srslte_ringbuffer_free(srslte_ringbuffer_t* q)
@ -77,12 +77,12 @@ int srslte_ringbuffer_resize(srslte_ringbuffer_t* q, int capacity)
srslte_ringbuffer_reset(q);
q->buffer = srslte_vec_malloc(capacity);
if (!q->buffer) {
return -1;
return SRSLTE_ERROR;
}
q->active = true;
q->capacity = capacity;
return 0;
return SRSLTE_SUCCESS;
}
int srslte_ringbuffer_status(srslte_ringbuffer_t* q)
@ -247,7 +247,7 @@ int srslte_ringbuffer_read_convert_conj(srslte_ringbuffer_t* q, cf_t* dst_ptr, f
}
if (!q->active) {
pthread_mutex_unlock(&q->mutex);
return 0;
return SRSLTE_ERROR;
}
int16_t* src = (int16_t*)&q->buffer[q->rpm];