[S] Change in osmo-pcu[master]: tests: fix warnings about struct initialization
fixeria has submitted this change. ( https://gerrit.osmocom.org/c/osmo-pcu/+/39697?usp=email ) Change subject: tests: fix warnings about struct initialization ...................................................................... tests: fix warnings about struct initialization Assigning { 0 } to a structure is valid in C, but not in C++. Change-Id: Iaf271cd52522ea8411567bf3194b903fe2746d5c --- M tests/llc/LlcTest.cpp M tests/tbf/TbfTest.cpp M tests/types/TypesTest.cpp 3 files changed, 18 insertions(+), 18 deletions(-) Approvals: Jenkins Builder: Verified pespin: Looks good to me, approved diff --git a/tests/llc/LlcTest.cpp b/tests/llc/LlcTest.cpp index f5bc54a..9ed6f21 100644 --- a/tests/llc/LlcTest.cpp +++ b/tests/llc/LlcTest.cpp @@ -109,7 +109,7 @@ static void test_llc_queue() { gprs_llc_queue *queue = prepare_queue(); - struct timespec expire_time = {0}; + struct timespec expire_time = { }; printf("=== start %s ===\n", __func__); @@ -147,8 +147,8 @@ static void test_llc_meta() { gprs_llc_queue *queue = prepare_queue(); - MetaInfo info1 = {0}; - MetaInfo info2 = {0}; + MetaInfo info1 = { }; + MetaInfo info2 = { }; printf("=== start %s ===\n", __func__); @@ -188,8 +188,8 @@ static void test_llc_meta_pdu_life_expire() { gprs_llc_queue *queue = prepare_queue(); - MetaInfo info1 = {0}; - MetaInfo info2 = {0}; + MetaInfo info1 = { }; + MetaInfo info2 = { }; printf("=== start %s ===\n", __func__); @@ -242,7 +242,7 @@ gprs_codel_set_maxpacket(&queue->pq[i].codel_state, 8); } - MetaInfo info1 = {0}; + MetaInfo info1 = { }; printf("=== start %s ===\n", __func__); @@ -298,7 +298,7 @@ gprs_llc_queue *queue1 = prepare_queue(); struct GprsMs *ms = ms_alloc(queue1->ms->bts, NULL); gprs_llc_queue *queue2 = ms_llc_queue(ms); - struct timespec expire_time = {0}; + struct timespec expire_time = { }; printf("=== start %s ===\n", __func__); @@ -344,7 +344,7 @@ int main(int argc, char **argv) { - struct vty_app_info pcu_vty_info = {0}; + struct vty_app_info pcu_vty_info = { }; tall_pcu_ctx = talloc_named_const(NULL, 1, "LlcTest context"); if (!tall_pcu_ctx) diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index 643551b..798afad 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -723,7 +723,7 @@ static void send_control_ack(gprs_rlcmac_tbf *tbf) { - RlcMacUplink_t ulreq = {0}; + RlcMacUplink_t ulreq = { }; ulreq.u.MESSAGE_TYPE = MT_PACKET_CONTROL_ACK; Packet_Control_Acknowledgement_t *ctrl_ack = @@ -749,7 +749,7 @@ uint32_t sba_fn = *fn + 52; int tfi = 0; gprs_rlcmac_ul_tbf *ul_tbf; - RlcMacUplink_t ulreq = {0}; + RlcMacUplink_t ulreq = { }; struct gprs_rlc_ul_header_egprs_3 *egprs3 = NULL; /* needed to set last_rts_fn in the PDCH object */ @@ -892,7 +892,7 @@ uint32_t sba_fn = *fn + 52; int tfi = 0, i = 0; gprs_rlcmac_ul_tbf *ul_tbf; - RlcMacUplink_t ulreq = {0}; + RlcMacUplink_t ulreq = { }; struct gprs_rlc_ul_header_egprs_3 *egprs3 = NULL; /* needed to set last_rts_fn in the PDCH object */ @@ -1323,7 +1323,7 @@ uint32_t sba_fn = *fn + 52; int tfi = 0; gprs_rlcmac_ul_tbf *ul_tbf; - RlcMacUplink_t ulreq = {0}; + RlcMacUplink_t ulreq = { }; /* needed to set last_rts_fn in the PDCH object */ request_dl_rlc_block(bts, pdch, fn); @@ -1626,7 +1626,7 @@ uint32_t sba_fn = *fn + 52; int tfi = 0; gprs_rlcmac_ul_tbf *ul_tbf; - RlcMacUplink_t ulreq = {0}; + RlcMacUplink_t ulreq = { }; /* needed to set last_rts_fn in the PDCH object */ request_dl_rlc_block(bts, pdch, fn); @@ -2184,7 +2184,7 @@ gprs_rlcmac_dl_tbf *dl_tbf1, *dl_tbf2; GprsMs *ms1, *ms2; unsigned i; - RlcMacUplink_t ulreq = {0}; + RlcMacUplink_t ulreq = { }; fprintf(stderr, "=== start %s ===\n", __func__); @@ -2574,7 +2574,7 @@ uint32_t sba_fn = *fn + 52; int tfi = 0; gprs_rlcmac_ul_tbf *ul_tbf; - RlcMacUplink_t ulreq = {0}; + RlcMacUplink_t ulreq = { }; struct gprs_rlc_ul_header_egprs_3 *egprs3 = NULL; Packet_Resource_Request_t *presreq = NULL; MS_Radio_Access_capability_t *pmsradiocap = NULL; @@ -3406,7 +3406,7 @@ uint16_t qta = 31; int ts_no = 7; uint8_t trx_no = 0; - RlcMacUplink_t ulreq = {0}; + RlcMacUplink_t ulreq = { }; Packet_Resource_Request_t *presreq = NULL; uint8_t ms_class = 11; uint8_t egprs_ms_class = 11; @@ -3500,7 +3500,7 @@ int main(int argc, char **argv) { - struct vty_app_info pcu_vty_info = {0}; + struct vty_app_info pcu_vty_info = { }; tall_pcu_ctx = talloc_named_const(NULL, 1, "moiji-mobile TbfTest context"); if (!tall_pcu_ctx) diff --git a/tests/types/TypesTest.cpp b/tests/types/TypesTest.cpp index fdfbe40..e4a8eff 100644 --- a/tests/types/TypesTest.cpp +++ b/tests/types/TypesTest.cpp @@ -99,7 +99,7 @@ static void test_rlc() { { - struct gprs_rlc_data rlc = { 0, }; + struct gprs_rlc_data rlc = { }; memset(rlc.block, 0x23, RLC_MAX_LEN); uint8_t *p = prepare(&rlc, 20); OSMO_ASSERT(p == rlc.block); -- To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/39697?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Change-Id: Iaf271cd52522ea8411567bf3194b903fe2746d5c Gerrit-Change-Number: 39697 Gerrit-PatchSet: 2 Gerrit-Owner: fixeria <vyanitskiy@sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de> Gerrit-Reviewer: pespin <pespin@sysmocom.de>
participants (1)
-
fixeria