Index: libdts-0.0.2/libdts/bitstream.h =================================================================== --- libdts-0.0.2.orig/libdts/bitstream.h +++ libdts-0.0.2/libdts/bitstream.h @@ -28,22 +28,38 @@ #else -# define swab32(x)\ -((((uint8_t*)&x)[0] << 24) | (((uint8_t*)&x)[1] << 16) | \ - (((uint8_t*)&x)[2] << 8) | (((uint8_t*)&x)[3])) +static inline uint32_t swab32(uint32_t x) { + union { + uint32_t x32; + uint8_t x8[4]; + } u; + u.x32 = x; + return u.x8[0] << 24 | u.x8[1] << 16 | u.x8[2] << 8 | u.x8[3]; +} #endif #ifdef WORDS_BIGENDIAN -# define swable32(x)\ -((((uint8_t*)&x)[0] << 16) | (((uint8_t*)&x)[1] << 24) | \ - (((uint8_t*)&x)[2]) | (((uint8_t*)&x)[3] << 8)) +static inline uint32_t swable32(uint32_t x) { + union { + uint32_t x32; + uint8_t x8[4]; + } u; + u.x32 = x; + return u.x8[0] << 16 | u.x8[1] << 24 | u.x8[2] | u.x8[3] << 8; +} #else -# define swable32(x)\ -((((uint16_t*)&x)[0] << 16) | (((uint16_t*)&x)[1])) +static inline uint32_t swable32(uint32_t x) { + union { + uint32_t x32; + uint16_t x16[2]; + } u; + u.x32 = x; + return u.x16[0] << 16 | u.x16[1]; +} #endif Index: libdts-0.0.2/libao/Makefile.am =================================================================== --- libdts-0.0.2.orig/libao/Makefile.am +++ libdts-0.0.2/libao/Makefile.am @@ -1,4 +1,4 @@ -AM_CFLAGS = $(OPT_CFLAGS) +AM_CFLAGS = $(OPT_CFLAGS) -fno-strict-aliasing noinst_LIBRARIES = libao.a libao_a_SOURCES = audio_out.c audio_out_null.c audio_out_float.c \