[MPlayer-dev-eng] [RFC] Reindentation of mplayer.c

Uoti Urpala uoti.urpala at pp1.inet.fi
Mon Aug 21 03:37:20 CEST 2006


On Mon, 2006-08-21 at 03:50 +0300, Ivan Kalvachev wrote:
> I'd prefer if we don't automatically split lines. In some cases it
> could lead to disasters,
> in other cases the indented file would only end up looking worse than
> mplayer.c .
> And for sure it would break applying patches (that otherwise could be
> commit ed by patch -l )
> 
> Where splitting line is needed it is better to be done by hand.

I think there are too many cases where lines do need to be split (or
joined) to do them all by hand.

> Other random notes about current reindent:
> 
> 1. mp_properties looks bad , but set_prop_cmd is awful (mplayer.c).

Do you mean just the already-mentioned comment issue or something else?

> 2. in main():2772 the preprocessed directives are been indented too.
> Even if It may be valid C99 I'm sure some compilers would have problem
> with that. (but it indeed helps with multiple nested #ifdefs :)

C99 and even C89 allow white space on either side of '#'. I've heard
people recommend starting the lines with a # and putting possible
indentation after it (as the indentation options in the script seem to
do), but I don't know whether any current compiler requires that.

> 3. switch and case are on the same indent level (at least on my
> vo_xvmc) and they end with
> switch (){
> case{
> }
> }
> Not pretty at all!

Indenting switch and case labels at the same level is the most common
way I've seen, and which is already used in other MPlayer files. Having
a { on the same line as the case label and not increasing indentation in
that case does indeed look a bit weird.




More information about the MPlayer-dev-eng mailing list