diff options
author | wm4 <wm4@nowhere> | 2016-08-30 23:47:09 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2016-08-30 23:47:09 +0200 |
commit | 5f88e6a0db292d272b3dc8f66c257c27327d1733 (patch) | |
tree | fe6f5d82a6656c97d4b49d61d73571812f03a498 | |
parent | 3bb134969eb624e859a546fd7142fe2eae076346 (diff) | |
download | mpv-5f88e6a0db292d272b3dc8f66c257c27327d1733.tar.bz2 mpv-5f88e6a0db292d272b3dc8f66c257c27327d1733.tar.xz |
m_config: rename is_generated to is_hidden
More appropriate. Originally it really was for automatically added
options, but now it even needed some stupid comments to indicate that
it was used for simply hiding options.
-rw-r--r-- | options/m_config.c | 12 | ||||
-rw-r--r-- | options/m_config.h | 2 |
2 files changed, 7 insertions, 7 deletions
diff --git a/options/m_config.c b/options/m_config.c index d2fe3fdcfa..c98ee6713f 100644 --- a/options/m_config.c +++ b/options/m_config.c @@ -334,7 +334,7 @@ static void add_negation_option(struct m_config *config, struct m_config_option co = *orig; co.name = talloc_asprintf(config, "no-%s", orig->name); co.opt = no_opt; - co.is_generated = true; + co.is_hidden = true; MP_TARRAY_APPEND(config, config->opts, config->num_opts, co); // Add --sub-no-opt (unfortunately needed for: "--sub=...:no-opt") if (parent_name[0]) { @@ -441,7 +441,7 @@ static void m_config_add_option(struct m_config *config, add_negation_option(config, &co, parent_name); if (co.opt->type == &m_option_type_alias) { - co.is_generated = true; // hide it + co.is_hidden = true; const char *alias = (const char *)co.opt->priv; char no_alias[40]; snprintf(no_alias, sizeof(no_alias), "no-%s", alias); @@ -456,7 +456,7 @@ static void m_config_add_option(struct m_config *config, } if (co.opt->type == &m_option_type_removed) - co.is_generated = true; // hide it + co.is_hidden = true; } struct m_config_option *m_config_get_co(const struct m_config *config, @@ -519,7 +519,7 @@ const char *m_config_get_positional_option(const struct m_config *config, int p) int pos = 0; for (int n = 0; n < config->num_opts; n++) { struct m_config_option *co = &config->opts[n]; - if (!co->is_generated) { + if (!co->is_hidden) { if (pos == p) return co->name; pos++; @@ -794,7 +794,7 @@ void m_config_print_option_list(const struct m_config *config) const struct m_option *opt = co->opt; if (opt->type->flags & M_OPT_TYPE_HAS_CHILD) continue; - if (co->is_generated) + if (co->is_hidden) continue; if (opt->type == &m_option_type_alias || opt->type == &m_option_type_removed) @@ -848,7 +848,7 @@ char **m_config_list_options(void *ta_parent, const struct m_config *config) const struct m_option *opt = co->opt; if (opt->type->flags & M_OPT_TYPE_HAS_CHILD) continue; - if (co->is_generated) + if (co->is_hidden) continue; // For use with CONF_TYPE_STRING_LIST, it's important not to set list // as allocation parent. diff --git a/options/m_config.h b/options/m_config.h index 5937a4492e..af8ab421f0 100644 --- a/options/m_config.h +++ b/options/m_config.h @@ -37,7 +37,7 @@ struct mp_log; // Config option struct m_config_option { - bool is_generated : 1; // Automatically added ("no-" options) + bool is_hidden : 1; // Does not show up in help bool is_set_from_cmdline : 1; // Set by user from command line bool is_set_locally : 1; // Has a backup entry bool warning_was_printed : 1; |