[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: 100+ warnings and some cosmetics along the way (issue1724041)
From: |
Carl Sorensen |
Subject: |
Re: 100+ warnings and some cosmetics along the way (issue1724041) |
Date: |
Wed, 16 Jun 2010 18:50:59 -0600 |
On 6/16/10 3:49 PM, "address@hidden" <address@hidden> wrote:
> Reviewers: carl.d.sorensen_gmail.com,
>
> Message:
> I would have split it into chunks, but my main concern was warnings,
> which was present in most of the files. Most of the committed files only
> contain casts.
> Reviewing will take about 1-2 hours, I guess.
>
> I have checked in the code how casting works and I have used the int(),
> mostly , without the space (could have used int() or static_cast<int>(),
> but this was the most aesthetic to me). Must have found a wrong example.
> Should I correct it?
Stroustrup mentions that you can do cast as
(type-name) expression
or
simple-type-name ( expression-list )
I prefer to always use
(type-name) expression
because the same syntax applies to both simple types and other types.
I think that's what I have mostly seen in the lilypond codebase. But as far
as I know, this isn't a standard.
> I don't really like the extra space decision, this way "while ()", "if
> ()" and "clear ()" all look the same, while only the last one is a
> function, the rest are not. And it even occupies too much space, but if
> that's the standard, that's how I'll do it :).
It is the standard. And submitting a patch is not the time to change the
standard.
> (Eclipse has a pretty
> good code formatter, someone might want to run it (or maybe
> http://astyle.sourceforge.net/, haven't tried it, though) on the whole
> project to beautify the code automagically)
We've had discussions about various formatters. You can look for them on
-devel. And in fact, there is a lilypond code formatter.
(see http://lilypond.org/doc/v2.13/Documentation/contributor/indentation)
However, the diffs are so large that we are unwilling to run everything
through it.
See http://thread.gmane.org/gmane.comp.gnu.lilypond.devel/25397
The current recommendation for *indentation* is to use emacs, as shown in
the CG reference above.
Thanks,
Carl
- Re: 100+ warnings and some cosmetics along the way (issue1724041),
Carl Sorensen <=