<p>lynxis lazus has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-pcu/+/14571">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">Encoding: use uint16_t when interacting with the window object<br><br>The ESN, SSN and uncompress bitmap len are uint16_t. The Window is using uint16_t in<br>function arguments and return values. Don't do so many integer conversions.<br><br>Change-Id: If62fa09d7bfa8e91ce707824f7019edb1b83da9e<br>---<br>M src/encoding.cpp<br>1 file changed, 3 insertions(+), 3 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/71/14571/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/encoding.cpp b/src/encoding.cpp</span><br><span>index a290c65..e868379 100644</span><br><span>--- a/src/encoding.cpp</span><br><span>+++ b/src/encoding.cpp</span><br><span>@@ -837,14 +837,14 @@</span><br><span>       uint8_t len;</span><br><span>         bool bow = true;</span><br><span>     bool eow = true;</span><br><span style="color: hsl(0, 100%, 40%);">-        int ssn = window->mod_sns(window->v_q() + 1);</span><br><span style="color: hsl(120, 100%, 40%);">+   uint16_t ssn = window->mod_sns(window->v_q() + 1);</span><br><span>     unsigned int num_blocks = window->mod_sns(window->v_r() - window->v_q());</span><br><span style="color: hsl(0, 100%, 40%);">-      int esn_crbb = window->mod_sns(ssn - 1);</span><br><span style="color: hsl(120, 100%, 40%);">+   uint16_t esn_crbb = window->mod_sns(ssn - 1);</span><br><span>     static  uint8_t rbb[RLC_EGPRS_MAX_WS] = {'\0'};</span><br><span>      uint8_t iter = 0;</span><br><span>    int is_compressed = 0;</span><br><span>       bool try_compression = false;</span><br><span style="color: hsl(0, 100%, 40%);">-   uint8_t ucmp_bmplen;</span><br><span style="color: hsl(120, 100%, 40%);">+  uint16_t ucmp_bmplen;</span><br><span>        uint8_t crbb_bitmap[23] = {'\0'};</span><br><span>    bitvec ucmp_vec;</span><br><span>     bitvec crbb_vec;</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-pcu/+/14571">change 14571</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/osmo-pcu/+/14571"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-pcu </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: If62fa09d7bfa8e91ce707824f7019edb1b83da9e </div>
<div style="display:none"> Gerrit-Change-Number: 14571 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: lynxis lazus <lynxis@fe80.eu> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>