diff --git a/lib/src/phy/enb/enb_dl.c b/lib/src/phy/enb/enb_dl.c index 0040b65a9..b5e2cd283 100644 --- a/lib/src/phy/enb/enb_dl.c +++ b/lib/src/phy/enb/enb_dl.c @@ -417,7 +417,8 @@ int srslte_enb_dl_put_pdcch_dl(srslte_enb_dl_t *q, srslte_ra_dl_dci_t *grant, srslte_dci_format_t format, srslte_dci_location_t location, uint16_t rnti, uint32_t sf_idx) { - srslte_dci_msg_t dci_msg = {}; + srslte_dci_msg_t dci_msg; + bzero(&dci_msg, sizeof(dci_msg)); bool rnti_is_user = true; if (rnti == SRSLTE_SIRNTI || rnti == SRSLTE_PRNTI || (rnti >= SRSLTE_RARNTI_START && rnti <= SRSLTE_RARNTI_END)) { @@ -439,7 +440,8 @@ int srslte_enb_dl_put_pdcch_ul(srslte_enb_dl_t *q, srslte_ra_ul_dci_t *grant, srslte_dci_location_t location, uint16_t rnti, uint32_t sf_idx) { - srslte_dci_msg_t dci_msg = {}; + srslte_dci_msg_t dci_msg; + bzero(&dci_msg, sizeof(dci_msg)); srslte_dci_msg_pack_pusch(grant, &dci_msg, q->cell.nof_prb); if (srslte_pdcch_encode(&q->pdcch, &dci_msg, location, rnti, q->sf_symbols, sf_idx, q->cfi)) { diff --git a/lib/src/phy/fec/test/turbocoder_test.c b/lib/src/phy/fec/test/turbocoder_test.c index 172d2d898..37b82902e 100644 --- a/lib/src/phy/fec/test/turbocoder_test.c +++ b/lib/src/phy/fec/test/turbocoder_test.c @@ -97,7 +97,8 @@ int main(int argc, char **argv) { } /* Create CRC for Transport Block, it is not currently used but it is required */ - srslte_crc_t crc_tb = {}; + srslte_crc_t crc_tb; + bzero(&crc_tb, sizeof(crc_tb)); if (srslte_crc_init(&crc_tb, SRSLTE_LTE_CRC24A, 24)) { printf("error initialising CRC\n"); exit(-1); diff --git a/lib/src/phy/utils/test/vector_test.c b/lib/src/phy/utils/test/vector_test.c index 35156acaa..44f8af1ca 100644 --- a/lib/src/phy/utils/test/vector_test.c +++ b/lib/src/phy/utils/test/vector_test.c @@ -60,6 +60,8 @@ bool verbose = false; #define TEST(X, CODE) static bool test_##X (char *func_name, double *timing, uint32_t block_size) {\ struct timeval start, end;\ + bzero(&start, sizeof(start));\ + bzero(&end, sizeof(end));\ float mse = 0.0f;\ bool passed;\ strncpy(func_name, #X, 32);\ @@ -781,7 +783,8 @@ TEST(srslte_vec_apply_cfo, ) TEST(srslte_cfo_correct, - srslte_cfo_t srslte_cfo = {0}; + srslte_cfo_t srslte_cfo; + bzero(&srslte_cfo, sizeof(srslte_cfo)); MALLOC(cf_t, x); MALLOC(cf_t, z); @@ -807,7 +810,8 @@ TEST(srslte_cfo_correct, ) TEST(srslte_cfo_correct_change, - srslte_cfo_t srslte_cfo = {0}; + srslte_cfo_t srslte_cfo; + bzero(&srslte_cfo, sizeof(srslte_cfo)); MALLOC(cf_t, x); MALLOC(cf_t, z); diff --git a/lib/src/radio/test/benchmark_radio.cc b/lib/src/radio/test/benchmark_radio.cc index d15adaa6b..844624086 100644 --- a/lib/src/radio/test/benchmark_radio.cc +++ b/lib/src/radio/test/benchmark_radio.cc @@ -129,7 +129,9 @@ int main(int argc, char **argv) { int ret = SRSLTE_ERROR; srslte::radio_multi *radio_h = NULL; - srslte_timestamp_t ts_rx = {}, ts_tx = {}; + srslte_timestamp_t ts_rx, ts_tx; + bzero(&ts_rx, sizeof(ts_rx)); + bzero(&ts_tx, sizeof(ts_tx)); signal(SIGINT, sig_int_handler); diff --git a/lib/test/phy/phy_dl_test.c b/lib/test/phy/phy_dl_test.c index 50ea25a1e..6ed22c5d9 100644 --- a/lib/test/phy/phy_dl_test.c +++ b/lib/test/phy/phy_dl_test.c @@ -190,8 +190,8 @@ uint32_t prbset_to_bitmask() { int main(int argc, char **argv) { struct timeval t[3] = {}; size_t tx_nof_bits = 0, rx_nof_bits = 0; - srslte_enb_dl_t enb_dl = {}; - srslte_ue_dl_t ue_dl = {}; + srslte_enb_dl_t enb_dl; + srslte_ue_dl_t ue_dl; srslte_softbuffer_tx_t *softbuffer_tx[SRSLTE_MAX_TB] = {}; srslte_softbuffer_rx_t *softbuffer_rx[SRSLTE_MAX_TB] = {}; uint8_t *data_tx[SRSLTE_MAX_TB] = {}; @@ -206,6 +206,9 @@ int main(int argc, char **argv) { cf_t *signal_buffer[SRSLTE_MAX_PORTS] = {NULL}; + bzero(&enb_dl, sizeof(enb_dl)); + bzero(&ue_dl, sizeof(ue_dl)); + /* * Allocate Memory */ @@ -304,9 +307,12 @@ int main(int argc, char **argv) { /* * Run eNodeB */ - srslte_ra_dl_dci_t dci = {}; + srslte_ra_dl_dci_t dci; srslte_dci_format_t dci_format = SRSLTE_DCI_FORMAT1A; - srslte_ra_dl_grant_t grant = {}; + srslte_ra_dl_grant_t grant; + + bzero(&dci, sizeof(dci)); + bzero(&grant, sizeof(grant)); prbset_num = (int) ceilf((float) cell.nof_prb / srslte_ra_type0_P(cell.nof_prb)); last_prbset_num = prbset_num; diff --git a/srsue/src/upper/nas.cc b/srsue/src/upper/nas.cc index 0109be17f..ee2228ec4 100644 --- a/srsue/src/upper/nas.cc +++ b/srsue/src/upper/nas.cc @@ -1176,7 +1176,8 @@ void nas::send_detach_request(bool switch_off) return; } - LIBLTE_MME_DETACH_REQUEST_MSG_STRUCT detach_request = {}; + LIBLTE_MME_DETACH_REQUEST_MSG_STRUCT detach_request; + bzero(&detach_request, sizeof(detach_request)); if (switch_off) { detach_request.detach_type.switch_off = 1; detach_request.detach_type.type_of_detach = LIBLTE_MME_SO_FLAG_SWITCH_OFF; diff --git a/srsue/src/upper/rrc.cc b/srsue/src/upper/rrc.cc index edf89ba34..080de4b27 100644 --- a/srsue/src/upper/rrc.cc +++ b/srsue/src/upper/rrc.cc @@ -729,10 +729,10 @@ uint32_t rrc::sib_start_tti(uint32_t tti, uint32_t period, uint32_t offset, uint */ bool rrc::si_acquire(uint32_t sib_index) { - uint32_t tti; + uint32_t tti = 0; uint32_t si_win_start=0, si_win_len=0; - uint16_t period; - uint32_t sched_index; + uint16_t period = 0; + uint32_t sched_index = 0; uint32_t x, sf, offset; uint32_t last_win_start = 0;