From 1e90a8657d19918dc7564f559b96dc3982286ba2 Mon Sep 17 00:00:00 2001 From: Uoti Urpala Date: Tue, 8 May 2012 02:10:39 +0300 Subject: 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. --- m_struct.c | 7 ------- 1 file changed, 7 deletions(-) (limited to 'm_struct.c') 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); -- cgit v1.2.3