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

@ -200,14 +200,10 @@ enum esd_client_state {
};
typedef int esd_client_state_t;
/* switch endian order for cross platform playing */
#define swap_endian_32(x) ((x >> 24) | ((x >> 8) & 0xFF00) | (((x & 0xFF00) << 8)) | (x << 24))
#define maybe_swap_endian_32(c,x) ((c) ? swap_endian_32(x) : x)
/* the endian key is transferred in binary, if it's read into int, */
/* and matches ESD_ENDIAN_KEY (ENDN), then the endianness of the */
/* server and the client match; if it's SWAP_ENDIAN_KEY, swap data */
#define ESD_SWAP_ENDIAN_KEY ((uint32_t) swap_endian_32(ESD_ENDIAN_KEY))
#define ESD_SWAP_ENDIAN_KEY (UINT32_SWAP(ESD_ENDIAN_KEY))
#endif