Use snd_config_get_bool()

Cleanup using snd_config_get_bool() in possible places.
This commit is contained in:
Takashi Iwai 2005-01-21 19:37:00 +00:00
parent 1fb6e88716
commit 680a60a688
3 changed files with 7 additions and 52 deletions

View file

@ -1153,15 +1153,7 @@ int _snd_pcm_dmix_open(snd_pcm_t **pcmp, const char *name,
continue;
}
if (strcmp(id, "ipc_key_add_uid") == 0) {
char *tmp;
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 = snd_config_get_bool(n)) < 0) {
SNDERR("The field ipc_key_add_uid must be a boolean type");
return err;
}
@ -1177,18 +1169,9 @@ int _snd_pcm_dmix_open(snd_pcm_t **pcmp, const char *name,
continue;
}
if (strcmp(id, "slowptr") == 0) {
char *tmp;
err = snd_config_get_ascii(n, &tmp);
if (err < 0) {
SNDERR("The field slowptr must be a boolean type");
err = snd_config_get_bool(n);
if (err < 0)
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;
continue;
}

View file

@ -821,14 +821,7 @@ int _snd_pcm_dshare_open(snd_pcm_t **pcmp, const char *name,
continue;
}
if (strcmp(id, "ipc_key_add_uid") == 0) {
char *tmp;
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);
err = snd_config_get_bool(n);
if (err < 0) {
SNDERR("The field ipc_key_add_uid must be a boolean type");
return err;
@ -845,14 +838,7 @@ int _snd_pcm_dshare_open(snd_pcm_t **pcmp, const char *name,
continue;
}
if (strcmp(id, "slowptr") == 0) {
char *tmp;
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);
err = snd_config_get_bool(n);
if (err < 0) {
SNDERR("The field slowptr must be a boolean type");
return err;

View file

@ -771,14 +771,7 @@ int _snd_pcm_dsnoop_open(snd_pcm_t **pcmp, const char *name,
continue;
}
if (strcmp(id, "ipc_key_add_uid") == 0) {
char *tmp;
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);
err = snd_config_get_bool(n);
if (err < 0) {
SNDERR("The field ipc_key_add_uid must be a boolean type");
return err;
@ -795,14 +788,7 @@ int _snd_pcm_dsnoop_open(snd_pcm_t **pcmp, const char *name,
continue;
}
if (strcmp(id, "slowptr") == 0) {
char *tmp;
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);
err = snd_config_get_bool(n);
if (err < 0) {
SNDERR("The field slowptr must be a boolean type");
return err;