osmith has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/gapk/+/31389 )


Change subject: Run struct_endianness.py
......................................................................

Run struct_endianness.py

Use the OSMO_IS_LITTLE_ENDIAN / OSMO_IS_BIG_ENDIAN macros from
libosmocore and run struct_endianness.py to auto-generate the big endian
part.

Related: OS#5884
Change-Id: Ibeb96f61054b11ca9d82f8d9a00c3935ffb086a6
---
M src/pq_rtp.c
1 file changed, 20 insertions(+), 18 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/gapk refs/changes/89/31389/1

diff --git a/src/pq_rtp.c b/src/pq_rtp.c
index 3a09ba7..a5543a6 100644
--- a/src/pq_rtp.c
+++ b/src/pq_rtp.c
@@ -30,33 +30,21 @@
 #include <osmocom/gapk/codecs.h>
 #include <osmocom/gapk/formats.h>
 #include <osmocom/gapk/procqueue.h>
-
-#ifndef __BYTE_ORDER
-# ifdef __APPLE__
-#  define __BYTE_ORDER __DARWIN_BYTE_ORDER
-#  define __LITTLE_ENDIAN __DARWIN_LITTLE_ENDIAN
-#  define __BIG_ENDIAN __DARWIN_BIG_ENDIAN
-# else
-#  error "__BYTE_ORDER should be defined by someone"
-# endif
-#endif
+#include <osmocom/core/endian.h>

 /* according to RFC 3550 */
 struct rtp_hdr {
-#if __BYTE_ORDER == __LITTLE_ENDIAN
+#if OSMO_IS_LITTLE_ENDIAN
        uint8_t  csrc_count:4,
                  extension:1,
                  padding:1,
                  version:2;
        uint8_t  payload_type:7,
                  marker:1;
-#elif __BYTE_ORDER == __BIG_ENDIAN
-       uint8_t  version:2,
-                 padding:1,
-                 extension:1,
-                 csrc_count:4;
-       uint8_t  marker:1,
-                 payload_type:7;
+#elif OSMO_IS_BIG_ENDIAN
+/* auto-generated from the little endian part above 
(libosmocore/contrib/struct_endianness.py) */
+       uint8_t  version:2, padding:1, extension:1, csrc_count:4;
+       uint8_t  marker:1, payload_type:7;
 #endif
        uint16_t sequence;
        uint32_t timestamp;

--
To view, visit https://gerrit.osmocom.org/c/gapk/+/31389
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: gapk
Gerrit-Branch: master
Gerrit-Change-Id: Ibeb96f61054b11ca9d82f8d9a00c3935ffb086a6
Gerrit-Change-Number: 31389
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <[email protected]>
Gerrit-MessageType: newchange

Reply via email to