summaryrefslogtreecommitdiffstats
path: root/m_struct.c
diff options
context:
space:
mode:
authorUoti Urpala <uau@mplayer2.org>2012-05-08 02:10:39 +0300
committerUoti Urpala <uau@mplayer2.org>2012-05-08 20:19:32 +0300
commit1e90a8657d19918dc7564f559b96dc3982286ba2 (patch)
tree1992e988e0328eb141b06cbb3ad180bbcf0f274d /m_struct.c
parent9fbfac25daaf6bdaab4c1213a294b59bded29b24 (diff)
downloadmpv-1e90a8657d19918dc7564f559b96dc3982286ba2.tar.bz2
mpv-1e90a8657d19918dc7564f559b96dc3982286ba2.tar.xz
options: simplify option parsing/setting machinery
Each option type had three separate operations to copy option values between memory locations: copy between general memory locations ("copy"), copy from general memory to active configuration of the program ("set"), and in the other direction ("save"). No normal option depends on this distinction any more. Change everything to define and use a single "copy" operation only. Change the special options "include" and "profile", which depended on hacky option types, to be special-cased directly in option parsing instead. Remove the now unused option types m_option_type_func and m_option_type_func_param.
Diffstat (limited to 'm_struct.c')
-rw-r--r--m_struct.c7
1 files changed, 0 insertions, 7 deletions
diff --git a/m_struct.c b/m_struct.c
index 764f616a89..8b34cea359 100644
--- a/m_struct.c
+++ b/m_struct.c
@@ -48,13 +48,6 @@ m_struct_alloc(const m_struct_t* st) {
mp_msg(MSGT_CFGPARSER, MSGL_ERR,"Struct %s needs defaults\n",st->name);
return NULL;
}
- // Check the struct fields
- for(i = 0 ; st->fields[i].name ; i++) {
- if(st->fields[i].type->flags & M_OPT_TYPE_INDIRECT) {
- mp_msg(MSGT_CFGPARSER, MSGL_ERR,"Struct %s->%s: Option types with the indirect flag are forbidden.\n",st->name,st->fields[i].name);
- return NULL;
- }
- }
r = calloc(1,st->size);
memcpy(r,st->defaults,st->size);