[MPlayer-dev-eng] [RFC] Reindentation of mplayer.c
Ivan Kalvachev
ikalvachev at gmail.com
Mon Aug 21 02:50:43 CEST 2006
2006/8/20, Ivo <ivop at euronet.nl>:
> On Sunday 20 August 2006 19:21, Uoti Urpala wrote:
> > On Sun, 2006-08-20 at 19:01 +0200, Ivo wrote:
> > > What do you think of running GNU indent on mplayer.c and maybe on other
> > > files that have become pretty unreadable over the years and are
> > > unmaintained?
> > >
> > > Of course the default of indent is horrible (GNU coding style), so I
> > > came up with a set of command line options, which I believe match the
> > > most commonly accepted style for MPlayer. See the attached script.
> > >
> > > Any comments? Or flames? :)
> >
> > I tested those options and noticed at least one thing I don't like:
> > comments on their own line always seem to have no indentation.
> >
> > func1();
> > // comment
> > func2();
> >
> > I prefer to have those indented with the code, and the default kr style
> > in indent behaves like that.
>
> Yes. I added that option (--line-comments-indentation80) because otherwise,
> with the new indentation, some of the comments get messed up because they
> exceed the line-length for multiple lines in a row. There are places where
> context aligned comments mean starting at the 40+th column where they used
> to be in somewhere like the 8th column. But I guess we could remove that
> option and fix some of the broken comments by hand. That's probably less
> work than realigning all other comments by hand :)
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.
Other random notes about current reindent:
1. mp_properties looks bad , but set_prop_cmd is awful (mplayer.c).
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 :)
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!
More notes when I get some sleep ;)
More information about the MPlayer-dev-eng
mailing list