[FFmpeg-devel] [PATCH] Implement the function cmdutils.c:parse_int_or_die
Sun Feb 17 20:50:19 CET 2008
On date Sunday 2008-02-17 13:40:47 -0500, D. Hugh Redelmeier encoded:
> | From: Michael Niedermayer <michaelni at gmx.at>
> | Id prefer
> | double parse_number_or_die(const char* numstr, int type, double min, double max, const char* error);
> | d= parse_number_or_die("12234", OPT_INT, 1, 100, "blah blah");
> I really really distrust using floating point when integers are
> expected. (To be honest, I distrust using floating point for anything
> where an exact result is expected.)
> Do we really want to allow "3.9" when the context calls for an integer?
> Theoretically, a C implementation could have some ints that are not
> representable as doubles. I don't think that such an implementation
> exists, but it still makes me uncomforable.
Attached patch proposes a solution which implements MN suggestion, for
what regards the double to int conversion we could simply split the
function int three different ones, like:
Linux user number 337176 (see http://counter.li.org)
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 4546 bytes
Desc: not available
More information about the ffmpeg-devel