<p>fixeria <strong>submitted</strong> this change.</p><p><a href="https://gerrit.osmocom.org/c/osmo-ci/+/26045">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">scripts: add a script for checking presence of <endian.h><br><br>Change-Id: I6a1e7fc2e96f42fc596f47b4d7f1ac6c61d834b6<br>---<br>A scripts/verify_endian_header.sh<br>1 file changed, 23 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/scripts/verify_endian_header.sh b/scripts/verify_endian_header.sh</span><br><span>new file mode 100755</span><br><span>index 0000000..9dcbc0e</span><br><span>--- /dev/null</span><br><span>+++ b/scripts/verify_endian_header.sh</span><br><span>@@ -0,0 +1,23 @@</span><br><span style="color: hsl(120, 100%, 40%);">+#!/bin/sh</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+# Usage: ./verify_endian_header.sh $(find . -name "*.[hc]")</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+HEADER="osmocom/core/endian.h"</span><br><span style="color: hsl(120, 100%, 40%);">+COUNT=0</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+for f in $*; do</span><br><span style="color: hsl(120, 100%, 40%);">+    # Obviously, ignore the header file defining the macros</span><br><span style="color: hsl(120, 100%, 40%);">+       if [ $(basename $f) = $(basename $HEADER) ]; then</span><br><span style="color: hsl(120, 100%, 40%);">+             continue</span><br><span style="color: hsl(120, 100%, 40%);">+      fi</span><br><span style="color: hsl(120, 100%, 40%);">+    # Match files using either of OSMO_IS_{LITTLE,BIG}_ENDIAN</span><br><span style="color: hsl(120, 100%, 40%);">+     if grep -q "OSMO_IS_\(LITTLE\|BIG\)_ENDIAN" $f; then</span><br><span style="color: hsl(120, 100%, 40%);">+                # The header file must be included</span><br><span style="color: hsl(120, 100%, 40%);">+            if ! grep -q "#include <$HEADER>" $f; then</span><br><span style="color: hsl(120, 100%, 40%);">+                    echo "File '$f' does not #include <$HEADER>"</span><br><span style="color: hsl(120, 100%, 40%);">+                  COUNT=$((COUNT + 1))</span><br><span style="color: hsl(120, 100%, 40%);">+          fi</span><br><span style="color: hsl(120, 100%, 40%);">+    fi</span><br><span style="color: hsl(120, 100%, 40%);">+done</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+exit $COUNT</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-ci/+/26045">change 26045</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-ci/+/26045"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-ci </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I6a1e7fc2e96f42fc596f47b4d7f1ac6c61d834b6 </div>
<div style="display:none"> Gerrit-Change-Number: 26045 </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-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>