<p><a href="https://gerrit.osmocom.org/11787">View Change</a></p><p>2 comments:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/#/c/11787/2/include/osmocom/gprs/protocol/gsm_04_60.h">File include/osmocom/gprs/protocol/gsm_04_60.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/11787/2/include/osmocom/gprs/protocol/gsm_04_60.h@33">Patch Set #2, Line 33:</a> <code style="font-family:monospace,monospace"> uint8_t tfi_hi:2, cv:4, si:1, r:1;</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">Please change the script to add lines/formatting like in the little endian case.</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">that's "impossible" since the order is reversed. Doing it the tivial way it usually is done so far with whitespace carried along in the regexes, it would end up as:</p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">    uint8_t                tfi_hi:8;<br>                    cv:4,<br>                    si:1,<br>     r:1,</pre><p style="white-space: pre-wrap; word-wrap: break-word;">(sic)</p><p style="white-space: pre-wrap; word-wrap: break-word;">and I'm positively not going to spend time on that: it would involve interpreting indenting levels and open a whole nother chapter of pseudo intelligence.</p><p style="white-space: pre-wrap; word-wrap: break-word;">I actually also prefer the packed output in the big-endian section, so no matter what formatting the original author invented, the big-endian part is "one line per byte" and more compact; whitespace changes then (mostly) don't affect the big-endian part. To read the struct for human understanding, just read above.</p></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/#/c/11787/2/include/osmocom/gsm/protocol/gsm_03_41.h">File include/osmocom/gsm/protocol/gsm_03_41.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/11787/2/include/osmocom/gsm/protocol/gsm_03_41.h@36">Patch Set #2, Line 36:</a> <code style="font-family:monospace,monospace">            uint8_t language:4;</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">Be careful here!! […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">no, the struct is packed. They are both a single byte. If you want to have ignored bits, you need to add 'padding' members. (but you had me for a second there)</p><p style="white-space: pre-wrap; word-wrap: break-word;">try this:</p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">    cat > /tmp/x.c <<END<br>    struct foo {<br>            unsigned int a:4;<br>            unsigned int b:4;<br>    } __attribute__((packed));<br>    int main(void)<br>    {<br>            return sizeof(struct foo);<br>    }<br>    END<br>    make -C /tmp x<br>    /tmp/x; echo $?</pre><p style="white-space: pre-wrap; word-wrap: break-word;">prints 1, i.e. struct foo is one byte.</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.osmocom.org/11787">change 11787</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/11787"/><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: Ia0b99d76932aeb03e93bd0c62d3bf025dec5f9d2 </div>
<div style="display:none"> Gerrit-Change-Number: 11787 </div>
<div style="display:none"> Gerrit-PatchSet: 3 </div>
<div style="display:none"> Gerrit-Owner: Neels Hofmeyr <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder (1000002) </div>
<div style="display:none"> Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Pau Espin Pedrol <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-Comment-Date: Mon, 19 Nov 2018 16:09:52 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-HasLabels: No </div>