Mercurial > mplayer.hg
diff m_option.c @ 16750:0a31740dd5e6
Use PRI?64 defines as format strings for 64 bit variables.
author | reimar |
---|---|
date | Thu, 13 Oct 2005 18:33:56 +0000 |
parents | ec4a53c1c40b |
children | 3898e1089a29 |
line wrap: on
line diff
--- a/m_option.c Thu Oct 13 13:24:35 2005 +0000 +++ b/m_option.c Thu Oct 13 18:33:56 2005 +0000 @@ -289,7 +289,7 @@ if (param == NULL) return M_OPT_MISSING_PARAM; if (sscanf(param, sizeof(off_t) == sizeof(int) ? - "%d%c" : "%lld%c", &tmp_off, &dummy) != 1) { + "%d%c" : "%"PRId64"%c", &tmp_off, &dummy) != 1) { mp_msg(MSGT_CFGPARSER, MSGL_ERR, "The %s option must be an integer: %s\n",opt->name,param); return M_OPT_INVALID; } @@ -297,20 +297,16 @@ if (opt->flags & M_OPT_MIN) if (tmp_off < opt->min) { mp_msg(MSGT_CFGPARSER, MSGL_ERR, - (sizeof(off_t) == sizeof(int) ? - "The %s option must be >= %d: %s\n" : - "The %s option must be >= %lld: %s\n"), - name, (off_t) opt->min, param); + "The %s option must be >= %"PRId64": %s\n", + name, (int64_t) opt->min, param); return M_OPT_OUT_OF_RANGE; } if (opt->flags & M_OPT_MAX) if (tmp_off > opt->max) { mp_msg(MSGT_CFGPARSER, MSGL_ERR, - (sizeof(off_t) == sizeof(int) ? - "The %s option must be <= %d: %s\n" : - "The %s option must be <= %lld: %s\n"), - name, (off_t) opt->max, param); + "The %s option must be <= %"PRId64": %s\n", + name, (int64_t) opt->max, param); return M_OPT_OUT_OF_RANGE; } @@ -320,7 +316,7 @@ } static char* print_position(m_option_t* opt, void* val) { - return dup_printf(sizeof(off_t) == sizeof(int) ? "%d" : "%lld",VAL(val)); + return dup_printf("%"PRId64,(int64_t)VAL(val)); } m_option_type_t m_option_type_position = {