summaryrefslogtreecommitdiffstats
path: root/options/m_option.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-06-13 02:16:47 +0200
committerwm4 <wm4@nowhere>2014-06-13 02:16:47 +0200
commita64e099efcc835e93ea9dafff9bb01829d632fa6 (patch)
tree810f252124f10ace8b5f929f347580822ca407b5 /options/m_option.h
parente00aad18cb76d39cc520526cece1505c63a8afe0 (diff)
downloadmpv-a64e099efcc835e93ea9dafff9bb01829d632fa6.tar.bz2
mpv-a64e099efcc835e93ea9dafff9bb01829d632fa6.tar.xz
options: remove some unneeded stuff
No options pointing to global variables are in use anymore, so that part can be removed.
Diffstat (limited to 'options/m_option.h')
-rw-r--r--options/m_option.h16
1 files changed, 6 insertions, 10 deletions
diff --git a/options/m_option.h b/options/m_option.h
index fc210b3a43..3f1de72fd7 100644
--- a/options/m_option.h
+++ b/options/m_option.h
@@ -307,15 +307,14 @@ struct m_option {
// Option name.
const char *name;
- // Deprecated field for "old" options which mutate global state.
- void *p;
-
// Option type.
const m_option_type_t *type;
// See \ref OptionFlags.
unsigned int flags;
+ int offset;
+
// \brief Mostly useful for numeric types, the \ref M_OPT_MIN flags must
// also be set.
double min;
@@ -327,10 +326,6 @@ struct m_option {
// Type dependent data (for all kinds of extended settings).
void *priv;
- int is_new_option;
-
- int offset;
-
// Initialize variable to given default before parsing options
const void *defval;
};
@@ -538,12 +533,12 @@ extern const char m_option_path_separator;
#define OPTDEF_DOUBLE(d) .defval = (void *)&(const double){d}
#define OPT_GENERAL(ctype, optname, varname, flagv, ...) \
- {.name = optname, .flags = flagv, .is_new_option = 1, \
+ {.name = optname, .flags = flagv, \
.offset = MP_CHECKED_OFFSETOF(OPT_BASE_STRUCT, varname, ctype), \
__VA_ARGS__}
#define OPT_GENERAL_NOTYPE(optname, varname, flagv, ...) \
- {.name = optname, .flags = flagv, .is_new_option = 1, \
+ {.name = optname, .flags = flagv, \
.offset = offsetof(OPT_BASE_STRUCT, varname), \
__VA_ARGS__}
@@ -669,7 +664,8 @@ extern const char m_option_path_separator;
{.name = optname, \
.flags = M_OPT_FIXED | M_OPT_GLOBAL | M_OPT_NOCFG | M_OPT_PRE_PARSE, \
.type = &m_option_type_print_fn, \
- .priv = MP_EXPECT_TYPE(m_opt_print_fn, fn)}
+ .priv = MP_EXPECT_TYPE(m_opt_print_fn, fn), \
+ .offset = -1}
// subconf must have the type struct m_sub_options.
// All sub-options are prefixed with "name-" and are added to the current