]> git.donarmstrong.com Git - lilypond.git/commit - lily/include/misc.hh
This fixes an endless loop in duration.cc:67.
authorMichael Käppler <xmichael-k@web.de>
Sat, 28 Feb 2009 09:20:38 +0000 (10:20 +0100)
committerJoe Neeman <joeneeman@gmail.com>
Sun, 1 Mar 2009 19:24:17 +0000 (11:24 -0800)
commitb45f2a64f2dba80aea47d596b38068f71402579a
tree78a0bbf35bf150225cb4a8420c6a578a64dab449
parent035358ed8b78b32fcfc459de459f7d995393255e
This fixes an endless loop in duration.cc:67.

The loop occurred when Duration::Duration(Rational r, bool scale) was called
with r.num() >= 2 * r.den(), f.e. the duration of a longa: r.num = 2,
r.den = 1. If k < 0, the left-shifting-operator << returns an undefined value
instead of right-shifting bits. The fix introduces a new function
shift_left() in misc.hh, which behaves different.
lily/duration.cc
lily/include/misc.hh