mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-31 22:25:35 -04:00
Use snd_config_get_bool()
Cleanup using snd_config_get_bool() in possible places.
This commit is contained in:
parent
1fb6e88716
commit
680a60a688
3 changed files with 7 additions and 52 deletions
|
|
@ -1153,15 +1153,7 @@ int _snd_pcm_dmix_open(snd_pcm_t **pcmp, const char *name,
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (strcmp(id, "ipc_key_add_uid") == 0) {
|
if (strcmp(id, "ipc_key_add_uid") == 0) {
|
||||||
char *tmp;
|
if ((err = snd_config_get_bool(n)) < 0) {
|
||||||
err = snd_config_get_ascii(n, &tmp);
|
|
||||||
if (err < 0) {
|
|
||||||
SNDERR("The field ipc_key_add_uid must be a boolean type");
|
|
||||||
return err;
|
|
||||||
}
|
|
||||||
err = snd_config_get_bool_ascii(tmp);
|
|
||||||
free(tmp);
|
|
||||||
if (err < 0) {
|
|
||||||
SNDERR("The field ipc_key_add_uid must be a boolean type");
|
SNDERR("The field ipc_key_add_uid must be a boolean type");
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
@ -1177,18 +1169,9 @@ int _snd_pcm_dmix_open(snd_pcm_t **pcmp, const char *name,
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (strcmp(id, "slowptr") == 0) {
|
if (strcmp(id, "slowptr") == 0) {
|
||||||
char *tmp;
|
err = snd_config_get_bool(n);
|
||||||
err = snd_config_get_ascii(n, &tmp);
|
if (err < 0)
|
||||||
if (err < 0) {
|
|
||||||
SNDERR("The field slowptr must be a boolean type");
|
|
||||||
return err;
|
return err;
|
||||||
}
|
|
||||||
err = snd_config_get_bool_ascii(tmp);
|
|
||||||
free(tmp);
|
|
||||||
if (err < 0) {
|
|
||||||
SNDERR("The field slowptr must be a boolean type");
|
|
||||||
return err;
|
|
||||||
}
|
|
||||||
slowptr = err;
|
slowptr = err;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -821,14 +821,7 @@ int _snd_pcm_dshare_open(snd_pcm_t **pcmp, const char *name,
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (strcmp(id, "ipc_key_add_uid") == 0) {
|
if (strcmp(id, "ipc_key_add_uid") == 0) {
|
||||||
char *tmp;
|
err = snd_config_get_bool(n);
|
||||||
err = snd_config_get_ascii(n, &tmp);
|
|
||||||
if (err < 0) {
|
|
||||||
SNDERR("The field ipc_key_add_uid must be a boolean type");
|
|
||||||
return err;
|
|
||||||
}
|
|
||||||
err = snd_config_get_bool_ascii(tmp);
|
|
||||||
free(tmp);
|
|
||||||
if (err < 0) {
|
if (err < 0) {
|
||||||
SNDERR("The field ipc_key_add_uid must be a boolean type");
|
SNDERR("The field ipc_key_add_uid must be a boolean type");
|
||||||
return err;
|
return err;
|
||||||
|
|
@ -845,14 +838,7 @@ int _snd_pcm_dshare_open(snd_pcm_t **pcmp, const char *name,
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (strcmp(id, "slowptr") == 0) {
|
if (strcmp(id, "slowptr") == 0) {
|
||||||
char *tmp;
|
err = snd_config_get_bool(n);
|
||||||
err = snd_config_get_ascii(n, &tmp);
|
|
||||||
if (err < 0) {
|
|
||||||
SNDERR("The field slowptr must be a boolean type");
|
|
||||||
return err;
|
|
||||||
}
|
|
||||||
err = snd_config_get_bool_ascii(tmp);
|
|
||||||
free(tmp);
|
|
||||||
if (err < 0) {
|
if (err < 0) {
|
||||||
SNDERR("The field slowptr must be a boolean type");
|
SNDERR("The field slowptr must be a boolean type");
|
||||||
return err;
|
return err;
|
||||||
|
|
|
||||||
|
|
@ -771,14 +771,7 @@ int _snd_pcm_dsnoop_open(snd_pcm_t **pcmp, const char *name,
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (strcmp(id, "ipc_key_add_uid") == 0) {
|
if (strcmp(id, "ipc_key_add_uid") == 0) {
|
||||||
char *tmp;
|
err = snd_config_get_bool(n);
|
||||||
err = snd_config_get_ascii(n, &tmp);
|
|
||||||
if (err < 0) {
|
|
||||||
SNDERR("The field ipc_key_add_uid must be a boolean type");
|
|
||||||
return err;
|
|
||||||
}
|
|
||||||
err = snd_config_get_bool_ascii(tmp);
|
|
||||||
free(tmp);
|
|
||||||
if (err < 0) {
|
if (err < 0) {
|
||||||
SNDERR("The field ipc_key_add_uid must be a boolean type");
|
SNDERR("The field ipc_key_add_uid must be a boolean type");
|
||||||
return err;
|
return err;
|
||||||
|
|
@ -795,14 +788,7 @@ int _snd_pcm_dsnoop_open(snd_pcm_t **pcmp, const char *name,
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (strcmp(id, "slowptr") == 0) {
|
if (strcmp(id, "slowptr") == 0) {
|
||||||
char *tmp;
|
err = snd_config_get_bool(n);
|
||||||
err = snd_config_get_ascii(n, &tmp);
|
|
||||||
if (err < 0) {
|
|
||||||
SNDERR("The field slowptr must be a boolean type");
|
|
||||||
return err;
|
|
||||||
}
|
|
||||||
err = snd_config_get_bool_ascii(tmp);
|
|
||||||
free(tmp);
|
|
||||||
if (err < 0) {
|
if (err < 0) {
|
||||||
SNDERR("The field slowptr must be a boolean type");
|
SNDERR("The field slowptr must be a boolean type");
|
||||||
return err;
|
return err;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue