diff options
author | wm4 <wm4@nowhere> | 2012-09-18 11:48:50 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2012-10-12 10:10:30 +0200 |
commit | 3d67041089c7945dcea0162c0038e495d588b379 (patch) | |
tree | f808740db919bae523d45ae19196885ebf651c73 /m_option.c | |
parent | 10437c35df5d3944625fa6cee05e565b0791fe15 (diff) | |
download | mpv-3d67041089c7945dcea0162c0038e495d588b379.tar.bz2 mpv-3d67041089c7945dcea0162c0038e495d588b379.tar.xz |
options: remove CONF_TYPE_POSITION
This was the option parser for the off_t C type. These days, off_t is
always int64_t, so replace all its uses by int64_t and CONF_TYPE_INT64.
Fix the --sstep option. It used CONF_TYPE_INT with an off_t variable,
which will result in invalid memory accesses. Make it use type double
instead, which seems to make more sense for this option.
Diffstat (limited to 'm_option.c')
-rw-r--r-- | m_option.c | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/m_option.c b/m_option.c index 2f8daa42de..015b8f8e20 100644 --- a/m_option.c +++ b/m_option.c @@ -423,35 +423,6 @@ const m_option_type_t m_option_type_float = { .copy = copy_opt, }; -///////////// Position -#undef VAL -#define VAL(x) (*(off_t *)(x)) - -static int parse_position(const m_option_t *opt, struct bstr name, - struct bstr param, void *dst) -{ - long long tmp; - int r = parse_longlong(opt, name, param, &tmp); - if (r >= 0 && dst) - *(off_t *)dst = tmp; - return r; -} - -static char *print_position(const m_option_t *opt, const void *val) -{ - return talloc_asprintf(NULL, "%"PRId64, (int64_t)VAL(val)); -} - -const m_option_type_t m_option_type_position = { - // Integer (off_t) - .name = "Position", - .size = sizeof(off_t), - .parse = parse_position, - .print = print_position, - .copy = copy_opt, -}; - - ///////////// String #undef VAL |