Merge pull request #8 from softwareradiosystems/next_coverity_fixes

Next coverity fixes
This commit is contained in:
Ismael Gomez 2017-06-08 12:08:00 +02:00 committed by GitHub
commit 23d3f96267
3 changed files with 18 additions and 12 deletions

View File

@ -76,7 +76,7 @@ public:
{
printf("%d buffers in queue\n", (int) used.size());
for (uint32_t i=0;i<used.size();i++) {
printf("%s\n", used[i]->debug_name?used[i]->debug_name:"Undefined");
printf("%s\n", strlen(used[i]->debug_name)?used[i]->debug_name:"Undefined");
}
}
@ -97,7 +97,8 @@ public:
}
#ifdef SRSLTE_BUFFER_POOL_LOG_ENABLED
if (debug_name) {
strncpy(b->debug_name, debug_name, 128);
strncpy(b->debug_name, debug_name, SRSLTE_BUFFER_POOL_LOG_NAME_LEN);
b->debug_name[SRSLTE_BUFFER_POOL_LOG_NAME_LEN-1] = 0;
}
#endif

View File

@ -54,6 +54,7 @@
#ifdef SRSLTE_BUFFER_POOL_LOG_ENABLED
#define pool_allocate (pool->allocate(__FUNCTION__))
#define SRSLTE_BUFFER_POOL_LOG_NAME_LEN 128
#else
#define pool_allocate (pool->allocate())
#endif
@ -121,7 +122,7 @@ public:
uint8_t buffer[SRSLTE_MAX_BUFFER_SIZE_BYTES];
uint8_t *msg;
#ifdef SRSLTE_BUFFER_POOL_LOG_ENABLED
char debug_name[128];
char debug_name[SRSLTE_BUFFER_POOL_LOG_NAME_LEN];
#endif
byte_buffer_t():N_bytes(0)
@ -129,6 +130,9 @@ public:
timestamp_is_set = false;
msg = &buffer[SRSLTE_BUFFER_HEADER_OFFSET];
next = NULL;
#ifdef SRSLTE_BUFFER_POOL_LOG_ENABLED
debug_name[0] = 0;
#endif
}
byte_buffer_t(const byte_buffer_t& buf)
{

View File

@ -39,6 +39,13 @@
#include "volk/volk.h"
#endif
#ifdef DEBUG_MODE
#warning FIXME: Disabling SSE/AVX vector code
#undef LV_HAVE_SSE
#undef LV_HAVE_AVX
#endif
int srslte_vec_acc_ii(int *x, uint32_t len) {
int i;
int z=0;
@ -295,21 +302,17 @@ void srslte_vec_lut_fuf(float *x, uint32_t *lut, float *y, uint32_t len) {
}
void srslte_vec_lut_sss(short *x, unsigned short *lut, short *y, uint32_t len) {
#ifdef DEBUG_MODE
#warning FIXME: Disabling SSE/AVX in srslte_vec_lut_sss
#else
#ifdef LV_HAVE_SSE
#ifndef LV_HAVE_SSE
for (int i=0;i<len;i++) {
y[lut[i]] = x[i];
}
#else
srslte_vec_lut_sss_sse(x, lut, y, len);
#endif
#endif
}
void srslte_vec_interleave_cf(float *real, float *imag, cf_t *x, uint32_t len) {
#ifdef HAVE_VOLK_INTERLEAVE_FUNCTION
#ifdef HAVE_VOLK_INTERLEAVE_FUNCTION
volk_32f_x2_interleave_32fc(x, real, imag, len);
#else
int i;
@ -320,7 +323,7 @@ void srslte_vec_interleave_cf(float *real, float *imag, cf_t *x, uint32_t len) {
}
void srslte_vec_deinterleave_cf(cf_t *x, float *real, float *imag, uint32_t len) {
#ifdef HAVE_VOLK_DEINTERLEAVE_FUNCTION
#ifdef HAVE_VOLK_DEINTERLEAVE_FUNCTION
volk_32fc_deinterleave_32f_x2(real, imag, x, len);
#else
int i;
@ -517,8 +520,6 @@ void srslte_vec_prod_fff(float *x, float *y, float *z, uint32_t len) {
}
void srslte_vec_prod_sss(short *x, short *y, short *z, uint32_t len) {
#ifdef LV_HAVE_AVX
srslte_vec_prod_sss_avx(x,y,z,len);
#else