summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUoti Urpala <uau@symbol.nonexistent.invalid>2008-04-26 08:53:26 +0300
committerUoti Urpala <uau@symbol.nonexistent.invalid>2008-04-26 09:40:35 +0300
commit6be229cbbfbe29ad61025051b1d903f5619e0b8a (patch)
treef501adc6759acbff9d3f8b31b174dfb1f13eddf5
parent98b959ae1fadd70b7a8ac8259759b11d6ed4fb2d (diff)
downloadmpv-6be229cbbfbe29ad61025051b1d903f5619e0b8a.tar.bz2
mpv-6be229cbbfbe29ad61025051b1d903f5619e0b8a.tar.xz
options: Fix multiple -v by simplifying CONF_TYPE_FUNC
The CONF_TYPE_FUNC implementation counted how many times the option had appeared and called the function that many times when it was set. However each -v on the command line triggered an increase of the count _and_ as many calls as the current count indicated. Thus the resulting verbosity levels for 0 to 5 -v were really 0, 1, 3, 6, 10, 15 instead of 0, 1, 2, 3, 4, 5. Remove the counting functionality and just call the given function once at each set operation. This fixes -v; other options are not affected.
-rw-r--r--m_option.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/m_option.c b/m_option.c
index f9a3758534..0b7f69eff2 100644
--- a/m_option.c
+++ b/m_option.c
@@ -809,17 +809,12 @@ const m_option_type_t m_option_type_func_full = {
/////////////// Func
#undef VAL
-#define VAL(x) (*(int*)(x))
static int parse_func(const m_option_t* opt,const char *name, char *param, void* dst, int src) {
- if(dst)
- VAL(dst) += 1;
return 0;
}
static void set_func(const m_option_t* opt,void* dst, void* src) {
- int i;
- for(i = 0 ; i < VAL(src) ; i++)
((m_opt_func_t) opt->p)(opt);
}