From: fred Date: Sun, 24 Mar 2002 19:26:57 +0000 (+0000) Subject: lilypond-0.0.20 X-Git-Tag: release/1.5.59~5665 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=e792e7efb40dbd5feee1f322e8652778b19e7b1a;p=lilypond.git lilypond-0.0.20 --- diff --git a/hdr/misc.hh b/hdr/misc.hh index 376f048c0e..fa87876748 100644 --- a/hdr/misc.hh +++ b/hdr/misc.hh @@ -2,16 +2,22 @@ #define MISC_HH #include "real.hh" +#include "moment.hh" -Real wholes(int dur, int dots); +Moment wholes(int dur, int dots); double log_2(double x) ; int intlog2(int d); inline int -ABS(int i) -{ +abs(int i){ return (i < 0)?-i:i; } +inline int +sign(int i) { + if (i<0) return -1; + else if (i) return 1; + else return 0; +} #endif diff --git a/src/mylexer.cc b/src/mylexer.cc index 0a912e3389..699a46d9fa 100644 --- a/src/mylexer.cc +++ b/src/mylexer.cc @@ -1,3 +1,4 @@ +#include "interval.hh" #include "identparent.hh" #include "associter.hh" #include "lexer.hh" diff --git a/src/notehead.cc b/src/notehead.cc index 88cb621181..203c592830 100644 --- a/src/notehead.cc +++ b/src/notehead.cc @@ -1,3 +1,5 @@ +#include "misc.hh" + #include "notehead.hh" #include "dimen.hh" #include "debug.hh" @@ -60,7 +62,7 @@ Notehead::brew_molecole() output->translate(Offset(x_dir * p->note_width(),0)); bool streepjes = (position<-1)||(position > staff_size+1); if (streepjes) { - int dir = sgn(position); + int dir = sign(position); int s =(position<-1) ? -((-position)/2): (position-staff_size)/2; Symbol str = p->lookup_->streepjes(s); Molecule sm; diff --git a/src/pcol.cc b/src/pcol.cc index 951be6fa5f..7dc4c22c5a 100644 --- a/src/pcol.cc +++ b/src/pcol.cc @@ -43,7 +43,7 @@ PCol::print() const } else if (daddy) { mtor<<'\n' << ((this == daddy->prebreak) ? "prebreak" : "postbreak"); } - mtor << "extent: " << width().min << ", " << width().max << "\n"; + mtor << "extent: " << width().str() << "\n"; mtor << "}\n"; #endif } diff --git a/src/texslur.cc b/src/texslur.cc index eab9822940..a58a2cf94c 100644 --- a/src/texslur.cc +++ b/src/texslur.cc @@ -1,5 +1,5 @@ #include - +#include "misc.hh" #include "lookup.hh" #include "molecule.hh" #include "dimen.hh" @@ -39,7 +39,7 @@ Lookup::half_slur_middlepart(Real &dx, int dir) Symbol s; - s.dim.y = Interval(MIN(0,0), MAX(0,0)); + s.dim.y = Interval(min(0,0), max(0,0)); s.dim.x = Interval(0,dx); String f = String("\\hslurchar"); @@ -81,7 +81,7 @@ Lookup::half_slur(int dy, Real &dx, int dir, int xpart) Symbol s; s.dim.x = Interval(0,dx); - s.dim.y = Interval(MIN(0,dy), MAX(0,dy)); + s.dim.y = Interval(min(0,dy), max(0,dy)); String f = String("\\hslurchar"); @@ -111,7 +111,7 @@ Symbol Lookup::slur (int dy , Real &dx, int dir) { // ugh. assuming pt here. assert(dx >=0); - int y_sign = sgn(dy); + int y_sign = sign(dy); bool large = dy > 16; @@ -142,7 +142,7 @@ Lookup::slur (int dy , Real &dx, int dir) Symbol s; s.dim.x = Interval(0,dx); - s.dim.y = Interval(MIN(0,dy), MAX(0,dy)); + s.dim.y = Interval(min(0,dy), max(0,dy)); String f = String("\\slurchar") + direction_char(y_sign); @@ -173,7 +173,7 @@ Symbol Lookup::big_slur(int dy , Real &dx, int dir) { assert(dx >= convert_dimen(24,"pt")); - Real slur_extra =ABS(dy) /2.0 + 2; + Real slur_extra =abs(dy) /2.0 + 2; int l_dy = int(Real (dy)/2 + slur_extra*dir); int r_dy = dy - l_dy;