From cc1a43f014905777ab77c8fc5744c86d2d05de4e Mon Sep 17 00:00:00 2001 From: Dudemanguy Date: Tue, 19 Sep 2023 18:32:47 -0500 Subject: m_config_core: remove mp_read_option_raw With the previous series of commits, all usage of this bad function has been eliminated in mpv so we can just nuke it for good. --- options/m_config_core.c | 32 -------------------------------- options/m_config_core.h | 7 ------- 2 files changed, 39 deletions(-) diff --git a/options/m_config_core.c b/options/m_config_core.c index 4f8c462db1..74a4aa00f7 100644 --- a/options/m_config_core.c +++ b/options/m_config_core.c @@ -850,38 +850,6 @@ void *mp_get_config_group(void *ta_parent, struct mpv_global *global, return cache->opts; } -void mp_read_option_raw(struct mpv_global *global, const char *name, - const struct m_option_type *type, void *dst) -{ - struct m_config_shadow *shadow = global->config; - - int32_t optid = -1; - while (m_config_shadow_get_next_opt(shadow, &optid)) { - char buf[M_CONFIG_MAX_OPT_NAME_LEN]; - const char *opt_name = - m_config_shadow_get_opt_name(shadow, optid, buf, sizeof(buf)); - - if (strcmp(name, opt_name) == 0) { - const struct m_option *opt = m_config_shadow_get_opt(shadow, optid); - - int group_index, opt_index; - get_opt_from_id(shadow, optid, &group_index, &opt_index); - - struct m_group_data *gdata = m_config_gdata(shadow->data, group_index); - assert(gdata); - - assert(opt->offset >= 0); - assert(opt->type == type); - - memset(dst, 0, opt->type->size); - m_option_copy(opt, dst, gdata->udata + opt->offset); - return; - } - } - - MP_ASSERT_UNREACHABLE(); // not found -} - static const struct m_config_group *find_group(struct mpv_global *global, const struct m_option *cfg) { diff --git a/options/m_config_core.h b/options/m_config_core.h index c4902be9d1..a9558423d8 100644 --- a/options/m_config_core.h +++ b/options/m_config_core.h @@ -131,13 +131,6 @@ bool m_config_cache_write_opt(struct m_config_cache *cache, void *ptr); void *mp_get_config_group(void *ta_parent, struct mpv_global *global, const struct m_sub_options *group); -// Read a single global option in a thread-safe way. For multiple options, -// use m_config_cache. The option must exist and match the provided type (the -// type is used as a sanity check only). Performs semi-expensive lookup. -// Warning: new code must not use this. -void mp_read_option_raw(struct mpv_global *global, const char *name, - const struct m_option_type *type, void *dst); - // Allocate a priv struct that is backed by global options (like AOs and VOs, // anything that uses m_obj_list.use_global_options == true). // The result contains a snapshot of the current option values of desc->options. -- cgit v1.2.3