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

Ivo ivop at euronet.nl
Mon Aug 21 11:26:51 CEST 2006


On Monday 21 August 2006 02:50, 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.

This is pretty difficult to achieve. If you don't specify a line-length, 
indent works with a default which is actually less than 79. (I chose 79 
because 80 can be problematic on some terminals, at least it used to be 10 
years ago).

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

Yes, I noticed that. Both look terrible. I plan on enclosing them with 
INDENT-OFF/ON comments before running reindent and removing those comments 
afterwards before committing.

> 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 :)

It was one of the last options I added (-ppi4). I thought it looked good, 
and some other, hand indented files use it too. But if this is thought to 
be problematic for certain compilers, I have no problems with switching it 
off.

> 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!

I see. I like the case being indented the same as switch(), but I agree that 
if there are braces around the case-codeblock, they look better indented. 
I'll have a look at that. I believe that can be fixed.

BTW I have no intention on running this script on vo_xvmc, since that's 
maintained by you. You can do it yourself though if you like ;-)

> More notes when I get some sleep ;)

OK. Keep in mind though that it always has to be a compromise. Some people 
like tabs, others like spaces, et cetera.

--Ivo



More information about the MPlayer-dev-eng mailing list