Change in ...osmo-pcu[master]: decompress_crbb: replace int8_t with uint8_t as length

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
Sun Jun 16 23:57:45 UTC 2019


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


Change subject: decompress_crbb: replace int8_t with uint8_t as length
......................................................................

decompress_crbb: replace int8_t with uint8_t as length

There should not be a negative length.

Change-Id: I7099bff92eba3bf4db8601a2575c721e2579ce8e
---
M src/egprs_rlc_compression.cpp
M src/egprs_rlc_compression.h
M tests/bitcomp/BitcompTest.cpp
3 files changed, 4 insertions(+), 4 deletions(-)



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

diff --git a/src/egprs_rlc_compression.cpp b/src/egprs_rlc_compression.cpp
index 7eeb7d2..927c6cd 100644
--- a/src/egprs_rlc_compression.cpp
+++ b/src/egprs_rlc_compression.cpp
@@ -486,14 +486,14 @@
 }
 
 /* Decompress received block bitmap
- * \param compress_bmap_len[in] Compressed bitmap length
+ * \param compress_bmap_len[in] Compressed bitmap length in bits
  * \param start[in] Starting Color Code, true if bitmap starts with a run
  *	    	    length of ones, false if zeros; see 9.1.10, 3GPP 44.060.
  * \param orig_crbb_buf[in] Received block crbb bitmap
  * \param dest[out] Uncompressed bitvector
  */
 int egprs_compress::decompress_crbb(
-		int8_t compress_bmap_len,
+		uint8_t compress_bmap_len,
 		bool start,
 		const uint8_t *orig_crbb_buf,
 		bitvec *dest)
diff --git a/src/egprs_rlc_compression.h b/src/egprs_rlc_compression.h
index 4d2501b..dd1b9b9 100644
--- a/src/egprs_rlc_compression.h
+++ b/src/egprs_rlc_compression.h
@@ -11,7 +11,7 @@
 class egprs_compress
 {
 public:
-	static int decompress_crbb(int8_t compress_bmap_len,
+	static int decompress_crbb(uint8_t compress_bmap_len,
 		bool start, const uint8_t *orig_buf,
 		bitvec *dest);
 	egprs_compress();
diff --git a/tests/bitcomp/BitcompTest.cpp b/tests/bitcomp/BitcompTest.cpp
index 98bb2cc..29a8c15 100644
--- a/tests/bitcomp/BitcompTest.cpp
+++ b/tests/bitcomp/BitcompTest.cpp
@@ -24,7 +24,7 @@
 void *tall_pcu_ctx;
 
 struct test_data {
-	int8_t crbb_len;
+	uint8_t crbb_len;
 	uint8_t cc;
 	uint8_t crbb_data[MAX_CRBB_LEN]; /* compressed data */
 	uint8_t ucmp_data[MAX_URBB_LEN]; /* uncompressed data */

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

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Change-Id: I7099bff92eba3bf4db8601a2575c721e2579ce8e
Gerrit-Change-Number: 14480
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/20190616/7ab83237/attachment.htm>


More information about the gerrit-log mailing list