X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/a0b5606ec769968b10c765f8ff50f312d691ef62..09af58633c2a83b61dee86bcf3794122b101671a:/src/sound.c diff --git a/src/sound.c b/src/sound.c index 27e06b8aba..e84f7415cd 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) ***********************************************************************/ @@ -1351,7 +1332,7 @@ Internal use only, use `play-sound' instead. */) { /* Open the sound file. */ current_sound->fd = openp (list1 (Vdata_directory), - attrs[SOUND_FILE], Qnil, &file, Qnil); + attrs[SOUND_FILE], Qnil, &file, Qnil, 0); if (current_sound->fd < 0) sound_perror ("Could not open sound file");