summaryrefslogtreecommitdiff
path: root/src/sound.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/sound.c')
-rw-r--r--src/sound.c99
1 files changed, 29 insertions, 70 deletions
diff --git a/src/sound.c b/src/sound.c
index b362fc8819e..6fa6f548917 100644
--- a/src/sound.c
+++ b/src/sound.c
@@ -328,8 +328,7 @@ static int do_play_sound (const char *, unsigned long);
/* Like perror, but signals an error. */
static void
-sound_perror (msg)
- char *msg;
+sound_perror (char *msg)
{
int saved_errno = errno;
@@ -347,8 +346,7 @@ sound_perror (msg)
/* Display a warning message. */
static void
-sound_warning (msg)
- char *msg;
+sound_warning (char *msg)
{
message (msg);
}
@@ -381,9 +379,7 @@ sound_warning (msg)
range [0, 1]. */
static int
-parse_sound (sound, attrs)
- Lisp_Object sound;
- Lisp_Object *attrs;
+parse_sound (Lisp_Object sound, Lisp_Object *attrs)
{
/* SOUND must be a list starting with the symbol `sound'. */
if (!CONSP (sound) || !EQ (XCAR (sound), Qsound))
@@ -452,8 +448,7 @@ parse_sound (sound, attrs)
S is the sound file structure to fill in. */
static void
-find_sound_type (s)
- struct sound *s;
+find_sound_type (struct sound *s)
{
if (!wav_init (s) && !au_init (s))
error ("Unknown sound format");
@@ -463,8 +458,7 @@ find_sound_type (s)
/* Function installed by play-sound-internal with record_unwind_protect. */
static Lisp_Object
-sound_cleanup (arg)
- Lisp_Object arg;
+sound_cleanup (Lisp_Object arg)
{
if (current_sound_device->close)
current_sound_device->close (current_sound_device);
@@ -484,8 +478,7 @@ sound_cleanup (arg)
to host byte-order. */
static u_int32_t
-le2hl (value)
- u_int32_t value;
+le2hl (u_int32_t value)
{
#ifdef WORDS_BIG_ENDIAN
unsigned char *p = (unsigned char *) &value;
@@ -499,8 +492,7 @@ le2hl (value)
to host byte-order. */
static u_int16_t
-le2hs (value)
- u_int16_t value;
+le2hs (u_int16_t value)
{
#ifdef WORDS_BIG_ENDIAN
unsigned char *p = (unsigned char *) &value;
@@ -514,8 +506,7 @@ le2hs (value)
to host byte-order. */
static u_int32_t
-be2hl (value)
- u_int32_t value;
+be2hl (u_int32_t value)
{
#ifndef WORDS_BIG_ENDIAN
unsigned char *p = (unsigned char *) &value;
@@ -554,8 +545,7 @@ be2hs (value)
Value is non-zero if the file is a WAV file. */
static int
-wav_init (s)
- struct sound *s;
+wav_init (struct sound *s)
{
struct wav_header *header = (struct wav_header *) s->header;
@@ -590,9 +580,7 @@ wav_init (s)
/* Play RIFF-WAVE audio file S on sound device SD. */
static void
-wav_play (s, sd)
- struct sound *s;
- struct sound_device *sd;
+wav_play (struct sound *s, struct sound_device *sd)
{
struct wav_header *header = (struct wav_header *) s->header;
@@ -665,8 +653,7 @@ enum au_encoding
Value is non-zero if the file is an AU file. */
static int
-au_init (s)
- struct sound *s;
+au_init (struct sound *s)
{
struct au_header *header = (struct au_header *) s->header;
@@ -692,9 +679,7 @@ au_init (s)
/* Play Sun audio file S on sound device SD. */
static void
-au_play (s, sd)
- struct sound *s;
- struct sound_device *sd;
+au_play (struct sound *s, struct sound_device *sd)
{
struct au_header *header = (struct au_header *) s->header;
@@ -740,8 +725,7 @@ au_play (s, sd)
otherwise use a default device name. */
static void
-vox_open (sd)
- struct sound_device *sd;
+vox_open (struct sound_device *sd)
{
char *file;
@@ -760,8 +744,7 @@ vox_open (sd)
/* Configure device SD from parameters in it. */
static void
-vox_configure (sd)
- struct sound_device *sd;
+vox_configure (struct sound_device *sd)
{
int val;
@@ -814,8 +797,7 @@ vox_configure (sd)
/* Close device SD if it is open. */
static void
-vox_close (sd)
- struct sound_device *sd;
+vox_close (struct sound_device *sd)
{
if (sd->fd >= 0)
{
@@ -845,9 +827,7 @@ vox_close (sd)
/* Choose device-dependent format for device SD from sound file S. */
static void
-vox_choose_format (sd, s)
- struct sound_device *sd;
- struct sound *s;
+vox_choose_format (struct sound_device *sd, struct sound *s)
{
if (s->type == RIFF)
{
@@ -890,8 +870,7 @@ vox_choose_format (sd, s)
structure. */
static int
-vox_init (sd)
- struct sound_device *sd;
+vox_init (struct sound_device *sd)
{
char *file;
int fd;
@@ -921,10 +900,7 @@ vox_init (sd)
/* Write NBYTES bytes from BUFFER to device SD. */
static void
-vox_write (sd, buffer, nbytes)
- struct sound_device *sd;
- const char *buffer;
- int nbytes;
+vox_write (struct sound_device *sd, const char *buffer, int nbytes)
{
int nwritten = emacs_write (sd->fd, buffer, nbytes);
if (nwritten < 0)
@@ -939,9 +915,7 @@ vox_write (sd, buffer, nbytes)
/* This driver is available on GNU/Linux. */
static void
-alsa_sound_perror (msg, err)
- char *msg;
- int err;
+alsa_sound_perror (char *msg, int err)
{
error ("%s: %s", msg, snd_strerror (err));
}
@@ -958,8 +932,7 @@ struct alsa_params
otherwise use a default device name. */
static void
-alsa_open (sd)
- struct sound_device *sd;
+alsa_open (struct sound_device *sd)
{
char *file;
struct alsa_params *p;
@@ -986,8 +959,7 @@ alsa_open (sd)
}
static int
-alsa_period_size (sd)
- struct sound_device *sd;
+alsa_period_size (struct sound_device *sd)
{
struct alsa_params *p = (struct alsa_params *) sd->data;
int fact = snd_pcm_format_size (sd->format, 1) * sd->channels;
@@ -995,8 +967,7 @@ alsa_period_size (sd)
}
static void
-alsa_configure (sd)
- struct sound_device *sd;
+alsa_configure (struct sound_device *sd)
{
int val, err, dir;
unsigned uval;
@@ -1115,8 +1086,7 @@ alsa_configure (sd)
/* Close device SD if it is open. */
static void
-alsa_close (sd)
- struct sound_device *sd;
+alsa_close (struct sound_device *sd)
{
struct alsa_params *p = (struct alsa_params *) sd->data;
if (p)
@@ -1137,9 +1107,7 @@ alsa_close (sd)
/* Choose device-dependent format for device SD from sound file S. */
static void
-alsa_choose_format (sd, s)
- struct sound_device *sd;
- struct sound *s;
+alsa_choose_format (struct sound_device *sd, struct sound *s)
{
struct alsa_params *p = (struct alsa_params *) sd->data;
if (s->type == RIFF)
@@ -1194,10 +1162,7 @@ alsa_choose_format (sd, s)
/* Write NBYTES bytes from BUFFER to device SD. */
static void
-alsa_write (sd, buffer, nbytes)
- struct sound_device *sd;
- const char *buffer;
- int nbytes;
+alsa_write (struct sound_device *sd, const char *buffer, int nbytes)
{
struct alsa_params *p = (struct alsa_params *) sd->data;
@@ -1244,12 +1209,7 @@ alsa_write (sd, buffer, nbytes)
}
static void
-snd_error_quiet (file, line, function, err, fmt)
- const char *file;
- int line;
- const char *function;
- int err;
- const char *fmt;
+snd_error_quiet (const char *file, int line, const char *function, int err, const char *fmt)
{
}
@@ -1257,8 +1217,7 @@ snd_error_quiet (file, line, function, err, fmt)
structure. */
static int
-alsa_init (sd)
- struct sound_device *sd;
+alsa_init (struct sound_device *sd)
{
char *file;
snd_pcm_t *handle;
@@ -1524,7 +1483,7 @@ Internal use only, use `play-sound' instead. */)
***********************************************************************/
void
-syms_of_sound ()
+syms_of_sound (void)
{
QCdevice = intern_c_string(":device");
staticpro (&QCdevice);
@@ -1540,7 +1499,7 @@ syms_of_sound ()
void
-init_sound ()
+init_sound (void)
{
}