<p><a href="https://gerrit.osmocom.org/c/osmo-pcu/+/15459">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/15459/3/src/gprs_ms.h">File src/gprs_ms.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/15459/3/src/gprs_ms.h@43">Patch Set #3, Line 43:</a> </p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><pre style="font-family: monospace,monospace; white-space: pre-wrap;">struct gprs_rlcmac_ms {<br>   bool app_info_send;<br>};<br></pre></blockquote></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">> why an extra struct around a single member? […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Quick break down of the possibilities; I have no strong opinion on which one it *should* be, but here are the alternatives:</p><p style="white-space: pre-wrap; word-wrap: break-word;">Using just a bool:<br>The simplest C way would be to add bool app_info_send as a public member field, so anyone can read and write directly, which is how we do it in pretty much every other osmocom code base.<br>The next simpler way would be to return a bool* in ms_data(), but I'd prefer getter/setter.</p><p style="white-space: pre-wrap; word-wrap: break-word;">But if there will be more members in ms_data in the future, a struct is indeed a good choice.</p><p style="white-space: pre-wrap; word-wrap: break-word;">Using a struct:<br>The simplest C way would be to have m_ms_data as a public compound member like:</p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">    class GprsMs {<br>    public:<br>            struct {<br>                    bool app_info_send;<br>            } m_ms_data;<br>    };</pre><p style="white-space: pre-wrap; word-wrap: break-word;">The way this patch currently does it would be the choice if other code would re-use this struct (e.g. to store/pass-around all ms_data members in one, which seems a bit weird if there is only one member).</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-pcu/+/15459">change 15459</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/+/15459"/><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: Ie35959f833f46bde5f2126314b6f96763f863b36 </div>
<div style="display:none"> Gerrit-Change-Number: 15459 </div>
<div style="display:none"> Gerrit-PatchSet: 4 </div>
<div style="display:none"> Gerrit-Owner: osmith <osmith@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: fixeria <axilirator@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: laforge <laforge@gnumonks.org> </div>
<div style="display:none"> Gerrit-Reviewer: osmith <osmith@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-CC: neels <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-Comment-Date: Wed, 11 Sep 2019 12:43:39 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-Has-Labels: No </div>
<div style="display:none"> Comment-In-Reply-To: laforge <laforge@gnumonks.org> </div>
<div style="display:none"> Comment-In-Reply-To: osmith <osmith@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: comment </div>