From 39bb720ef8418d1c0db87b773f5467b16b395d96 Mon Sep 17 00:00:00 2001 From: reimar Date: Mon, 2 Mar 2009 11:17:50 +0000 Subject: Add a 64 bit integer type to the suboption parser. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28794 b3059339-0415-0410-9bf9-f77b7e298cf2 --- m_option.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'm_option.c') diff --git a/m_option.c b/m_option.c index 80dc4c0e9c..71ad21651c 100644 --- a/m_option.c +++ b/m_option.c @@ -162,13 +162,20 @@ static int parse_int(const m_option_t* opt,const char *name, char *param, void* return M_OPT_OUT_OF_RANGE; } - if(dst) VAL(dst) = tmp_int; + if(dst) { + if (opt->type->size == sizeof(int64_t)) + *(int64_t *)dst = tmp_int; + else + VAL(dst) = tmp_int; + } return 1; } static char* print_int(const m_option_t* opt, const void* val) { opt = NULL; + if (opt->type->size == sizeof(int64_t)) + return dup_printf("%"PRId64, *(const int64_t *)val); return dup_printf("%d",VAL(val)); } @@ -185,6 +192,19 @@ const m_option_type_t m_option_type_int = { NULL }; +const m_option_type_t m_option_type_int64 = { + "Integer64", + "", + sizeof(int64_t), + 0, + parse_int, + print_int, + copy_opt, + copy_opt, + NULL, + NULL +}; + // Float #undef VAL -- cgit v1.2.3