Change in ...osmo-pcu[master]: Encoding: use uint16_t when interacting with the window object

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/gerrit-log@lists.osmocom.org/.

lynxis lazus gerrit-no-reply at lists.osmocom.org
Sat Jun 22 14:13:22 UTC 2019


lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-pcu/+/14571


Change subject: Encoding: use uint16_t when interacting with the window object
......................................................................

Encoding: use uint16_t when interacting with the window object

The ESN, SSN and uncompress bitmap len are uint16_t. The Window is using uint16_t in
function arguments and return values. Don't do so many integer conversions.

Change-Id: If62fa09d7bfa8e91ce707824f7019edb1b83da9e
---
M src/encoding.cpp
1 file changed, 3 insertions(+), 3 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/71/14571/1

diff --git a/src/encoding.cpp b/src/encoding.cpp
index a290c65..e868379 100644
--- a/src/encoding.cpp
+++ b/src/encoding.cpp
@@ -837,14 +837,14 @@
 	uint8_t len;
 	bool bow = true;
 	bool eow = true;
-	int ssn = window->mod_sns(window->v_q() + 1);
+	uint16_t ssn = window->mod_sns(window->v_q() + 1);
 	unsigned int num_blocks = window->mod_sns(window->v_r() - window->v_q());
-	int esn_crbb = window->mod_sns(ssn - 1);
+	uint16_t esn_crbb = window->mod_sns(ssn - 1);
 	static  uint8_t rbb[RLC_EGPRS_MAX_WS] = {'\0'};
 	uint8_t iter = 0;
 	int is_compressed = 0;
 	bool try_compression = false;
-	uint8_t ucmp_bmplen;
+	uint16_t ucmp_bmplen;
 	uint8_t crbb_bitmap[23] = {'\0'};
 	bitvec ucmp_vec;
 	bitvec crbb_vec;

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/14571
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Change-Id: If62fa09d7bfa8e91ce707824f7019edb1b83da9e
Gerrit-Change-Number: 14571
Gerrit-PatchSet: 1
Gerrit-Owner: lynxis lazus <lynxis at fe80.eu>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190622/95d60922/attachment.htm>


More information about the gerrit-log mailing list