lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Corrected comments and a function check_meshing_chords divided in two. (


From: k-ohara5a5a
Subject: Corrected comments and a function check_meshing_chords divided in two. (issue 5975054)
Date: Sat, 31 Mar 2012 21:04:35 +0000

LGTM, except that it confuses the two programs we have used recently for
automatic code indentation.


http://codereview.appspot.com/5975054/diff/1/flower/include/direction.hh
File flower/include/direction.hh (right):

http://codereview.appspot.com/5975054/diff/1/flower/include/direction.hh#newcode90
flower/include/direction.hh:90: for (Direction d = UP; d != CENTER;
flip(&d), d == UP ? d = CENTER : d)
It is still difficult to understand.
Consider
for (Direction d = UP; d != CENTER; d = (UP == d)? DOWN, CENTER)

http://codereview.appspot.com/5975054/diff/1/lily/note-collision.cc
File lily/note-collision.cc (right):

http://codereview.appspot.com/5975054/diff/1/lily/note-collision.cc#newcode45
lily/note-collision.cc:45: /* Filter out the 'o's in this configuration,
since they're no
Keith, I'm trying to understand the whole function and
divide it into parts.
Does this comment refer only to the two lines below?

It explains the two assignment lines below.  We use the results of those
assignments, the filtered arrays of note-heads, for the rest of the
function.
Therefore you don't need to pass 'ups' and 'dps' as arguments in to this
function.
See http://code.google.com/p/lilypond/issues/detail?id=984

http://codereview.appspot.com/5975054/diff/1/lily/note-collision.cc#newcode404
lily/note-collision.cc:404: for_UP_and_DOWN (d)
The code-indenting program we use
  http://astyle.sourceforge.net/
is not smart enough to determine that this macro starts a control block,
so it indents the code as if for_UP_and_DOWN was a function call or
function definition.
The indenter in emacs does the same.

If you write the 'for' loop directly in the code, then neither humans
nor auto-indent programs need to learn a macro:
for (Direction d = UP; d; d = (UP == d)? DOWN : CENTER)

http://codereview.appspot.com/5975054/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]