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.
This commit is contained in:
Dudemanguy 2023-09-19 18:32:47 -05:00
parent db12a2f224
commit cc1a43f014
2 changed files with 0 additions and 39 deletions

View File

@ -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)
{

View File

@ -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.