- Fixed warnings caught by Clang 9.0.0

master
faluco 5 years ago committed by Andre Puschmann
parent 210eae8e7e
commit 7ff251f112

@ -324,7 +324,7 @@ void sig_int_handler(int signo)
} }
#endif #endif
int update_radl() static int update_radl(void)
{ {
bzero(&ra_dl_sib1, sizeof(srslte_ra_nbiot_dl_dci_t)); bzero(&ra_dl_sib1, sizeof(srslte_ra_nbiot_dl_dci_t));
@ -362,7 +362,7 @@ int update_radl()
} }
/* Read new MCS from stdin */ /* Read new MCS from stdin */
int update_control() static int update_control(void)
{ {
char input[128]; char input[128];
@ -516,7 +516,7 @@ int main(int argc, char** argv)
} }
#endif #endif
if (update_radl(sf_idx)) { if (update_radl()) {
exit(-1); exit(-1);
} }
@ -626,7 +626,7 @@ int main(int argc, char** argv)
} }
// Update DL resource allocation from control port // Update DL resource allocation from control port
if (update_control(sf_idx)) { if (update_control()) {
fprintf(stderr, "Error updating parameters from control port\n"); fprintf(stderr, "Error updating parameters from control port\n");
} }

@ -1024,15 +1024,15 @@ void* plot_thread_run(void* arg)
#endif #endif
// update MIB and SIB widget only if their content changed // update MIB and SIB widget only if their content changed
if (memcmp(mib_buffer_disp, mib_buffer_decode, sizeof(mib_buffer_disp) != 0)) { if (memcmp(mib_buffer_disp, mib_buffer_decode, sizeof(mib_buffer_disp)) != 0) {
memcpy(mib_buffer_disp, mib_buffer_decode, sizeof(mib_buffer_disp)); memcpy(mib_buffer_disp, mib_buffer_decode, sizeof(mib_buffer_disp));
text_edit_setMessage(&miblog, mib_buffer_disp); text_edit_setMessage(&miblog, mib_buffer_disp);
} }
if (memcmp(sib1_buffer_disp, sib1_buffer_decode, sizeof(sib1_buffer_disp) != 0)) { if (memcmp(sib1_buffer_disp, sib1_buffer_decode, sizeof(sib1_buffer_disp)) != 0) {
memcpy(sib1_buffer_disp, sib1_buffer_decode, sizeof(sib1_buffer_disp)); memcpy(sib1_buffer_disp, sib1_buffer_decode, sizeof(sib1_buffer_disp));
text_edit_setMessage(&sib1log, sib1_buffer_disp); text_edit_setMessage(&sib1log, sib1_buffer_disp);
} }
if (memcmp(sib2_buffer_disp, sib2_buffer_decode, sizeof(sib2_buffer_disp) != 0)) { if (memcmp(sib2_buffer_disp, sib2_buffer_decode, sizeof(sib2_buffer_disp)) != 0) {
memcpy(sib2_buffer_disp, sib2_buffer_decode, sizeof(sib2_buffer_disp)); memcpy(sib2_buffer_disp, sib2_buffer_decode, sizeof(sib2_buffer_disp));
text_edit_setMessage(&sib2log, sib2_buffer_disp); text_edit_setMessage(&sib2log, sib2_buffer_disp);
} }

@ -22,14 +22,14 @@
#ifndef SRSLTE_SIMD_H #ifndef SRSLTE_SIMD_H
#define SRSLTE_SIMD_H #define SRSLTE_SIMD_H
typedef _Complex float cf_t;
#ifdef LV_HAVE_SSE /* AVX, AVX2, FMA, AVX512 are in this group */ #ifdef LV_HAVE_SSE /* AVX, AVX2, FMA, AVX512 are in this group */
#ifndef __OPTIMIZE__ #ifndef __OPTIMIZE__
#define __OPTIMIZE__ #define __OPTIMIZE__
#endif #endif
#include <immintrin.h> #include <immintrin.h>
#endif /* LV_HAVE_SSE */ #endif /* LV_HAVE_SSE */
#include "srslte/config.h"
#include <stdio.h> #include <stdio.h>
#ifdef HAVE_NEON #ifdef HAVE_NEON

