Fixed more static code analysis warnings

master
Xavier Arteaga 5 years ago committed by Xavier Arteaga
parent b48bb0d754
commit 6d896ee453

@ -800,7 +800,7 @@ int main(int argc, char **argv) {
} }
#endif #endif
if (update_radl(sf_idx)) { if (update_radl()) {
exit(-1); exit(-1);
} }
@ -879,7 +879,7 @@ int main(int argc, char **argv) {
srslte_pcfich_encode(&pcfich, &dl_sf, sf_symbols); srslte_pcfich_encode(&pcfich, &dl_sf, sf_symbols);
/* Update DL resource allocation from control port */ /* Update DL resource allocation from control port */
if (update_control(sf_idx)) { if (update_control()) {
ERROR("Error updating parameters from control port\n"); ERROR("Error updating parameters from control port\n");
} }

@ -98,11 +98,12 @@ void parse_args(int argc, char **argv) {
} }
} }
int srslte_rf_recv_wrapper(void *h, cf_t *data[SRSLTE_MAX_PORTS], uint32_t nsamples, srslte_timestamp_t *t) { int srslte_rf_recv_wrapper(void* h, cf_t* data_[SRSLTE_MAX_PORTS], uint32_t nsamples, srslte_timestamp_t* t)
{
DEBUG(" ---- Receive %d samples ---- \n", nsamples); DEBUG(" ---- Receive %d samples ---- \n", nsamples);
void* ptr[SRSLTE_MAX_PORTS]; void* ptr[SRSLTE_MAX_PORTS];
for (int i = 0; i < SRSLTE_MAX_PORTS; i++) { for (int i = 0; i < SRSLTE_MAX_PORTS; i++) {
ptr[i] = data[i]; ptr[i] = data_[i];
} }
return srslte_rf_recv_with_time_multi(h, ptr, nsamples, true, NULL, NULL); return srslte_rf_recv_with_time_multi(h, ptr, nsamples, true, NULL, NULL);
} }

