[MPlayer-dev-eng] [bikeshed] Coding style

Uoti Urpala uoti.urpala at pp1.inet.fi
Mon Jun 16 21:49:07 CEST 2008


On Mon, 2008-06-16 at 20:52 +0200, Reimar Döffinger wrote:
> On Mon, Jun 16, 2008 at 08:39:33PM +0200, Benjamin Zores wrote:
> > We might choose one well-known coding style because, obviously,
> > there is no chance that everyone agree on something to define an MPlayer 
> > one.
> 
> Well, in that case the far more logical choice would be to use FFmpeg
> style, at least as far as it is defined.

The FFmpeg documentation defines the FFmpeg coding style as follows:
"The presentation is the one specified by 'indent -i4 -kr -nut'."
The -i4 is redundant and -nut means using spaces instead of tabs
(doesn't affect the style). The actual style in FFmpeg files varies but
AFAIK there are no significant differences from -kr that would be
consistently present in almost all files.

> But I have the impression that some would want to just run indent over
> the source. I have a bit of a problem with that, since I very much doubt

I don't think it would be a good idea to run indent completely
automatically. There are a couple of common problem cases that should be
checked for. Also things like line splits can sometimes be improved
manually (I don't think it's worth spending much energy on that for
every file, but important ones could be improved).

> that anyone will review that, and from personal experience I can say
> that at least past indent versions _did_ break code in a way that it did
> not compile, so who can say not even worse things might happen?

I don't see this as an important factor. Even if something would break
it's unlikely to be particularly nasty. Doing reformatting manually
requires a significant amount of time and can accidentally cause bugs
too. It's not obvious whether the result would be at all better than
automatic reformatting, and IMO it's unlikely that any improvement would
be worth the work needed.




More information about the MPlayer-dev-eng mailing list