From 7539928c1c8a12f030da4de4b8be0f697a122212 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 31 Aug 2016 18:17:42 +0200 Subject: m_config: remove some aliasing checks We strictly assume no aliasing (the previous commit removed the last case), so remove the checks. --- options/m_config.c | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/options/m_config.c b/options/m_config.c index b5cef17fd8..1c2541a2c6 100644 --- a/options/m_config.c +++ b/options/m_config.c @@ -382,16 +382,8 @@ static void m_config_add_option(struct m_config *config, add_options(config, &co, new_optstruct, new_optstruct_def, subopts->opts); } else { // Initialize options - if (co.data && co.default_data) { - if (arg->type->free) { - // Would leak memory by overwriting *co.data repeatedly. - for (int i = 0; i < config->num_opts; i++) { - if (co.data == config->opts[i].data) - assert(0); - } - } + if (co.data && co.default_data) init_opt_inplace(arg, co.data, co.default_data); - } } if (arg->name[0]) // no own name -> hidden @@ -510,17 +502,8 @@ static int handle_set_opt_flags(struct m_config *config, static void handle_on_set(struct m_config *config, struct m_config_option *co, int flags) { - if (flags & M_SETOPT_FROM_CMDLINE) { + if (flags & M_SETOPT_FROM_CMDLINE) co->is_set_from_cmdline = true; - // Mark aliases too - if (co->data) { - for (int n = 0; n < config->num_opts; n++) { - struct m_config_option *co2 = &config->opts[n]; - if (co2->data == co->data) - co2->is_set_from_cmdline = true; - } - } - } if (config->global && (co->opt->flags & M_OPT_TERM)) mp_msg_update_msglevels(config->global); -- cgit v1.2.3