@ -519,7 +519,7 @@ static void average_pilots(srslte_chest_dl_t* q,
float* filter, float* filter,
uint32_t filter_len) uint32_t filter_len)
{ {
uint32_t nsymbols = (sf->sf_type == SRSLTE_SF_MBSFN) ? srslte_refsignal_mbsfn_nof_symbols(port_id) uint32_t nsymbols = (sf->sf_type == SRSLTE_SF_MBSFN) ? srslte_refsignal_mbsfn_nof_symbols()
: srslte_refsignal_cs_nof_symbols(&q->csr_refs, sf, port_id); : srslte_refsignal_cs_nof_symbols(&q->csr_refs, sf, port_id);
uint32_t nref = (sf->sf_type == SRSLTE_SF_MBSFN) ? 6 * q->cell.nof_prb : 2 * q->cell.nof_prb; uint32_t nref = (sf->sf_type == SRSLTE_SF_MBSFN) ? 6 * q->cell.nof_prb : 2 * q->cell.nof_prb;

@ -88,7 +88,8 @@ static uint16_t deinterleaver_sb[NOF_DEINTER_TABLE_SB_IDX][192][4][18448];
static uint16_t temp_table1[3*6176], temp_table2[3*6176]; static uint16_t temp_table1[3*6176], temp_table2[3*6176];
static void srslte_rm_turbo_gentable_systematic(uint16_t *table_bits, int k0_vec[4][2], uint32_t nrows, int ndummy) { static void srslte_rm_turbo_gentable_systematic(uint16_t* table_bits, int k0_vec_[4][2], uint32_t nrows, int ndummy)
{
bool last_is_null=true; bool last_is_null=true;
int k_b=0, buff_idx=0; int k_b=0, buff_idx=0;
@ -101,10 +102,10 @@ static void srslte_rm_turbo_gentable_systematic(uint16_t *table_bits, int k0_vec
} else { } else {
last_is_null=true; last_is_null=true;
} }
for (int i=0;i<4;i++) { for (int k = 0; k < 4; k++) {
if (k0_vec[i][1] == -1) { if (k0_vec_[k][1] == -1) {
if (k0_vec[i][0]%(3*nrows*NCOLS) <= buff_idx && !last_is_null) { if (k0_vec_[k][0] % (3 * nrows * NCOLS) <= buff_idx && !last_is_null) {
k0_vec[i][1] = k_b-1; k0_vec_[k][1] = k_b - 1;
} }
} }
} }
@ -113,7 +114,9 @@ static void srslte_rm_turbo_gentable_systematic(uint16_t *table_bits, int k0_vec
} }
} }
static void srslte_rm_turbo_gentable_parity(uint16_t *table_parity, int k0_vec[4][2], int offset, uint16_t nrows, int ndummy) { static void
srslte_rm_turbo_gentable_parity(uint16_t* table_parity, int k0_vec_[4][2], int offset, uint16_t nrows, int ndummy)
{
bool last_is_null=true; bool last_is_null=true;
int k_b=0, buff_idx0=0; int k_b=0, buff_idx0=0;
@ -128,10 +131,10 @@ static void srslte_rm_turbo_gentable_parity(uint16_t *table_parity, int k0_vec[4
} else { } else {
last_is_null=true; last_is_null=true;
} }
for (int i=0;i<4;i++) { for (int k = 0; k < 4; k++) {
if (k0_vec[i][1] == -1) { if (k0_vec_[k][1] == -1) {
if (k0_vec[i][0]%(3*K_p) <= 2*buff_idx0+K_p && !last_is_null) { if (k0_vec_[k][0] % (3 * K_p) <= 2 * buff_idx0 + K_p && !last_is_null) {
k0_vec[i][1] = offset+k_b-1; k0_vec_[k][1] = offset + k_b - 1;
} }
} }
} }
@ -145,10 +148,10 @@ static void srslte_rm_turbo_gentable_parity(uint16_t *table_parity, int k0_vec[4
} else { } else {
last_is_null=true; last_is_null=true;
} }
for (int i=0;i<4;i++) { for (int k = 0; k < 4; k++) {
if (k0_vec[i][1] == -1) { if (k0_vec_[k][1] == -1) {
if (k0_vec[i][0]%(3*K_p) <= 2*buff_idx1+1+K_p && !last_is_null) { if (k0_vec_[k][0] % (3 * K_p) <= 2 * buff_idx1 + 1 + K_p && !last_is_null) {
k0_vec[i][1] = offset+k_b-1; k0_vec_[k][1] = offset + k_b - 1;
} }
} }
} }

@ -416,8 +416,8 @@ private:
// RRC constants and timers // RRC constants and timers
srslte::timer_handler* timers = nullptr; srslte::timer_handler* timers = nullptr;
uint32_t n310_cnt = 0, N310 = 0; uint32_t n310_cnt, N310 = 0;
uint32_t n311_cnt = 0, N311 = 0; uint32_t n311_cnt, N311 = 0;
srslte::timer_handler::unique_timer t300, t301, t302, t310, t311, t304; srslte::timer_handler::unique_timer t300, t301, t302, t310, t311, t304;
// Radio bearers // Radio bearers
@ -469,8 +469,12 @@ private:
void delete_last_neighbour(); void delete_last_neighbour();
std::string print_neighbour_cells(); std::string print_neighbour_cells();
bool initiated = false; bool initiated = false;
bool reestablishment_successful = false; asn1::rrc::reest_cause_e m_reest_cause = asn1::rrc::reest_cause_e::nulltype;
uint16_t m_reest_rnti = 0;
uint16_t m_reest_source_pci = 0;
bool reestablishment_started = false;
bool reestablishment_successful = false;
// Measurements sub-class // Measurements sub-class
class rrc_meas class rrc_meas

@ -3376,7 +3376,7 @@ uint8_t rrc::rrc_meas::value_to_range(quantity_t quant, float value) {
case RSRP: case RSRP:
if (value < -140) { if (value < -140) {
range = 0; range = 0;
} else if (-140 <= value && value < -44) { } else if (value < -44) {
range = 1u + (uint8_t)(value + 140); range = 1u + (uint8_t)(value + 140);
} else { } else {
range = 97; range = 97;
@ -3385,7 +3385,7 @@ uint8_t rrc::rrc_meas::value_to_range(quantity_t quant, float value) {
case RSRQ: case RSRQ:
if (value < -19.5) { if (value < -19.5) {
range = 0; range = 0;
} else if (-19.5 <= value && value < -3) { } else if (value < -3) {
range = 1u + (uint8_t)(2 * (value + 19.5)); range = 1u + (uint8_t)(2 * (value + 19.5));
} else { } else {
range = 34; range = 34;

Loading…
Cancel
Save