<p>fixeria has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/libosmocore/+/22717">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">gsm0808: gsm0808_create_ass2(): use osmo_store{16,32}be()<br><br>This API makes the code simpler and easier to read.<br><br>Change-Id: Ibe9eaaa2a9344ba798631b8f115ad248f0a2f76b<br>---<br>M src/gsm/gsm0808.c<br>1 file changed, 5 insertions(+), 16 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/17/22717/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/gsm/gsm0808.c b/src/gsm/gsm0808.c</span><br><span>index 971d962..bd3afeb 100644</span><br><span>--- a/src/gsm/gsm0808.c</span><br><span>+++ b/src/gsm/gsm0808.c</span><br><span>@@ -494,8 +494,6 @@</span><br><span> {</span><br><span>    /* See also: 3GPP TS 48.008 3.2.1.1 ASSIGNMENT REQUEST */</span><br><span>    struct msgb *msg;</span><br><span style="color: hsl(0, 100%, 40%);">-       uint16_t cic_sw;</span><br><span style="color: hsl(0, 100%, 40%);">-        uint32_t ci_sw;</span><br><span> </span><br><span>  /* Mandatory emelent! */</span><br><span>     OSMO_ASSERT(ct);</span><br><span>@@ -514,9 +512,8 @@</span><br><span> </span><br><span>   /* Circuit Identity Code 3.2.2.2  */</span><br><span>         if (cic) {</span><br><span style="color: hsl(0, 100%, 40%);">-              cic_sw = osmo_htons(*cic);</span><br><span style="color: hsl(0, 100%, 40%);">-              msgb_tv_fixed_put(msg, GSM0808_IE_CIRCUIT_IDENTITY_CODE,</span><br><span style="color: hsl(0, 100%, 40%);">-                                  sizeof(cic_sw), (uint8_t *) & cic_sw);</span><br><span style="color: hsl(120, 100%, 40%);">+          msgb_v_put(msg, GSM0808_IE_CIRCUIT_IDENTITY_CODE);</span><br><span style="color: hsl(120, 100%, 40%);">+            osmo_store16be(*cic, msgb_put(msg, sizeof(*cic)));</span><br><span>   }</span><br><span> </span><br><span>        /* AoIP: AoIP Transport Layer Address (MGW) 3.2.2.102 */</span><br><span>@@ -531,17 +528,9 @@</span><br><span>      /* AoIP: Call Identifier 3.2.2.105 */</span><br><span>        if (ci) {</span><br><span>            /* NOTE: 3GPP TS 48.008, section 3.2.2.105 specifies that</span><br><span style="color: hsl(0, 100%, 40%);">-                  the least significant byte should be transmitted first.</span><br><span style="color: hsl(0, 100%, 40%);">-                 On x86, this would mean that the endieness is already</span><br><span style="color: hsl(0, 100%, 40%);">-                   correct, however a platform independed implementation</span><br><span style="color: hsl(0, 100%, 40%);">-                   is required: */</span><br><span style="color: hsl(0, 100%, 40%);">-#ifndef OSMO_IS_LITTLE_ENDIAN</span><br><span style="color: hsl(0, 100%, 40%);">-         ci_sw = osmo_swab32(*ci);</span><br><span style="color: hsl(0, 100%, 40%);">-#else</span><br><span style="color: hsl(0, 100%, 40%);">-          ci_sw = *ci;</span><br><span style="color: hsl(0, 100%, 40%);">-#endif</span><br><span style="color: hsl(0, 100%, 40%);">-              msgb_tv_fixed_put(msg, GSM0808_IE_CALL_ID, sizeof(ci_sw),</span><br><span style="color: hsl(0, 100%, 40%);">-                                 (uint8_t *) & ci_sw);</span><br><span style="color: hsl(120, 100%, 40%);">+            * the least significant byte shall be transmitted first. */</span><br><span style="color: hsl(120, 100%, 40%);">+          msgb_v_put(msg, GSM0808_IE_CALL_ID);</span><br><span style="color: hsl(120, 100%, 40%);">+          osmo_store32le(*ci, msgb_put(msg, sizeof(*ci)));</span><br><span>     }</span><br><span> </span><br><span>        if (kc)</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/libosmocore/+/22717">change 22717</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/+/22717"/><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: Ibe9eaaa2a9344ba798631b8f115ad248f0a2f76b </div>
<div style="display:none"> Gerrit-Change-Number: 22717 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: fixeria <vyanitskiy@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>