From 67f54274bd3a059038df89921de0ebd6288adfdf Mon Sep 17 00:00:00 2001 From: Frank van de Pol Date: Wed, 2 Jun 1999 00:40:31 +0000 Subject: [PATCH] Changed data type of alsa-lib handles from 'void *' to the specific type for the handle in use. This should be more type-safe as the compiler will perform checking on type now. --- alsactl/merge.c | 10 +++++----- alsactl/setup.c | 6 ++++-- amixer/amixer.c | 12 ++++++------ aplay/aplay.c | 4 ++-- 4 files changed, 17 insertions(+), 15 deletions(-) diff --git a/alsactl/merge.c b/alsactl/merge.c index daf2226..9720455 100644 --- a/alsactl/merge.c +++ b/alsactl/merge.c @@ -364,7 +364,7 @@ int soundcard_setup_merge_data(int cardno) return 0; } -static int soundcard_open_ctl(void **ctlhandle, struct soundcard *soundcard) +static int soundcard_open_ctl(snd_ctl_t **ctlhandle, struct soundcard *soundcard) { int err; @@ -377,7 +377,7 @@ static int soundcard_open_ctl(void **ctlhandle, struct soundcard *soundcard) return 0; } -static int soundcard_open_mix(void **mixhandle, struct soundcard *soundcard, struct mixer *mixer) +static int soundcard_open_mix(snd_mixer_t **mixhandle, struct soundcard *soundcard, struct mixer *mixer) { int err; @@ -393,7 +393,7 @@ static int soundcard_open_mix(void **mixhandle, struct soundcard *soundcard, str int soundcard_setup_process_switches(int cardno) { int err; - void *ctlhandle = NULL; + snd_ctl_t *ctlhandle = NULL; struct soundcard *soundcard; struct ctl_switch *ctlsw; struct mixer *mixer; @@ -461,8 +461,8 @@ int soundcard_setup_process_switches(int cardno) int soundcard_setup_process_data(int cardno) { int err; - void *ctlhandle = NULL; - void *mixhandle = NULL; + snd_ctl_t *ctlhandle = NULL; + snd_mixer_t *mixhandle = NULL; struct soundcard *soundcard; struct mixer *mixer; struct mixer_element *element; diff --git a/alsactl/setup.c b/alsactl/setup.c index d59e500..e0b7da9 100644 --- a/alsactl/setup.c +++ b/alsactl/setup.c @@ -325,7 +325,8 @@ static int determine_switches(void *handle, struct ctl_switch **csw, int interfa static int soundcard_setup_collect_switches1(int cardno) { - void *handle, *mhandle; + snd_ctl_t *handle; + snd_mixer_t *mhandle; struct soundcard *card, *first, *prev; int err, device; struct mixer *mixer, *mixerprev; @@ -495,7 +496,8 @@ int soundcard_setup_collect_switches(int cardno) static int soundcard_setup_collect_data1(int cardno) { - void *handle, *mhandle; + snd_ctl_t *handle; + snd_mixer_t *mhandle; struct soundcard *card; int err, idx; struct mixer *mixer; diff --git a/amixer/amixer.c b/amixer/amixer.c index c2983f4..4b0e6eb 100644 --- a/amixer/amixer.c +++ b/amixer/amixer.c @@ -101,7 +101,7 @@ static void help(void) int info(void) { int err; - void *handle; + snd_mixer_t *handle; snd_mixer_info_t info; if ((err = snd_mixer_open(&handle, card, device)) < 0) { @@ -645,7 +645,7 @@ int show_element_contents(void *handle, snd_mixer_eid_t *eid, const char *space) int elements(void) { int err, idx; - void *handle; + snd_mixer_t *handle; snd_mixer_elements_t elements; snd_mixer_eid_t *element; @@ -683,7 +683,7 @@ int elements(void) int elements_contents(void) { int err, idx; - void *handle; + snd_mixer_t *handle; snd_mixer_elements_t elements; snd_mixer_eid_t *element; @@ -761,7 +761,7 @@ int show_group(void *handle, snd_mixer_gid_t *gid, const char *space) int groups(void) { int err, idx; - void *handle; + snd_mixer_t *handle; snd_mixer_groups_t groups; snd_mixer_gid_t *group; @@ -1091,7 +1091,7 @@ int eset_mux1(int argc, char *argv[], void *handle, snd_mixer_eid_t *eid) int eset(int argc, char *argv[]) { int err; - void *handle; + snd_mixer_t *handle; snd_mixer_eid_t eid; if (argc < 1) { @@ -1147,7 +1147,7 @@ int eset(int argc, char *argv[]) int eget(int argc, char *argv[]) { int err; - void *handle; + snd_mixer_t *handle; snd_mixer_eid_t eid; if (argc < 1) { diff --git a/aplay/aplay.c b/aplay/aplay.c index a74288f..2e2db94 100644 --- a/aplay/aplay.c +++ b/aplay/aplay.c @@ -51,7 +51,7 @@ /* global data */ char *command; -void *pcm_handle; +snd_pcm_t *pcm_handle; struct snd_pcm_playback_info pinfo; struct snd_pcm_record_info rinfo; snd_pcm_format_t rformat, format; @@ -160,7 +160,7 @@ static void usage(char *command) static void device_list(void) { - void *handle; + snd_ctl_t *handle; int card, err, dev, idx; unsigned int mask; struct snd_ctl_hw_info info; -- 2.47.1