<p><a href="https://gerrit.osmocom.org/9996">View Change</a></p><p>1 comment:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/#/c/9996/1/src/coding/gsm0503_coding.c">File src/coding/gsm0503_coding.c:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/#/c/9996/1/src/coding/gsm0503_coding.c@942">Patch Set #1, Line 942:</a> <code style="font-family:monospace,monospace">     if (n_bits_total) *n_bits_total = 0;</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">Do we also initialize both variables on other decoding functions? And why not to initialize both by  […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">I think if we initialize in the callee (i.e. here), then we should do in _all_ *_decode functions.</p><p style="white-space: pre-wrap; word-wrap: break-word;">Whether to initialize in the caller or callee (us): I think in general it's safest to do it here (callee), as we then do 'the right thing' no matter if the caller is lazy and forgets about proper initialization.</p><p style="white-space: pre-wrap; word-wrap: break-word;">However, if there are valid use cases where the counter should be preserved (i.e. incremented) over multiple calls, and each call should increment the counter, we must place the burden of zero-initialization on the caller.</p><p style="white-space: pre-wrap; word-wrap: break-word;">In any case, coding style should be observed (if clause on separate line).</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.osmocom.org/9996">change 9996</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/9996"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: libosmocore </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: comment </div>
<div style="display:none"> Gerrit-Change-Id: I4722cae3794ccbb12001113c991d9cf345a52a96 </div>
<div style="display:none"> Gerrit-Change-Number: 9996 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Alexander Chemeris <Alexander.Chemeris@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-CC: Harald Welte <laforge@gnumonks.org> </div>
<div style="display:none"> Gerrit-CC: Vadim Yanitskiy <axilirator@gmail.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Mon, 16 Jul 2018 08:23:55 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-HasLabels: No </div>