mirror of
				https://github.com/alsa-project/alsa-lib.git
				synced 2025-11-03 09:01:52 -05:00 
			
		
		
		
	Warning removal.
This commit is contained in:
		
							parent
							
								
									1adb6dc796
								
							
						
					
					
						commit
						ec07b3ad20
					
				
					 3 changed files with 23 additions and 21 deletions
				
			
		| 
						 | 
					@ -134,7 +134,7 @@ static int snd_ctl_hsort_mixer_priority_lookup(char **name, char * const *names,
 | 
				
			||||||
		if (!strncmp(*name, *names, strlen(*names))) {
 | 
							if (!strncmp(*name, *names, strlen(*names))) {
 | 
				
			||||||
			*name += strlen(*names);
 | 
								*name += strlen(*names);
 | 
				
			||||||
			if (**name == ' ')
 | 
								if (**name == ' ')
 | 
				
			||||||
				*name++;
 | 
									(*name)++;
 | 
				
			||||||
			return res;
 | 
								return res;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					@ -189,7 +189,6 @@ static int snd_ctl_hsort_mixer_priority(const char *name)
 | 
				
			||||||
		"Bypass",
 | 
							"Bypass",
 | 
				
			||||||
		NULL
 | 
							NULL
 | 
				
			||||||
	};
 | 
						};
 | 
				
			||||||
	char **ptr, *s;
 | 
					 | 
				
			||||||
	int res, res1;
 | 
						int res, res1;
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
	if ((res = snd_ctl_hsort_mixer_priority_lookup((char **)&name, names, 1000000)) == NOT_FOUND)
 | 
						if ((res = snd_ctl_hsort_mixer_priority_lookup((char **)&name, names, 1000000)) == NOT_FOUND)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -43,19 +43,21 @@ int snd_mixer_open(snd_mixer_t **r_handle, int card)
 | 
				
			||||||
	*r_handle = NULL;
 | 
						*r_handle = NULL;
 | 
				
			||||||
	if ((err = snd_ctl_open(&ctl_handle, card)) < 0)
 | 
						if ((err = snd_ctl_open(&ctl_handle, card)) < 0)
 | 
				
			||||||
		return err;
 | 
							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));
 | 
						handle = (snd_mixer_t *) calloc(1, sizeof(snd_mixer_t));
 | 
				
			||||||
	if (handle == NULL) {
 | 
						if (handle == NULL) {
 | 
				
			||||||
		snd_ctl_close(ctl_handle);
 | 
							snd_ctl_close(ctl_handle);
 | 
				
			||||||
		return -ENOMEM;
 | 
							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;
 | 
						handle->ctl_handle = ctl_handle;
 | 
				
			||||||
	INIT_LIST_HEAD(&handle->simples);
 | 
						INIT_LIST_HEAD(&handle->simples);
 | 
				
			||||||
	*r_handle = handle;
 | 
						*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;
 | 
						struct list_head *lh;
 | 
				
			||||||
	mixer_simple_t *s;
 | 
						mixer_simple_t *s;
 | 
				
			||||||
	snd_mixer_sid_t *p;
 | 
						snd_mixer_sid_t *p;
 | 
				
			||||||
	int err, idx;
 | 
						int err;
 | 
				
			||||||
 | 
						unsigned int idx;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (handle == NULL || list == NULL)
 | 
						if (handle == NULL || list == NULL)
 | 
				
			||||||
		return -EINVAL;
 | 
							return -EINVAL;
 | 
				
			||||||
| 
						 | 
					@ -183,7 +186,7 @@ static void snd_mixer_simple_read_rebuild(snd_ctl_t *ctl_handle, void *private_d
 | 
				
			||||||
	handle->simple_changes++;
 | 
						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;
 | 
						snd_mixer_t *handle = (snd_mixer_t *)private_data;
 | 
				
			||||||
	mixer_simple_t *s;
 | 
						mixer_simple_t *s;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -86,12 +86,12 @@ static mixer_simple_t *simple_new(mixer_simple_t *scontrol)
 | 
				
			||||||
	return s;
 | 
						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 */
 | 
						/* 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;
 | 
						snd_mixer_t *handle = (snd_mixer_t *)hcontrol->private_data;
 | 
				
			||||||
	mixer_simple_t *s;
 | 
						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 */
 | 
						/* ignore at this moment */
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -365,7 +365,7 @@ static int build_input(snd_mixer_t *handle, const char *sname)
 | 
				
			||||||
		min = max = 0;
 | 
							min = max = 0;
 | 
				
			||||||
		bag = NULL;
 | 
							bag = NULL;
 | 
				
			||||||
		sprintf(str, "%s Switch", sname);
 | 
							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)
 | 
								if ((err = get_mixer_info(handle, str, index, &gswitch_info)) < 0)
 | 
				
			||||||
				return err;
 | 
									return err;
 | 
				
			||||||
			if (gswitch_info.type == SND_CONTROL_TYPE_BOOLEAN) {
 | 
								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);
 | 
							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)
 | 
								if ((err = get_mixer_info(handle, str, index, &gvolume_info)) < 0)
 | 
				
			||||||
				return err;
 | 
									return err;
 | 
				
			||||||
			if (gvolume_info.type == SND_CONTROL_TYPE_INTEGER) {
 | 
								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);
 | 
							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)
 | 
								if ((err = get_mixer_info(handle, str, index, &pswitch_info)) < 0)
 | 
				
			||||||
				return err;
 | 
									return err;
 | 
				
			||||||
			if (pswitch_info.type == SND_CONTROL_TYPE_BOOLEAN) {
 | 
								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);
 | 
							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)
 | 
								if ((err = get_mixer_info(handle, str, index, &cswitch_info)) < 0)
 | 
				
			||||||
				return err;
 | 
									return err;
 | 
				
			||||||
			if (cswitch_info.type == SND_CONTROL_TYPE_BOOLEAN) {
 | 
								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);
 | 
							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)
 | 
								if ((err = get_mixer_info(handle, str, index, &pvolume_info)) < 0)
 | 
				
			||||||
				return err;
 | 
									return err;
 | 
				
			||||||
			if (pvolume_info.type == SND_CONTROL_TYPE_INTEGER) {
 | 
								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);
 | 
							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)
 | 
								if ((err = get_mixer_info(handle, str, index, &cvolume_info)) < 0)
 | 
				
			||||||
				return err;
 | 
									return err;
 | 
				
			||||||
			if (cvolume_info.type == SND_CONTROL_TYPE_INTEGER) {
 | 
								if (cvolume_info.type == SND_CONTROL_TYPE_INTEGER) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue