fix various variable initializations that gcc-4.8 complained about

master
Andre Puschmann 6 years ago
parent bc9d342959
commit d19eb28a16

@ -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, srslte_dci_format_t format, srslte_dci_location_t location,
uint16_t rnti, uint32_t sf_idx) 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; bool rnti_is_user = true;
if (rnti == SRSLTE_SIRNTI || rnti == SRSLTE_PRNTI || (rnti >= SRSLTE_RARNTI_START && rnti <= SRSLTE_RARNTI_END)) { 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, srslte_dci_location_t location,
uint16_t rnti, uint32_t sf_idx) 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); 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)) { if (srslte_pdcch_encode(&q->pdcch, &dci_msg, location, rnti, q->sf_symbols, sf_idx, q->cfi)) {

@ -97,7 +97,8 @@ int main(int argc, char **argv) {
} }
/* Create CRC for Transport Block, it is not currently used but it is required */ /* 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)) { if (srslte_crc_init(&crc_tb, SRSLTE_LTE_CRC24A, 24)) {
printf("error initialising CRC\n"); printf("error initialising CRC\n");
exit(-1); exit(-1);

@ -60,6 +60,8 @@ bool verbose = false;
#define TEST(X, CODE) static bool test_##X (char *func_name, double *timing, uint32_t block_size) {\ #define TEST(X, CODE) static bool test_##X (char *func_name, double *timing, uint32_t block_size) {\
struct timeval start, end;\ struct timeval start, end;\
bzero(&start, sizeof(start));\
bzero(&end, sizeof(end));\
float mse = 0.0f;\ float mse = 0.0f;\
bool passed;\ bool passed;\
strncpy(func_name, #X, 32);\ strncpy(func_name, #X, 32);\
@ -781,7 +783,8 @@ TEST(srslte_vec_apply_cfo,
) )
TEST(srslte_cfo_correct, 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, x);
MALLOC(cf_t, z); MALLOC(cf_t, z);
@ -807,7 +810,8 @@ TEST(srslte_cfo_correct,
) )
TEST(srslte_cfo_correct_change, 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, x);
MALLOC(cf_t, z); MALLOC(cf_t, z);

@ -129,7 +129,9 @@ int main(int argc, char **argv)
{ {
int ret = SRSLTE_ERROR; int ret = SRSLTE_ERROR;
srslte::radio_multi *radio_h = NULL; 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); signal(SIGINT, sig_int_handler);

@ -190,8 +190,8 @@ uint32_t prbset_to_bitmask() {
int main(int argc, char **argv) { int main(int argc, char **argv) {
struct timeval t[3] = {}; struct timeval t[3] = {};
size_t tx_nof_bits = 0, rx_nof_bits = 0; size_t tx_nof_bits = 0, rx_nof_bits = 0;
srslte_enb_dl_t enb_dl = {}; srslte_enb_dl_t enb_dl;
srslte_ue_dl_t ue_dl = {}; srslte_ue_dl_t ue_dl;
srslte_softbuffer_tx_t *softbuffer_tx[SRSLTE_MAX_TB] = {}; srslte_softbuffer_tx_t *softbuffer_tx[SRSLTE_MAX_TB] = {};
srslte_softbuffer_rx_t *softbuffer_rx[SRSLTE_MAX_TB] = {}; srslte_softbuffer_rx_t *softbuffer_rx[SRSLTE_MAX_TB] = {};
uint8_t *data_tx[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}; cf_t *signal_buffer[SRSLTE_MAX_PORTS] = {NULL};
bzero(&enb_dl, sizeof(enb_dl));
bzero(&ue_dl, sizeof(ue_dl));
/* /*
* Allocate Memory * Allocate Memory
*/ */
@ -304,9 +307,12 @@ int main(int argc, char **argv) {
/* /*
* Run eNodeB * Run eNodeB
*/ */
srslte_ra_dl_dci_t dci = {}; srslte_ra_dl_dci_t dci;
srslte_dci_format_t dci_format = SRSLTE_DCI_FORMAT1A; 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)); prbset_num = (int) ceilf((float) cell.nof_prb / srslte_ra_type0_P(cell.nof_prb));
last_prbset_num = prbset_num; last_prbset_num = prbset_num;

@ -1176,7 +1176,8 @@ void nas::send_detach_request(bool switch_off)
return; 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) { if (switch_off) {
detach_request.detach_type.switch_off = 1; detach_request.detach_type.switch_off = 1;
detach_request.detach_type.type_of_detach = LIBLTE_MME_SO_FLAG_SWITCH_OFF; detach_request.detach_type.type_of_detach = LIBLTE_MME_SO_FLAG_SWITCH_OFF;

@ -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) 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; uint32_t si_win_start=0, si_win_len=0;
uint16_t period; uint16_t period = 0;
uint32_t sched_index; uint32_t sched_index = 0;
uint32_t x, sf, offset; uint32_t x, sf, offset;
uint32_t last_win_start = 0; uint32_t last_win_start = 0;

Loading…
Cancel
Save