CVSROOT:        /cvsroot/lilypond
Module name:    lilypond
Branch:         
Changes by:     Han-Wen Nienhuys <[EMAIL PROTECTED]>    05/08/04 13:36:43

Modified files:
        .              : ChangeLog 
        flower         : rational.cc 
        lily           : parser.yy tuplet-bracket.cc 

Log message:
        * lily/parser.yy (simple_string): allow \new STRING_IDENTIFIER.
        
        * flower/rational.cc (operator +): prevent overflow. This fixes
        heavily nested tuplets.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/ChangeLog.diff?tr1=1.3954&tr2=1.3955&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/flower/rational.cc.diff?tr1=1.33&tr2=1.34&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/lily/parser.yy.diff?tr1=1.486&tr2=1.487&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/lily/tuplet-bracket.cc.diff?tr1=1.90&tr2=1.91&r1=text&r2=text

Patches:
Index: lilypond/ChangeLog
diff -u lilypond/ChangeLog:1.3954 lilypond/ChangeLog:1.3955
--- lilypond/ChangeLog:1.3954   Thu Aug  4 11:50:54 2005
+++ lilypond/ChangeLog  Thu Aug  4 13:36:42 2005
@@ -1,5 +1,10 @@
 2005-08-04  Han-Wen Nienhuys  <[EMAIL PROTECTED]>
 
+       * lily/parser.yy (simple_string): allow \new STRING_IDENTIFIER.
+
+       * flower/rational.cc (operator +): prevent overflow. This fixes
+       heavily nested tuplets.
+
        * lily/auto-beam-engraver.cc (derived_mark): new method. Yes. We
        have to protect even those unlikely to be corrupted data members.  
 
Index: lilypond/flower/rational.cc
diff -u lilypond/flower/rational.cc:1.33 lilypond/flower/rational.cc:1.34
--- lilypond/flower/rational.cc:1.33    Wed Jul 13 19:31:02 2005
+++ lilypond/flower/rational.cc Thu Aug  4 13:36:43 2005
@@ -171,8 +171,9 @@
     *this = r;
   else
     {
-      int n = sign_ * num_ * r.den_ + r.sign_ * den_ * r.num_;
-      int d = den_ * r.den_;
+      int lcm =  (den_ / gcd (r.den_, den_)) * r.den_;
+      int n = sign_ * num_ * (lcm / den_) + r.sign_ * r.num_ * (lcm / r.den_);
+      int d = lcm;
       sign_ = ::sign (n) * ::sign (d);
       num_ = abs (n);
       den_ = abs (d);
Index: lilypond/lily/parser.yy
diff -u lilypond/lily/parser.yy:1.486 lilypond/lily/parser.yy:1.487
--- lilypond/lily/parser.yy:1.486       Wed Aug  3 18:23:47 2005
+++ lilypond/lily/parser.yy     Thu Aug  4 13:36:43 2005
@@ -1513,6 +1513,9 @@
        | LYRICS_STRING {
                $$ = $1;
        }
+       | STRING_IDENTIFIER {
+               $$ = $1;
+       }
        ;
 
 scalar: string {
Index: lilypond/lily/tuplet-bracket.cc
diff -u lilypond/lily/tuplet-bracket.cc:1.90 
lilypond/lily/tuplet-bracket.cc:1.91
--- lilypond/lily/tuplet-bracket.cc:1.90        Thu Aug  4 11:50:55 2005
+++ lilypond/lily/tuplet-bracket.cc     Thu Aug  4 13:36:43 2005
@@ -386,6 +386,9 @@
   commony = common_refpoint_of_array (tuplets, commony, Y_AXIS);
   Grob *commonx = common_refpoint_of_array (columns, me, X_AXIS);
   commonx = common_refpoint_of_array (tuplets, commonx, Y_AXIS);
+  commonx = commonx->common_refpoint (me->get_bound (LEFT), X_AXIS);
+  commonx = commonx->common_refpoint (me->get_bound (RIGHT), X_AXIS);
+
 
   Interval staff;
   if (Grob *st = Staff_symbol_referencer::get_staff_symbol (me))
@@ -662,7 +665,8 @@
               "tuplet-bracket-interface",
               "A bracket with a number in the middle, used for tuplets. "
               "When the bracket spans  a line break, the value of "
-              "@code{break-overshoot} determines how far it extends beyond the 
staff. "
+              "@code{break-overshoot} determines how far it extends "
+              "beyond the staff. "
               "At a line break, the markups in the @code{edge-text} are 
printed "
               "at the edges. ",
 


_______________________________________________
Lilypond-cvs mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/lilypond-cvs

Reply via email to