summaryrefslogtreecommitdiffstats
path: root/options
diff options
context:
space:
mode:
authorEmil Velikov <emil.l.velikov@gmail.com>2021-10-03 18:31:37 +0100
committerDudemanguy <random342@airmail.cc>2021-11-15 14:02:08 +0000
commit37619c4cf590f866bfb5fe517ef4daefb36c9193 (patch)
treec4e2643f7141e1c2f0ab09af64bc26cfd65b0adf /options
parentb66120a75d89a930a144cc8049954b8fbb55ad39 (diff)
downloadmpv-37619c4cf590f866bfb5fe517ef4daefb36c9193.tar.bz2
mpv-37619c4cf590f866bfb5fe517ef4daefb36c9193.tar.xz
options: remove always true m_obj_list::allow_unknown_entries
Ever instance of m_obj_list is a constant and for all of them, the field is true. Just remove the field all together. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Diffstat (limited to 'options')
-rw-r--r--options/m_option.c4
-rw-r--r--options/m_option.h3
2 files changed, 1 insertions, 6 deletions
diff --git a/options/m_option.c b/options/m_option.c
index f5a9ce5573..9c9101f2e7 100644
--- a/options/m_option.c
+++ b/options/m_option.c
@@ -3217,9 +3217,7 @@ static int parse_obj_settings(struct mp_log *log, struct bstr opt, int op,
} else {
char name[80];
snprintf(name, sizeof(name), "%.*s", BSTR_P(str));
- if (!list->allow_unknown_entries ||
- (list->check_unknown_entry && !list->check_unknown_entry(name)))
- {
+ if (list->check_unknown_entry && !list->check_unknown_entry(name)) {
mp_err(log, "Option %.*s: %.*s doesn't exist.\n",
BSTR_P(opt), BSTR_P(str));
return M_OPT_INVALID;
diff --git a/options/m_option.h b/options/m_option.h
index 322f120a06..435f11f912 100644
--- a/options/m_option.h
+++ b/options/m_option.h
@@ -145,9 +145,6 @@ struct m_obj_list {
const char *aliases[5][2];
// Allow a trailing ",", which adds an entry with name=""
bool allow_trailer;
- // Allow unknown entries, for which a dummy entry is inserted, and whose
- // options are skipped and ignored.
- bool allow_unknown_entries;
// Callback to test whether an unknown entry should be allowed. (This can
// be useful if adding them as explicit entries is too much work.)
bool (*check_unknown_entry)(const char *name);