summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2023-09-19 18:32:47 -0500
committerDudemanguy <random342@airmail.cc>2023-09-22 14:20:38 +0000
commitcc1a43f014905777ab77c8fc5744c86d2d05de4e (patch)
tree8859cc2021f8a11023350f607b728ead3cdb809b
parentdb12a2f224239f1b2c1f58dc1feed9a1f4c8e553 (diff)
downloadmpv-cc1a43f014905777ab77c8fc5744c86d2d05de4e.tar.bz2
mpv-cc1a43f014905777ab77c8fc5744c86d2d05de4e.tar.xz
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.
-rw-r--r--options/m_config_core.c32
-rw-r--r--options/m_config_core.h7
2 files changed, 0 insertions, 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.