diff options
author | Max Kellermann <max@duempel.org> | 2009-01-17 20:23:33 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-01-17 20:23:33 +0100 |
commit | a1a97cc048a443eb71944848592b9827991600fd (patch) | |
tree | e3bfbf5bd38a851d2823b99a00f4abba9ba1db43 /src/conf.c | |
parent | 4d472c265ed0b3f7f61ee624c01c8ef319db7c99 (diff) | |
download | mpd-a1a97cc048a443eb71944848592b9827991600fd.tar.gz mpd-a1a97cc048a443eb71944848592b9827991600fd.tar.xz mpd-a1a97cc048a443eb71944848592b9827991600fd.zip |
conf: use config_get_bool() instead of getBoolConfigParam()
Diffstat (limited to '')
-rw-r--r-- | src/conf.c | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/src/conf.c b/src/conf.c index be4db9018..d1decadcd 100644 --- a/src/conf.c +++ b/src/conf.c @@ -429,30 +429,24 @@ parseConfigFilePath(const char *name, int force) return param; } -int getBoolConfigParam(const char *name, int force) +bool config_get_bool(const char *name, bool default_value) { - int ret; struct config_param *param = config_get_param(name); + int value; - if (!param) - return CONF_BOOL_UNSET; + if (param == NULL) + return default_value; - ret = get_bool(param->value); - if (force && ret == CONF_BOOL_INVALID) + value = get_bool(param->value); + if (value == CONF_BOOL_INVALID) g_error("%s is not a boolean value (yes, true, 1) or " "(no, false, 0) on line %i\n", name, param->line); - return ret; -} - -bool config_get_bool(const char *name, bool default_value) -{ - int value = getBoolConfigParam(name, true); if (value == CONF_BOOL_UNSET) return default_value; - return value; + return !!value; } int |