[PATCH] Add constructors to gprs_rlc_v_b and gprs_rlc_v_n

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/osmocom-net-gprs@lists.osmocom.org/.

msuraev at sysmocom.de msuraev at sysmocom.de
Thu Mar 3 17:36:31 UTC 2016


From: Max <msuraev at sysmocom.de>

Fixes: Coverity: CID 1351738, 1351737
---
 src/rlc.h | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/src/rlc.h b/src/rlc.h
index 54f28df..93f0399 100644
--- a/src/rlc.h
+++ b/src/rlc.h
@@ -143,8 +143,7 @@ struct gprs_rlc_v_b {
 	void mark_invalid(int bsn);
 
 	void reset();
-
-
+	gprs_rlc_v_b();
 private:
 	bool is_state(int bsn, const gprs_rlc_dl_bsn_state state) const;
 	void mark(int bsn, const gprs_rlc_dl_bsn_state state);
@@ -216,6 +215,7 @@ struct gprs_rlc_v_n {
 	bool is_received(int bsn) const;
 
 	gprs_rlc_ul_bsn_state state(int bsn) const;
+	gprs_rlc_v_n();
 private:
 	bool is_state(int bsn, const gprs_rlc_ul_bsn_state state) const;
 	void mark(int bsn, const gprs_rlc_ul_bsn_state state);
@@ -490,6 +490,16 @@ inline const int16_t gprs_rlc_dl_window::distance() const
 	return (m_v_s - m_v_a) & mod_sns();
 }
 
+inline gprs_rlc_v_b::gprs_rlc_v_b()
+{
+	reset();
+}
+
+inline gprs_rlc_v_n::gprs_rlc_v_n()
+{
+	reset();
+}
+
 inline gprs_rlc_ul_window::gprs_rlc_ul_window()
 	: m_v_r(0)
 	, m_v_q(0)
-- 
2.7.2




More information about the osmocom-net-gprs mailing list