From 5e26e2ab1dadb1e4176d5a4cac03100a7d21c22f Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 16 Oct 2013 21:09:19 +0200 Subject: system/ByteOrder: new library for byte ordering / endianess Replacing GLib macros. --- src/pcm/PcmPack.cxx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/pcm/PcmPack.cxx') diff --git a/src/pcm/PcmPack.cxx b/src/pcm/PcmPack.cxx index fa020bf63..8920eb288 100644 --- a/src/pcm/PcmPack.cxx +++ b/src/pcm/PcmPack.cxx @@ -18,15 +18,14 @@ */ #include "PcmPack.hxx" - -#include +#include "system/ByteOrder.hxx" static void pack_sample(uint8_t *dest, const int32_t *src0) { const uint8_t *src = (const uint8_t *)src0; - if (G_BYTE_ORDER == G_BIG_ENDIAN) + if (IsBigEndian()) ++src; *dest++ = *src++; @@ -51,7 +50,7 @@ unpack_sample(int32_t *dest0, const uint8_t *src) { uint8_t *dest = (uint8_t *)dest0; - if (G_BYTE_ORDER == G_BIG_ENDIAN) + if (IsBigEndian()) /* extend the sign bit to the most fourth byte */ *dest++ = *src & 0x80 ? 0xff : 0x00; @@ -59,7 +58,7 @@ unpack_sample(int32_t *dest0, const uint8_t *src) *dest++ = *src++; *dest++ = *src; - if (G_BYTE_ORDER == G_LITTLE_ENDIAN) + if (IsLittleEndian()) /* extend the sign bit to the most fourth byte */ *dest++ = *src & 0x80 ? 0xff : 0x00; } -- cgit v1.2.3