diff options
-rw-r--r-- | src/rlc.h | 16 | ||||
-rw-r--r-- | src/tbf.cpp | 2 | ||||
-rw-r--r-- | tests/types/TypesTest.cpp | 6 |
3 files changed, 19 insertions, 5 deletions
@@ -168,6 +168,8 @@ struct gprs_rlc_dl_window { uint16_t m_v_a; /* ack state */ gprs_rlc_v_b m_v_b; + + gprs_rlc_dl_window(); }; struct gprs_rlc_v_n { @@ -213,6 +215,8 @@ struct gprs_rlc_ul_window { uint16_t m_v_q; /* receive window state */ gprs_rlc_v_n m_v_n; + + gprs_rlc_ul_window(); }; extern "C" { @@ -340,6 +344,12 @@ inline void gprs_rlc_v_b::mark_invalid(int bsn) return mark(bsn, GPRS_RLC_DL_BSN_INVALID); } +inline gprs_rlc_dl_window::gprs_rlc_dl_window() + : m_v_s(0) + , m_v_a(0) +{ +} + inline const uint16_t gprs_rlc_dl_window::sns() const { return RLC_MAX_SNS; @@ -400,6 +410,12 @@ inline const int16_t gprs_rlc_dl_window::distance() const return (m_v_s - m_v_a) & mod_sns(); } +inline gprs_rlc_ul_window::gprs_rlc_ul_window() + : m_v_r(0) + , m_v_q(0) +{ +} + inline bool gprs_rlc_ul_window::is_in_window(uint16_t bsn) const { uint16_t offset_v_q; diff --git a/src/tbf.cpp b/src/tbf.cpp index 556f6e83..fd0cd98f 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -587,7 +587,6 @@ gprs_rlcmac_ul_tbf::gprs_rlcmac_ul_tbf(BTS *bts_) : m_contention_resolution_done(0), m_final_ack_sent(0) { - memset(&m_window, 0, sizeof(m_window)); memset(&m_usf, 0, sizeof(m_usf)); } @@ -650,7 +649,6 @@ gprs_rlcmac_dl_tbf::gprs_rlcmac_dl_tbf(BTS *bts_) : m_last_dl_poll_fn(0), m_last_dl_drained_fn(0) { - memset(&m_window, 0, sizeof(m_window)); memset(&m_llc_timer, 0, sizeof(m_llc_timer)); } diff --git a/tests/types/TypesTest.cpp b/tests/types/TypesTest.cpp index 776e051e..3447f695 100644 --- a/tests/types/TypesTest.cpp +++ b/tests/types/TypesTest.cpp @@ -147,7 +147,7 @@ static void test_rlc_v_n() static void test_rlc_dl_ul_basic() { { - gprs_rlc_dl_window dl_win = { 0, }; + gprs_rlc_dl_window dl_win; OSMO_ASSERT(dl_win.window_empty()); OSMO_ASSERT(!dl_win.window_stalled()); OSMO_ASSERT(dl_win.distance() == 0); @@ -192,7 +192,7 @@ static void test_rlc_dl_ul_basic() } { - gprs_rlc_ul_window ul_win = { 0, }; + gprs_rlc_ul_window ul_win; int count; const char *rbb; char win_rbb[65]; @@ -328,7 +328,7 @@ static void test_rlc_dl_ul_basic() uint16_t lost = 0, recv = 0; char show_rbb[65]; BTS dummy_bts; - gprs_rlc_dl_window dl_win = { 0, }; + gprs_rlc_dl_window dl_win; dl_win.m_v_b.reset(); |