From 1cb085a82e89ce4c9150871c910c75d9404d1e01 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 29 Nov 2019 00:16:52 +0100 Subject: options: get rid of GLOBAL_CONFIG hack Just an implementation detail that can be cleaned up now. Internally, m_config maintains a tree of m_sub_options structs, except for the root it was not defined explicitly. GLOBAL_CONFIG was a hack to get access to it anyway. Define it explicitly instead. --- options/options.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'options/options.c') diff --git a/options/options.c b/options/options.c index 6437dc81c5..ee226843c2 100644 --- a/options/options.c +++ b/options/options.c @@ -318,7 +318,7 @@ const struct m_sub_options filter_conf = { #undef OPT_BASE_STRUCT #define OPT_BASE_STRUCT struct MPOpts -const m_option_t mp_opts[] = { +static const m_option_t mp_opts[] = { // handled in command line pre-parser (parse_commandline.c) {"v", &m_option_type_dummy_flag, CONF_NOCFG | M_OPT_NOPROP, .offset = -1}, @@ -896,7 +896,7 @@ const m_option_t mp_opts[] = { {0} }; -const struct MPOpts mp_default_opts = { +static const struct MPOpts mp_default_opts = { .use_terminal = 1, .msg_color = 1, .audio_decoders = NULL, @@ -991,4 +991,10 @@ const struct MPOpts mp_default_opts = { .cuda_device = -1, }; +const struct m_sub_options mp_opt_root = { + .opts = mp_opts, + .size = sizeof(struct MPOpts), + .defaults = &mp_default_opts, +}; + #endif /* MPLAYER_CFG_MPLAYER_H */ -- cgit v1.2.3