[MPlayer-dev-eng] octal and hex surprise and perplex

Ivan Kalvachev ikalvachev at gmail.com
Fri Jun 9 20:56:11 CEST 2006


2006/6/9, Alan Curry <pacman at theworld.com>:
> Kalev Soikonen writes the following:
> >
> >On Fri, Jun 09, 2006 at 03:44:13AM -0400, Alan Curry wrote:
> >>   Playing dvd://08.
> >>   The hostname option must be an integer: 08
> >>   Don't start a number with zero unless you intend it to be octal
> >>   Struct dvd, field hostname parsing error: 08
> >
> >       mplayer dvd://08-11
> >
> >already does what a regular ten-fingered person expects.
> >
>
> Oh, how horribly inconsistent this is...
>
> >What about arguments like "015", which pass ok but interpret differently
> >to what one might expect?
>
> I just hope you'll try 08 or 09 before you work your way up to 015, otherwise
> you're gonna be confused.
>
> >
> >Maybe it would be wise to deprecate all octals in favor of explicit hex,
> >which is unambiguous? Maybe wrap strtol and have -hardcore-C-style-strtol
> >and/or -decimal-numbers-only-please kind of flags?
>
> I wouldn't mind losing octal. It's only good for chmod since 9-bit bytes went
> out of fashion. I suspect it survives mainly because strtol(...,0) is a
> convenient shortcut for accepting hex and decimal, and octal just gets sucked
> in as a side effect.
>
> >Ahem, methinks you can't shrug off this problem so easily.
>
> My little hint is easier and didn't anger anyone, so I'll go ahead and commit
> it (as a translatable string).

I don't like it.
It won't capture all octal numbers and as somebody else said already I
don't believe somebody will use octal these days.

I'm for fixing this number to decimal system. Actually I didn't expect
it could take something else than decimal.

As of your question, about other places that could take hex... I don't
really think there are many places where we need hex numbers...  the
only one that came into my mind atm are fourcc and raw-color params as
'format','colorkey',lavdopts debug,mencoder fafmttag, tag.

Don't hurry with the commit... this is how flame wars are started ;)



More information about the MPlayer-dev-eng mailing list