fix various uninit vars detected by cppcheck

non-critical fixes in tests mostly, still good to have those clean
master
Andre Puschmann 4 years ago
parent 81d72380b5
commit ef19b1a9bd

@ -122,11 +122,11 @@ int srslte_rf_recv_wrapper(void* h, cf_t* data[SRSLTE_MAX_PORTS], uint32_t nsamp
int main(int argc, char** argv)
{
cf_t* buffer[SRSLTE_MAX_CHANNELS] = {NULL};
int n;
srslte_rf_t rf;
srslte_filesink_t sink;
srslte_ue_sync_t ue_sync;
srslte_cell_t cell;
int n = 0;
srslte_rf_t rf = {};
srslte_filesink_t sink = {};
srslte_ue_sync_t ue_sync = {};
srslte_cell_t cell = {};
signal(SIGINT, int_handler);

@ -120,7 +120,7 @@ static int chest_sl_psbch_gen(srslte_chest_sl_t* q)
u[ns] = (f_gh + f_ss) % SRSLTE_SL_N_RU_SEQ;
}
int32_t N_zc = 0; // N_zc - Zadoff Chu Sequence Length
int32_t N_zc = prime_numbers[0]; // N_zc - Zadoff Chu Sequence Length
for (uint32_t i = NOF_PRIME_NUMBERS - 1; i > 0; i--) {
if (prime_numbers[i] < q->M_sc_rs) {
N_zc = prime_numbers[i];

@ -52,7 +52,7 @@ int dl_timing_test()
cf_t rx_buff[SRSLTE_SF_LEN_PRB_NBIOT];
cf_t* buff_ptrs[SRSLTE_MAX_PORTS] = {rx_buff, NULL, NULL, NULL};
srslte_nbiot_ue_dl_t ue_dl;
srslte_nbiot_ue_dl_t ue_dl = {};
if (srslte_nbiot_ue_dl_init(&ue_dl, buff_ptrs, SRSLTE_NBIOT_MAX_PRB, SRSLTE_NBIOT_NUM_RX_ANTENNAS)) {
fprintf(stderr, "Error initializing UE DL\n");
return SRSLTE_ERROR;
@ -63,13 +63,13 @@ int dl_timing_test()
return SRSLTE_ERROR;
}
srslte_mib_nb_t mib;
srslte_mib_nb_t mib = {};
mib.sched_info_sib1 = 2;
srslte_nbiot_ue_dl_set_mib(&ue_dl, mib);
// a dummy grant
uint8_t dci_bits_packed[] = {0x81, 0x00, 0x00};
srslte_dci_msg_t dci_tmp;
srslte_dci_msg_t dci_tmp = {};
dci_tmp.format = SRSLTE_DCI_FORMATN1;
dci_tmp.nof_bits = 23;
srslte_bit_unpack_vector(dci_bits_packed, dci_tmp.payload, dci_tmp.nof_bits);

Loading…
Cancel
Save