<p>Patch set 2:<span style="border-radius: 3px; display: inline-block; margin: 0 2px; padding: 4px;background-color: #ffd4d4;">Code-Review -1</span></p><p><a href="https://gerrit.osmocom.org/c/libosmocore/+/23925">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/libosmocore/+/23925/2/include/osmocom/core/tdef.h">File include/osmocom/core/tdef.h:</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/libosmocore/+/23925/2/include/osmocom/core/tdef.h@163">Patch Set #2, Line 163:</a> <code style="font-family:monospace,monospace">int _osmo_tdef_fsm_inst_state_chg(struct osmo_fsm_inst *fi, uint32_t state,</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">_osmo_tdef_fsm_inst_state_chg calls:<br>"osmo_tdef_get(tdefs, t->T, OSMO_TDEF_S, default_timeout);"</p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">which contains:<br>"""<br>unsigned long osmo_tdef_get(const struct osmo_tdef *tdefs, int T, enum osmo_tdef_unit as_unit, long val_if_not_present)<br>{<br>      const struct osmo_tdef *t = osmo_tdef_get_entry((struct osmo_tdef*)tdefs, T);<br> if (!t) {<br>             OSMO_ASSERT(val_if_not_present >= 0);<br>              return val_if_not_present;<br>    }<br>     return osmo_tdef_round(t->val, t->unit, as_unit);<br>}<br>"""</pre><p style="white-space: pre-wrap; word-wrap: break-word;">So yes, it asserts on -1 being passed. It's even documented there, and there's plenty of uses.<br>So in summary, if someone passes "-1" to osmo_tdef_fsm_inst_state_chg, it will ASSERT if the timer is not found, which is the expected behavior.</p><p style="white-space: pre-wrap; word-wrap: break-word;">So please, don't drop that comment/use case. If at all, feel free to express it as "-1 casted to an unsigned long" or ULONG_MAX or whatever.</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.osmocom.org/c/libosmocore/+/23925">change 23925</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/libosmocore/+/23925"/><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-Change-Id: I51b9172603984839448346c9836e43c8c802fcf8 </div>
<div style="display:none"> Gerrit-Change-Number: 23925 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: neels <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-Comment-Date: Wed, 28 Apr 2021 10:34:18 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-Has-Labels: Yes </div>
<div style="display:none"> Gerrit-MessageType: comment </div>