Let's have just one endian conversion macro suite.

git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@475 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
Pierre Ossman 2006-02-03 14:39:39 +00:00
parent 5c01c1029f
commit d9bfd5b294
3 changed files with 31 additions and 32 deletions

View file

@ -33,6 +33,9 @@
#define INT32_SWAP(x) ( (int32_t) ( ((uint32_t) x >> 24) | ((uint32_t) x << 24) | (((uint32_t) x & 0xFF00) << 8) | ((((uint32_t) x) >> 8) & 0xFF00) ) )
#define UINT32_SWAP(x) ( (uint32_t) ( ((uint32_t) x >> 24) | ((uint32_t) x << 24) | (((uint32_t) x & 0xFF00) << 8) | ((((uint32_t) x) >> 8) & 0xFF00) ) )
#define MAYBE_INT32_SWAP(c,x) ((c) ? INT32_SWAP(x) : x)
#define MAYBE_UINT32_SWAP(c,x) ((c) ? UINT32_SWAP(x) : x)
#ifdef WORDS_BIGENDIAN
#define INT16_FROM_LE(x) INT16_SWAP(x)
#define INT16_FROM_BE(x) ((int16_t)(x))