From b7bedbbc367b0e248880d25139056a690ac996a2 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 13 Jun 2014 02:17:31 +0200 Subject: options: remove some more stuff The "classic" sub-option stuff is not really needed anymore. The only remaining use can be emulated in a simpler way. But note that this breaks the --screenshot option (instead of the "flat" options like --screenshot-...). This was undocumented and discouraged, so it shouldn't affect anyone. --- options/m_config.c | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) (limited to 'options/m_config.c') diff --git a/options/m_config.c b/options/m_config.c index 585f1f5d81..d1f6faca0d 100644 --- a/options/m_config.c +++ b/options/m_config.c @@ -391,25 +391,20 @@ static void m_config_add_option(struct m_config *config, // Option with children -> add them if (arg->type->flags & M_OPT_TYPE_HAS_CHILD) { - if (arg->type->flags & M_OPT_TYPE_USE_SUBSTRUCT) { - const struct m_sub_options *subopts = arg->priv; + const struct m_sub_options *subopts = arg->priv; - void *new_optstruct = NULL; - if (co.data) { - new_optstruct = m_config_alloc_struct(config, subopts); - substruct_write_ptr(co.data, new_optstruct); - } + void *new_optstruct = NULL; + if (co.data) { + new_optstruct = m_config_alloc_struct(config, subopts); + substruct_write_ptr(co.data, new_optstruct); + } - const void *new_optstruct_def = substruct_read_ptr(co.default_data); - if (!new_optstruct_def) - new_optstruct_def = subopts->defaults; + const void *new_optstruct_def = substruct_read_ptr(co.default_data); + if (!new_optstruct_def) + new_optstruct_def = subopts->defaults; - add_options(config, co.name, new_optstruct, - new_optstruct_def, subopts->opts); - } else { - const struct m_option *sub = arg->priv; - add_options(config, co.name, optstruct, optstruct_def, sub); - } + add_options(config, co.name, new_optstruct, + new_optstruct_def, subopts->opts); } else { // Initialize options if (co.data && co.default_data) { -- cgit v1.2.3