More LGTM fixes

master
Xavier Arteaga 5 years ago committed by Andre Puschmann
parent 60c4daccab
commit 89dcd6339f

@ -707,7 +707,7 @@ int main(int argc, char** argv)
} }
} }
cf_t* buffers[SRSLTE_MAX_PORTS] = {}; cf_t* buffers[SRSLTE_MAX_CHANNELS] = {};
for (int p = 0; p < SRSLTE_MAX_PORTS; p++) { for (int p = 0; p < SRSLTE_MAX_PORTS; p++) {
buffers[p] = sf_buffer[p]; buffers[p] = sf_buffer[p];
} }

@ -188,7 +188,7 @@ int main(int argc, char** argv)
uint32_t sf_len = SRSLTE_SF_LEN_PRB(cell_sl.nof_prb); uint32_t sf_len = SRSLTE_SF_LEN_PRB(cell_sl.nof_prb);
printf("Using a SF len of %d samples\n", sf_len); printf("Using a SF len of %d samples\n", sf_len);
cf_t* rx_buffer[SRSLTE_MAX_PORTS] = {NULL}; //< For radio to receive samples cf_t* rx_buffer[SRSLTE_MAX_CHANNELS] = {}; //< For radio to receive samples
cf_t* sf_buffer[SRSLTE_MAX_PORTS] = {NULL}; ///< For OFDM object to store subframe after FFT cf_t* sf_buffer[SRSLTE_MAX_PORTS] = {NULL}; ///< For OFDM object to store subframe after FFT
for (int i = 0; i < nof_rx_antennas; i++) { for (int i = 0; i < nof_rx_antennas; i++) {

@ -130,7 +130,7 @@ int srslte_rf_recv_wrapper(void* h, cf_t* data[SRSLTE_MAX_PORTS], uint32_t nsamp
int main(int argc, char** argv) int main(int argc, char** argv)
{ {
cf_t* buffer[SRSLTE_MAX_PORTS] = {NULL}; cf_t* buffer[SRSLTE_MAX_CHANNELS] = {NULL};
int n; int n;
srslte_rf_t rf; srslte_rf_t rf;
srslte_filesink_t sink; srslte_filesink_t sink;

@ -162,6 +162,7 @@ public:
const static int MAX_FOUND_PLMNS = 16; const static int MAX_FOUND_PLMNS = 16;
virtual ~rrc_interface_nas() = default;
virtual void write_sdu(srslte::unique_byte_buffer_t sdu) = 0; virtual void write_sdu(srslte::unique_byte_buffer_t sdu) = 0;
virtual uint16_t get_mcc() = 0; virtual uint16_t get_mcc() = 0;
virtual uint16_t get_mnc() = 0; virtual uint16_t get_mnc() = 0;

@ -145,7 +145,7 @@ SRSLTE_API int srslte_uci_decode_ack_ri(srslte_pusch_cfg_t* cfg,
uint32_t H_prime_total, uint32_t H_prime_total,
uint32_t O_cqi, uint32_t O_cqi,
srslte_uci_bit_t* ack_ri_bits, srslte_uci_bit_t* ack_ri_bits,
uint8_t data[SRSLTE_UCI_MAX_ACK_SR_BITS], uint8_t* data,
uint32_t nof_bits, uint32_t nof_bits,
bool is_ri); bool is_ri);

@ -49,7 +49,7 @@ public:
* largest system bandwidth * largest system bandwidth
* @param nof_subframes_ Number of subframes to allocate * @param nof_subframes_ Number of subframes to allocate
*/ */
rf_buffer_t(uint32_t nof_subframes_) explicit rf_buffer_t(uint32_t nof_subframes_)
{ {
if (nof_subframes_ > 0) { if (nof_subframes_ > 0) {
// Allocate buffers for an integer number of subframes // Allocate buffers for an integer number of subframes
@ -66,7 +66,7 @@ public:
* contain up to SRSLTE_MAX_CHANNELS pointers * contain up to SRSLTE_MAX_CHANNELS pointers
* @param data Flat array to use as initializer for the internal buffer pointers * @param data Flat array to use as initializer for the internal buffer pointers
*/ */
rf_buffer_t(cf_t* data[SRSLTE_MAX_CHANNELS]) explicit rf_buffer_t(cf_t* data[SRSLTE_MAX_CHANNELS])
{ {
for (uint32_t i = 0; i < SRSLTE_MAX_CHANNELS; i++) { for (uint32_t i = 0; i < SRSLTE_MAX_CHANNELS; i++) {
sample_buffer[i] = data[i]; sample_buffer[i] = data[i];
@ -76,11 +76,11 @@ public:
* Creates an object from a single array pointer. The rest of the channel pointers will be left to NULL * Creates an object from a single array pointer. The rest of the channel pointers will be left to NULL
* @param data Flat array to use as initializer for the internal buffer pointers * @param data Flat array to use as initializer for the internal buffer pointers
*/ */
rf_buffer_t(cf_t* data) { sample_buffer[0] = data; } explicit rf_buffer_t(cf_t* data) { sample_buffer[0] = data; }
/** /**
* Default constructor leaves the internal pointers to NULL * Default constructor leaves the internal pointers to NULL
*/ */
rf_buffer_t() {} rf_buffer_t() = default;
/** /**
* The destructor will deallocate memory only if it was allocated passing nof_subframes > 0 * The destructor will deallocate memory only if it was allocated passing nof_subframes > 0

@ -670,7 +670,7 @@ static int encode_bits(srslte_pucch_cfg_t* cfg,
uint8_t pucch2_bits[SRSLTE_PUCCH_MAX_BITS]) uint8_t pucch2_bits[SRSLTE_PUCCH_MAX_BITS])
{ {
if (format < SRSLTE_PUCCH_FORMAT_2) { if (format < SRSLTE_PUCCH_FORMAT_2) {
memcpy(pucch_bits, uci_data->ack.ack_value, srslte_uci_cfg_total_ack(&cfg->uci_cfg) * sizeof(uint8_t)); srs_vec_u8_copy(pucch_bits, uci_data->ack.ack_value, srslte_uci_cfg_total_ack(&cfg->uci_cfg));
} else if (format >= SRSLTE_PUCCH_FORMAT_2 && format < SRSLTE_PUCCH_FORMAT_3) { } else if (format >= SRSLTE_PUCCH_FORMAT_2 && format < SRSLTE_PUCCH_FORMAT_3) {
/* Put RI (goes alone) */ /* Put RI (goes alone) */
if (cfg->uci_cfg.cqi.ri_len) { if (cfg->uci_cfg.cqi.ri_len) {
@ -858,7 +858,7 @@ int srslte_pucch_encode(srslte_pucch_t* q,
cf_t* sf_symbols) cf_t* sf_symbols)
{ {
uint8_t pucch_bits[SRSLTE_PUCCH_MAX_BITS]; uint8_t pucch_bits[SRSLTE_PUCCH_MAX_BITS];
bzero(pucch_bits, SRSLTE_PUCCH_MAX_BITS * sizeof(uint8_t)); srslte_vec_u8_zero(pucch_bits, SRSLTE_PUCCH_MAX_BITS);
int ret = SRSLTE_ERROR_INVALID_INPUTS; int ret = SRSLTE_ERROR_INVALID_INPUTS;
if (q != NULL && sf_symbols != NULL) { if (q != NULL && sf_symbols != NULL) {

@ -232,7 +232,7 @@ int main(int argc, char** argv)
srslte_ra_nbiot_dl_dci_t dci_unpacked; srslte_ra_nbiot_dl_dci_t dci_unpacked;
srslte_ra_nbiot_dl_grant_t grant; srslte_ra_nbiot_dl_grant_t grant;
if (srslte_nbiot_dci_msg_to_dl_grant( if (srslte_nbiot_dci_msg_to_dl_grant(
&dci_rx, rnti, &dci_unpacked, &grant, tti / 10, tti % 10, 64 /* fixme: remove */, cell.mode)) { &dci_rx, rnti, &dci_unpacked, &grant, tti / 10, tti % 10, 64 /* todo: remove */, cell.mode)) {
fprintf(stderr, "Error unpacking DCI\n"); fprintf(stderr, "Error unpacking DCI\n");
return SRSLTE_ERROR; return SRSLTE_ERROR;
} }

@ -240,7 +240,7 @@ int32_t srslte_uci_decode_m_basis_bits(const int16_t* llr, uint32_t nof_llr, uin
/// Compute correlation for the number of LLR /// Compute correlation for the number of LLR
bool early_termination = false; bool early_termination = false;
for (uint8_t i = 0; i < nof_llr && !early_termination; i++) { for (uint32_t i = 0; i < nof_llr && !early_termination; i++) {
// Encode guess word // Encode guess word
bool d = encode_M_basis_seq_u16(guess, i); bool d = encode_M_basis_seq_u16(guess, i);
@ -266,7 +266,7 @@ int32_t srslte_uci_decode_m_basis_bits(const int16_t* llr, uint32_t nof_llr, uin
// Unpack // Unpack
for (uint32_t i = 0; i < data_len; i++) { for (uint32_t i = 0; i < data_len; i++) {
data[i] = (uint8_t)(max_data >> i) & 1U; data[i] = (uint8_t)((max_data >> i) & 1U);
} }
// Return correlation // Return correlation
@ -794,7 +794,7 @@ int srslte_uci_decode_ack_ri(srslte_pusch_cfg_t* cfg,
uint32_t H_prime_total, uint32_t H_prime_total,
uint32_t O_cqi, uint32_t O_cqi,
srslte_uci_bit_t* ack_ri_bits, srslte_uci_bit_t* ack_ri_bits,
uint8_t data[SRSLTE_UCI_MAX_ACK_SR_BITS], uint8_t* data,
uint32_t nof_bits, uint32_t nof_bits,
bool is_ri) bool is_ri)
{ {

@ -160,7 +160,7 @@ bool s1ap_mngmt_proc::unpack_s1_setup_request(const asn1::s1ap::s1_setup_request
} }
// Default Paging DRX // Default Paging DRX
enb_ctx->drx = s1_req.default_paging_drx.value; enb_ctx->drx.value = s1_req.default_paging_drx.value;
return true; return true;
} }

@ -113,9 +113,9 @@ public:
} }
} }
cell_t() { cell_t({0, 0}); } cell_t() { cell_t({0, 0, 0}); }
cell_t(phy_interface_rrc_lte::phy_cell_t phy_cell_) explicit cell_t(phy_interface_rrc_lte::phy_cell_t phy_cell_)
{ {
gettimeofday(&last_update, nullptr); gettimeofday(&last_update, nullptr);
has_valid_sib1 = false; has_valid_sib1 = false;

Loading…
Cancel
Save