@ -91,7 +91,7 @@ void srslte_cell_fprint(FILE* stream, srslte_cell_t* cell, uint32_t sfn)
// Internal type for srslte_tdd_sf_t // Internal type for srslte_tdd_sf_t
typedef enum { D = 0, U = 1, S = 2 } tdd_sf_t; typedef enum { D = 0, U = 1, S = 2 } tdd_sf_t;
static srslte_tdd_sf_t tdd_sf[7][10] = {{D, S, U, U, U, D, S, U, U, U}, static tdd_sf_t tdd_sf[7][10] = {{D, S, U, U, U, D, S, U, U, U},
{D, S, U, U, D, D, S, U, U, D}, {D, S, U, U, D, D, S, U, U, D},
{D, S, U, D, D, D, S, U, D, D}, {D, S, U, D, D, D, S, U, D, D},
{D, S, U, U, U, D, D, D, D, D}, {D, S, U, U, U, D, D, D, D, D},
@ -113,7 +113,7 @@ static uint32_t tdd_nof_sf_symbols[10][3] = {{3, 10, 1},
srslte_tdd_sf_t srslte_sfidx_tdd_type(srslte_tdd_config_t tdd_config, uint32_t sf_idx) srslte_tdd_sf_t srslte_sfidx_tdd_type(srslte_tdd_config_t tdd_config, uint32_t sf_idx)
{ {
if (tdd_config.sf_config < 7 && sf_idx < 10 && tdd_config.configured) { if (tdd_config.sf_config < 7 && sf_idx < 10 && tdd_config.configured) {
return tdd_sf[tdd_config.sf_config][sf_idx]; return (srslte_tdd_sf_t)tdd_sf[tdd_config.sf_config][sf_idx];
} else { } else {
return SRSLTE_TDD_SF_D; return SRSLTE_TDD_SF_D;
} }

@ -52,7 +52,7 @@ int srslte_filesink_write(srslte_filesink_t* q, void* buffer, int nsamples)
float* fbuf = (float*)buffer; float* fbuf = (float*)buffer;
_Complex float* cbuf = (_Complex float*)buffer; _Complex float* cbuf = (_Complex float*)buffer;
_Complex short* sbuf = (_Complex short*)buffer; _Complex short* sbuf = (_Complex short*)buffer;
int size; int size = 0;
switch (q->type) { switch (q->type) {
case SRSLTE_TEXT: case SRSLTE_TEXT:
@ -90,7 +90,6 @@ int srslte_filesink_write(srslte_filesink_t* q, void* buffer, int nsamples)
size = sizeof(_Complex short); size = sizeof(_Complex short);
} }
return fwrite(buffer, size, nsamples, q->f); return fwrite(buffer, size, nsamples, q->f);
break;
default: default:
i = -1; i = -1;
break; break;
@ -104,7 +103,7 @@ int srslte_filesink_write_multi(srslte_filesink_t* q, void** buffer, int nsample
float** fbuf = (float**)buffer; float** fbuf = (float**)buffer;
_Complex float** cbuf = (_Complex float**)buffer; _Complex float** cbuf = (_Complex float**)buffer;
_Complex short** sbuf = (_Complex short**)buffer; _Complex short** sbuf = (_Complex short**)buffer;
int size; int size = 0;
switch (q->type) { switch (q->type) {
case SRSLTE_FLOAT: case SRSLTE_FLOAT:

@ -77,7 +77,7 @@ int srslte_filesource_read(srslte_filesource_t* q, void* buffer, int nsamples)
float* fbuf = (float*)buffer; float* fbuf = (float*)buffer;
_Complex float* cbuf = (_Complex float*)buffer; _Complex float* cbuf = (_Complex float*)buffer;
_Complex short* sbuf = (_Complex short*)buffer; _Complex short* sbuf = (_Complex short*)buffer;
int size; int size = 0;
switch (q->type) { switch (q->type) {
case SRSLTE_FLOAT: case SRSLTE_FLOAT:

@ -25,8 +25,7 @@
#define PMI_SELECT_TEST_NOF_CASES 20 #define PMI_SELECT_TEST_NOF_CASES 20
#include <inttypes.h> #include <inttypes.h>
#include "srslte/config.h"
typedef _Complex float cf_t;
typedef struct { typedef struct {
cf_t h[2][2]; /* Channel estimate */ cf_t h[2][2]; /* Channel estimate */

@ -658,8 +658,8 @@ void demod_64qam_lte_s_sse(const cf_t* symbols, short* llr, int nsymbols)
llr[6 * i + 0] = -yre; llr[6 * i + 0] = -yre;
llr[6 * i + 1] = -yim; llr[6 * i + 1] = -yim;
llr[6 * i + 2] = abs(yre) - 4 * SCALE_SHORT_CONV_QAM64 / sqrtf(42); llr[6 * i + 2] = fabs(yre) - 4 * SCALE_SHORT_CONV_QAM64 / sqrtf(42);
llr[6 * i + 3] = abs(yim) - 4 * SCALE_SHORT_CONV_QAM64 / sqrtf(42); llr[6 * i + 3] = fabs(yim) - 4 * SCALE_SHORT_CONV_QAM64 / sqrtf(42);
llr[6 * i + 4] = abs(llr[6 * i + 2]) - 2 * SCALE_SHORT_CONV_QAM64 / sqrtf(42); llr[6 * i + 4] = abs(llr[6 * i + 2]) - 2 * SCALE_SHORT_CONV_QAM64 / sqrtf(42);
llr[6 * i + 5] = abs(llr[6 * i + 3]) - 2 * SCALE_SHORT_CONV_QAM64 / sqrtf(42); llr[6 * i + 5] = abs(llr[6 * i + 3]) - 2 * SCALE_SHORT_CONV_QAM64 / sqrtf(42);
} }
@ -741,8 +741,8 @@ void demod_64qam_lte_b_sse(const cf_t* symbols, int8_t* llr, int nsymbols)
llr[6 * i + 0] = -yre; llr[6 * i + 0] = -yre;
llr[6 * i + 1] = -yim; llr[6 * i + 1] = -yim;
llr[6 * i + 2] = abs(yre) - 4 * SCALE_BYTE_CONV_QAM64 / sqrtf(42); llr[6 * i + 2] = fabs(yre) - 4 * SCALE_BYTE_CONV_QAM64 / sqrtf(42);
llr[6 * i + 3] = abs(yim) - 4 * SCALE_BYTE_CONV_QAM64 / sqrtf(42); llr[6 * i + 3] = fabs(yim) - 4 * SCALE_BYTE_CONV_QAM64 / sqrtf(42);
llr[6 * i + 4] = abs(llr[6 * i + 2]) - 2 * SCALE_BYTE_CONV_QAM64 / sqrtf(42); llr[6 * i + 4] = abs(llr[6 * i + 2]) - 2 * SCALE_BYTE_CONV_QAM64 / sqrtf(42);
llr[6 * i + 5] = abs(llr[6 * i + 3]) - 2 * SCALE_BYTE_CONV_QAM64 / sqrtf(42); llr[6 * i + 5] = abs(llr[6 * i + 3]) - 2 * SCALE_BYTE_CONV_QAM64 / sqrtf(42);
} }

@ -20,8 +20,7 @@
*/ */
#include <inttypes.h> #include <inttypes.h>
#include "srslte/config.h"
typedef _Complex float cf_t;
/* Thresholds for Demodulation */ /* Thresholds for Demodulation */
/* Assume perfect amplitude and phase alignment. /* Assume perfect amplitude and phase alignment.

@ -115,7 +115,7 @@ static int cqi_format2_subband_pack(srslte_cqi_cfg_t* cfg, srslte_cqi_format2_su
uint8_t* body_ptr = buff; uint8_t* body_ptr = buff;
srslte_bit_unpack(msg->subband_cqi, &body_ptr, 4); srslte_bit_unpack(msg->subband_cqi, &body_ptr, 4);
srslte_bit_unpack(msg->subband_label, &body_ptr, cfg->subband_label_2_bits ? 2 : 1); srslte_bit_unpack(msg->subband_label, &body_ptr, cfg->subband_label_2_bits ? 2 : 1);
return 4 + (cfg->subband_label_2_bits) ? 2 : 1; return 4 + ((cfg->subband_label_2_bits) ? 2 : 1);
} }
int srslte_cqi_value_pack(srslte_cqi_cfg_t* cfg, srslte_cqi_value_t* value, uint8_t buff[SRSLTE_CQI_MAX_BITS]) int srslte_cqi_value_pack(srslte_cqi_cfg_t* cfg, srslte_cqi_value_t* value, uint8_t buff[SRSLTE_CQI_MAX_BITS])
@ -211,7 +211,7 @@ static int cqi_format2_subband_unpack(srslte_cqi_cfg_t* cfg, uint8_t* buff, srsl
uint8_t* body_ptr = buff; uint8_t* body_ptr = buff;
msg->subband_cqi = srslte_bit_pack(&body_ptr, 4); msg->subband_cqi = srslte_bit_pack(&body_ptr, 4);
msg->subband_label = srslte_bit_pack(&body_ptr, cfg->subband_label_2_bits ? 2 : 1); msg->subband_label = srslte_bit_pack(&body_ptr, cfg->subband_label_2_bits ? 2 : 1);
return 4 + (cfg->subband_label_2_bits) ? 2 : 1; return 4 + ((cfg->subband_label_2_bits) ? 2 : 1);
} }
int srslte_cqi_value_unpack(srslte_cqi_cfg_t* cfg, uint8_t buff[SRSLTE_CQI_MAX_BITS], srslte_cqi_value_t* value) int srslte_cqi_value_unpack(srslte_cqi_cfg_t* cfg, uint8_t buff[SRSLTE_CQI_MAX_BITS], srslte_cqi_value_t* value)
@ -349,7 +349,7 @@ int srslte_cqi_size(srslte_cqi_cfg_t* cfg)
} }
break; break;
case SRSLTE_CQI_TYPE_SUBBAND: case SRSLTE_CQI_TYPE_SUBBAND:
size = 4 + (cfg->subband_label_2_bits) ? 2 : 1; size = 4 + ((cfg->subband_label_2_bits) ? 2 : 1);
break; break;
case SRSLTE_CQI_TYPE_SUBBAND_UE: case SRSLTE_CQI_TYPE_SUBBAND_UE:
size = 4 + 2 + cfg->L; size = 4 + 2 + cfg->L;

@ -159,6 +159,11 @@ int main(int argc, char** argv)
// PSCBH DMRS // PSCBH DMRS
srslte_sl_comm_resource_pool_t sl_comm_resource_pool; srslte_sl_comm_resource_pool_t sl_comm_resource_pool;
if (srslte_sl_comm_resource_pool_get_default_config(&sl_comm_resource_pool, cell) != SRSLTE_SUCCESS) {
ERROR("Error initializing sl_comm_resource_pool\n");
return SRSLTE_ERROR;
}
srslte_chest_sl_t psbch_chest; srslte_chest_sl_t psbch_chest;
if (srslte_chest_sl_init(&psbch_chest, SRSLTE_SIDELINK_PSBCH, cell, sl_comm_resource_pool) != SRSLTE_SUCCESS) { if (srslte_chest_sl_init(&psbch_chest, SRSLTE_SIDELINK_PSBCH, cell, sl_comm_resource_pool) != SRSLTE_SUCCESS) {
ERROR("Error in chest PSBCH init\n"); ERROR("Error in chest PSBCH init\n");

@ -39,7 +39,6 @@ void write_to_file();
srslte_nbiot_cell_t cell = { srslte_nbiot_cell_t cell = {
.base = {.nof_prb = 1, .cp = SRSLTE_CP_NORM, .id = 0}, .base = {.nof_prb = 1, .cp = SRSLTE_CP_NORM, .id = 0},
.base.nof_ports = 1, .base.nof_ports = 1,
.base.nof_prb = 1,
.nbiot_prb = 0, .nbiot_prb = 0,
}; };

@ -101,7 +101,7 @@ void srslte_bit_interleaver_run(srslte_bit_interleaver_t* q, uint8_t* input, uin
#ifdef LV_HAVE_SSE #ifdef LV_HAVE_SSE
for (; i < (int)q->nof_bits - 15; i += 16) { for (; i < (int)q->nof_bits - 15; i += 16) {
__m128i in128; __m128i in128 = _mm_setzero_si128();
in128 = _mm_insert_epi8(in128, input[*(byte_idx++)], 0x7); in128 = _mm_insert_epi8(in128, input[*(byte_idx++)], 0x7);
in128 = _mm_insert_epi8(in128, input[*(byte_idx++)], 0x6); in128 = _mm_insert_epi8(in128, input[*(byte_idx++)], 0x6);
in128 = _mm_insert_epi8(in128, input[*(byte_idx++)], 0x5); in128 = _mm_insert_epi8(in128, input[*(byte_idx++)], 0x5);

@ -115,7 +115,7 @@ TEST(srslte_vec_acc_ff, MALLOC(float, x); float z = 0;
for (int i = 0; i < block_size; i++) { gold += x[i]; } for (int i = 0; i < block_size; i++) { gold += x[i]; }
mse += fabs(gold - z) / gold; mse += cabsf(gold - z) / gold;
free(x);) free(x);)
@ -399,7 +399,7 @@ TEST(srslte_vec_convert_fi, MALLOC(float, x); MALLOC(short, z); float scale = 10
for (int i = 0; i < block_size; i++) { for (int i = 0; i < block_size; i++) {
gold = (short)((x[i] * scale)); gold = (short)((x[i] * scale));
double err = cabsf((float)gold - (float)z[i]); double err = fabsf((float)gold - (float)z[i]);
if (err > mse) { if (err > mse) {
mse = err; mse = err;
} }
@ -418,7 +418,7 @@ TEST(srslte_vec_convert_if, MALLOC(int16_t, x); MALLOC(float, z); float scale =
for (int i = 0; i < block_size; i++) { for (int i = 0; i < block_size; i++) {
gold = ((float)x[i]) * k; gold = ((float)x[i]) * k;
double err = cabsf((float)gold - (float)z[i]); double err = fabsf((float)gold - (float)z[i]);
if (err > mse) { if (err > mse) {
mse = err; mse = err;
} }
@ -482,7 +482,7 @@ TEST(srslte_vec_sc_prod_fff, MALLOC(float, x); MALLOC(float, z); float y = RANDO
for (int i = 0; i < block_size; i++) { for (int i = 0; i < block_size; i++) {
gold = x[i] * y; gold = x[i] * y;
mse += cabsf(gold - z[i]); mse += fabsf(gold - z[i]);
} }
free(x); free(x);
@ -497,7 +497,7 @@ TEST(
for (int i = 0; i < block_size; i++) { for (int i = 0; i < block_size; i++) {
gold = sqrtf(crealf(x[i]) * crealf(x[i]) + cimagf(x[i]) * cimagf(x[i])); gold = sqrtf(crealf(x[i]) * crealf(x[i]) + cimagf(x[i]) * cimagf(x[i]));
mse += cabsf(gold - z[i]) / block_size; mse += fabsf(gold - z[i]) / block_size;
} }
free(x); free(x);
@ -511,7 +511,7 @@ TEST(srslte_vec_abs_square_cf, MALLOC(cf_t, x); MALLOC(float, z); float gold;
for (int i = 0; i < block_size; i++) { for (int i = 0; i < block_size; i++) {
gold = crealf(x[i]) * crealf(x[i]) + cimagf(x[i]) * cimagf(x[i]); gold = crealf(x[i]) * crealf(x[i]) + cimagf(x[i]) * cimagf(x[i]);
mse += cabsf(gold - z[i]); mse += fabsf(gold - z[i]);
} }
free(x); free(x);

@ -105,7 +105,8 @@ private:
void metrics_read(phy_metrics_t* metrics); void metrics_read(phy_metrics_t* metrics);
void metrics_dl(uint32_t mcs); void metrics_dl(uint32_t mcs);
void metrics_ul(uint32_t mcs, float rssi, float sinr, float turbo_iters); void metrics_ul(uint32_t mcs, float rssi, float sinr, float turbo_iters);
bool is_pcell() { return pcell; }; bool is_pcell() { return pcell; }
uint32_t get_rnit() const {return rnti; }
private: private:
uint32_t rnti = 0; uint32_t rnti = 0;

@ -105,9 +105,7 @@ public:
uint16_t allocate_rnti() final; uint16_t allocate_rnti() final;
private: private:
static const int MAX_LOCATIONS = 20;
static const uint32_t cfi = 3; static const uint32_t cfi = 3;
srslte_dci_location_t locations[MAX_LOCATIONS] = {};
std::mutex rnti_mutex; std::mutex rnti_mutex;

@ -152,8 +152,6 @@ private:
srslte::log_ref log_h; srslte::log_ref log_h;
sched_interface* sched = nullptr; sched_interface* sched = nullptr;
bool conres_id_available = false;
// Mutexes // Mutexes
std::mutex mutex; std::mutex mutex;

@ -79,6 +79,9 @@ public:
// Note: Made const to forbid silent updates and enable comparison based on addr // Note: Made const to forbid silent updates and enable comparison based on addr
std::vector<std::shared_ptr<const var_meas_cfg_t> > cell_meas_cfg_list; std::vector<std::shared_ptr<const var_meas_cfg_t> > cell_meas_cfg_list;
rrc *get_rrc() { return rrc_ptr; }
const rrc *get_rrc() const { return rrc_ptr; }
private: private:
// args // args
rrc* rrc_ptr = nullptr; rrc* rrc_ptr = nullptr;

@ -252,7 +252,7 @@ public:
typedef std::unique_ptr<dummy_radio> unique_dummy_radio_t; typedef std::unique_ptr<dummy_radio> unique_dummy_radio_t;
class dummy_stack : public srsenb::stack_interface_phy_lte class dummy_stack final : public srsenb::stack_interface_phy_lte
{ {
private: private:
static constexpr float prob_dl_grant = 0.50f; static constexpr float prob_dl_grant = 0.50f;

@ -53,8 +53,6 @@ private:
srslte::byte_buffer_pool* m_pool; srslte::byte_buffer_pool* m_pool;
s1ap* m_s1ap; s1ap* m_s1ap;
hss_interface_nas* m_hss;
mme_gtpc* m_mme_gtpc;
nas_init_t m_nas_init; nas_init_t m_nas_init;
nas_if_t m_nas_if; nas_if_t m_nas_if;

@ -187,7 +187,6 @@ private:
bool is_pending_tx_end = false; bool is_pending_tx_end = false;
srslte::radio_interface_phy* radio_h = nullptr; srslte::radio_interface_phy* radio_h = nullptr;
float cfo = 0.0f;
srslte::log* log_h = nullptr; srslte::log* log_h = nullptr;
srslte::channel_ptr ul_channel = nullptr; srslte::channel_ptr ul_channel = nullptr;

@ -339,7 +339,6 @@ private:
// This is the primary cell // This is the primary cell
srslte_cell_t cell = {}; srslte_cell_t cell = {};
bool started = false;
uint32_t tti = 0; uint32_t tti = 0;
srslte_timestamp_t tti_ts = {}; srslte_timestamp_t tti_ts = {};
std::array<uint8_t, SRSLTE_BCH_PAYLOAD_LEN> mib = {}; std::array<uint8_t, SRSLTE_BCH_PAYLOAD_LEN> mib = {};

@ -96,7 +96,6 @@ private:
std::string imei_str; std::string imei_str;
// Security variables // Security variables
uint8_t rand[16] = {};
uint8_t ck[16] = {}; uint8_t ck[16] = {};
uint8_t ik[16] = {}; uint8_t ik[16] = {};
uint8_t ak[6] = {}; uint8_t ak[6] = {};

Loading…
Cancel
Save