Warning removal.

This commit is contained in:
Jaroslav Kysela 2000-08-17 21:50:34 +00:00
parent 1adb6dc796
commit ec07b3ad20
3 changed files with 23 additions and 21 deletions

View file

@ -134,7 +134,7 @@ static int snd_ctl_hsort_mixer_priority_lookup(char **name, char * const *names,
if (!strncmp(*name, *names, strlen(*names))) {
*name += strlen(*names);
if (**name == ' ')
*name++;
(*name)++;
return res;
}
}
@ -189,7 +189,6 @@ static int snd_ctl_hsort_mixer_priority(const char *name)
"Bypass",
NULL
};
char **ptr, *s;
int res, res1;
if ((res = snd_ctl_hsort_mixer_priority_lookup((char **)&name, names, 1000000)) == NOT_FOUND)

View file

@ -43,19 +43,21 @@ int snd_mixer_open(snd_mixer_t **r_handle, int card)
*r_handle = NULL;
if ((err = snd_ctl_open(&ctl_handle, card)) < 0)
return err;
if ((err = snd_ctl_hcallback_rebuild(ctl_handle, snd_mixer_simple_read_rebuild, handle)) < 0) {
snd_ctl_close(ctl_handle);
return err;
}
if ((err = snd_ctl_hcallback_add(ctl_handle, snd_mixer_simple_read_add, handle)) < 0) {
snd_ctl_close(ctl_handle);
return err;
}
handle = (snd_mixer_t *) calloc(1, sizeof(snd_mixer_t));
if (handle == NULL) {
snd_ctl_close(ctl_handle);
return -ENOMEM;
}
if ((err = snd_ctl_hcallback_rebuild(ctl_handle, snd_mixer_simple_read_rebuild, handle)) < 0) {
snd_ctl_close(ctl_handle);
free(handle);
return err;
}
if ((err = snd_ctl_hcallback_add(ctl_handle, snd_mixer_simple_read_add, handle)) < 0) {
snd_ctl_close(ctl_handle);
free(handle);
return err;
}
handle->ctl_handle = ctl_handle;
INIT_LIST_HEAD(&handle->simples);
*r_handle = handle;
@ -103,7 +105,8 @@ int snd_mixer_simple_control_list(snd_mixer_t *handle, snd_mixer_simple_control_
struct list_head *lh;
mixer_simple_t *s;
snd_mixer_sid_t *p;
int err, idx;
int err;
unsigned int idx;
if (handle == NULL || list == NULL)
return -EINVAL;
@ -183,7 +186,7 @@ static void snd_mixer_simple_read_rebuild(snd_ctl_t *ctl_handle, void *private_d
handle->simple_changes++;
}
static void snd_mixer_simple_read_add(snd_ctl_t *ctl_handle, void *private_data, snd_hcontrol_t *hcontrol)
static void snd_mixer_simple_read_add(snd_ctl_t *ctl_handle ATTRIBUTE_UNUSED, void *private_data, snd_hcontrol_t *hcontrol)
{
snd_mixer_t *handle = (snd_mixer_t *)private_data;
mixer_simple_t *s;

View file

@ -86,12 +86,12 @@ static mixer_simple_t *simple_new(mixer_simple_t *scontrol)
return s;
}
static void hcontrol_event_change(snd_ctl_t *ctl_handle, snd_hcontrol_t *hcontrol)
static void hcontrol_event_change(snd_ctl_t *ctl_handle ATTRIBUTE_UNUSED, snd_hcontrol_t *hcontrol ATTRIBUTE_UNUSED)
{
/* ignore at this moment */
}
static void hcontrol_event_value(snd_ctl_t *ctl_handle, snd_hcontrol_t *hcontrol)
static void hcontrol_event_value(snd_ctl_t *ctl_handle ATTRIBUTE_UNUSED, snd_hcontrol_t *hcontrol)
{
snd_mixer_t *handle = (snd_mixer_t *)hcontrol->private_data;
mixer_simple_t *s;
@ -103,7 +103,7 @@ static void hcontrol_event_value(snd_ctl_t *ctl_handle, snd_hcontrol_t *hcontrol
}
}
static void hcontrol_event_remove(snd_ctl_t *ctl_handle, snd_hcontrol_t *hcontrol)
static void hcontrol_event_remove(snd_ctl_t *ctl_handle ATTRIBUTE_UNUSED, snd_hcontrol_t *hcontrol ATTRIBUTE_UNUSED)
{
/* ignore at this moment */
}
@ -365,7 +365,7 @@ static int build_input(snd_mixer_t *handle, const char *sname)
min = max = 0;
bag = NULL;
sprintf(str, "%s Switch", sname);
if (hcontrol = test_mixer_id(handle, str, index)) {
if ((hcontrol = test_mixer_id(handle, str, index)) != NULL) {
if ((err = get_mixer_info(handle, str, index, &gswitch_info)) < 0)
return err;
if (gswitch_info.type == SND_CONTROL_TYPE_BOOLEAN) {
@ -377,7 +377,7 @@ static int build_input(snd_mixer_t *handle, const char *sname)
}
}
sprintf(str, "%s Volume", sname);
if (hcontrol = test_mixer_id(handle, str, index)) {
if ((hcontrol = test_mixer_id(handle, str, index)) != NULL) {
if ((err = get_mixer_info(handle, str, index, &gvolume_info)) < 0)
return err;
if (gvolume_info.type == SND_CONTROL_TYPE_INTEGER) {
@ -393,7 +393,7 @@ static int build_input(snd_mixer_t *handle, const char *sname)
}
}
sprintf(str, "%s Playback Switch", sname);
if (hcontrol = test_mixer_id(handle, str, index)) {
if ((hcontrol = test_mixer_id(handle, str, index)) != NULL) {
if ((err = get_mixer_info(handle, str, index, &pswitch_info)) < 0)
return err;
if (pswitch_info.type == SND_CONTROL_TYPE_BOOLEAN) {
@ -405,7 +405,7 @@ static int build_input(snd_mixer_t *handle, const char *sname)
}
}
sprintf(str, "%s Capture Switch", sname);
if (hcontrol = test_mixer_id(handle, str, index)) {
if ((hcontrol = test_mixer_id(handle, str, index)) != NULL) {
if ((err = get_mixer_info(handle, str, index, &cswitch_info)) < 0)
return err;
if (cswitch_info.type == SND_CONTROL_TYPE_BOOLEAN) {
@ -417,7 +417,7 @@ static int build_input(snd_mixer_t *handle, const char *sname)
}
}
sprintf(str, "%s Playback Volume", sname);
if (hcontrol = test_mixer_id(handle, str, index)) {
if ((hcontrol = test_mixer_id(handle, str, index)) != NULL) {
if ((err = get_mixer_info(handle, str, index, &pvolume_info)) < 0)
return err;
if (pvolume_info.type == SND_CONTROL_TYPE_INTEGER) {
@ -433,7 +433,7 @@ static int build_input(snd_mixer_t *handle, const char *sname)
}
}
sprintf(str, "%s Capture Volume", sname);
if (hcontrol = test_mixer_id(handle, str, index)) {
if ((hcontrol = test_mixer_id(handle, str, index)) != NULL) {
if ((err = get_mixer_info(handle, str, index, &cvolume_info)) < 0)
return err;
if (cvolume_info.type == SND_CONTROL_TYPE_INTEGER) {