/* BEGIN: Non Windows Includes */
#ifndef WINDOWSNT
+#include <byteswap.h>
+
#include <sys/ioctl.h>
/* FreeBSD has machine/soundcard.h. Voxware sound driver docs mention
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;
}
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;
}
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)
***********************************************************************/
{
/* 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");