config/Option: convert to strictly-typed enum
This commit is contained in:
@@ -120,7 +120,7 @@ main(int argc, char **argv)
|
||||
|
||||
/* do it */
|
||||
|
||||
const struct config_param *path = config_get_param(CONF_DB_FILE);
|
||||
const auto *path = config_get_param(ConfigOption::DB_FILE);
|
||||
config_param param("database", path != nullptr ? path->line : -1);
|
||||
if (path != nullptr)
|
||||
param.AddBlockParam("path", path->value.c_str(), path->line);
|
||||
|
@@ -46,7 +46,7 @@ int main(int argc, char **argv)
|
||||
}
|
||||
|
||||
ConfigOption option = ParseConfigOptionName(name);
|
||||
const char *value = option != CONF_MAX
|
||||
const char *value = option != ConfigOption::MAX
|
||||
? config_get_string(option, nullptr)
|
||||
: nullptr;
|
||||
int ret;
|
||||
|
@@ -51,7 +51,7 @@ static Filter *
|
||||
load_filter(const char *name)
|
||||
{
|
||||
const config_param *param =
|
||||
config_find_block(CONF_AUDIO_FILTER, "name", name);
|
||||
config_find_block(ConfigOption::AUDIO_FILTER, "name", name);
|
||||
if (param == NULL) {
|
||||
fprintf(stderr, "No such configured filter: %s\n", name);
|
||||
return nullptr;
|
||||
|
@@ -62,7 +62,7 @@ static AudioOutput *
|
||||
load_audio_output(EventLoop &event_loop, const char *name)
|
||||
{
|
||||
const config_param *param =
|
||||
config_find_block(CONF_AUDIO_OUTPUT, "name", name);
|
||||
config_find_block(ConfigOption::AUDIO_OUTPUT, "name", name);
|
||||
if (param == NULL) {
|
||||
fprintf(stderr, "No such configured audio output: %s\n", name);
|
||||
return nullptr;
|
||||
|
Reference in New Issue
Block a user