X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/a0b5606ec769968b10c765f8ff50f312d691ef62..ad8a47b89fc3c5a3302255f318b1ed805838cf72:/src/sound.c diff --git a/src/sound.c b/src/sound.c index 27e06b8aba..f8c6b48305 100644 --- a/src/sound.c +++ b/src/sound.c @@ -55,6 +55,8 @@ along with GNU Emacs. If not, see . */ /* BEGIN: Non Windows Includes */ #ifndef WINDOWSNT +#include + #include /* FreeBSD has machine/soundcard.h. Voxware sound driver docs mention @@ -461,8 +463,7 @@ static u_int32_t le2hl (u_int32_t value) { #ifdef WORDS_BIGENDIAN - unsigned char *p = (unsigned char *) &value; - value = p[0] + (p[1] << 8) + (p[2] << 16) + (p[3] << 24); + value = bswap_32 (value); #endif return value; } @@ -475,8 +476,7 @@ static u_int16_t le2hs (u_int16_t value) { #ifdef WORDS_BIGENDIAN - unsigned char *p = (unsigned char *) &value; - value = p[0] + (p[1] << 8); + value = bswap_16 (value); #endif return value; } @@ -489,30 +489,11 @@ static u_int32_t be2hl (u_int32_t value) { #ifndef WORDS_BIGENDIAN - unsigned char *p = (unsigned char *) &value; - value = p[3] + (p[2] << 8) + (p[1] << 16) + (p[0] << 24); + value = bswap_32 (value); #endif return value; } - -#if 0 /* Currently not used. */ - -/* Convert 16-bit value VALUE which is in big-endian byte-order - to host byte-order. */ - -static u_int16_t -be2hs (u_int16_t value) -{ -#ifndef WORDS_BIGENDIAN - unsigned char *p = (unsigned char *) &value; - value = p[1] + (p[0] << 8); -#endif - return value; -} - -#endif /* 0 */ - /*********************************************************************** RIFF-WAVE (*.wav) ***********************************************************************/