lilypond-devel
[Top][All Lists]
Advanced

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

Re: Fixes boolean/SCM confusions, part 1. (issue 4875054)


From: dak
Subject: Re: Fixes boolean/SCM confusions, part 1. (issue 4875054)
Date: Thu, 18 Aug 2011 15:32:20 +0000


http://codereview.appspot.com/4875054/diff/8002/lily/accidental-engraver.cc
File lily/accidental-engraver.cc (right):

http://codereview.appspot.com/4875054/diff/8002/lily/accidental-engraver.cc#newcode319
lily/accidental-engraver.cc:319: if (scm_to_int
(left_objects_[i]->get_property ("side-axis")) == X_AXIS)
On 2011/08/18 14:24:44, Neil Puttock wrote:
this is potentially unsafe, but only since the type predicate for
side-axis is
number?

I can't see that there is a safety problem: scm_to_int will return an
integer if an integer can be returned, or will throw an error.  We
should definitely change the type predicate to integer? to avoid this
kind of error being
thrown at a less expected time, but that's about it.

The time to worry about nonsensical settings is when writing, not
reading variables.  After all, the worst that can happen is a controlled
exit here.

http://codereview.appspot.com/4875054/diff/8002/lily/accidental-engraver.cc#newcode455
lily/accidental-engraver.cc:455: if (!ly_is_equal (info.grob
()->get_property ("style"),
See comment for the last patch iteration.  Use scm_is_eq here for
efficiency.

http://codereview.appspot.com/4875054/diff/8002/lily/accidental-engraver.cc#newcode498
lily/accidental-engraver.cc:498: if (!ly_is_equal (last_keysig_, sig))
Again, use scm_is_eq here.  Explanation was in last comment batch
already.

http://codereview.appspot.com/4875054/



reply via email to

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