X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fduration.cc;h=413ac889ec497e7447b5e443c8e783b3704513dd;hb=7279e5754ac3b0f3c99018ae28ac7eb83a93fc79;hp=80ba74e84c83de41a8c6508d60d4256b4830b164;hpb=e24df7c27635dc996c466295eacf2981bddccaf7;p=lilypond.git diff --git a/lily/duration.cc b/lily/duration.cc index 80ba74e84c..413ac889ec 100644 --- a/lily/duration.cc +++ b/lily/duration.cc @@ -3,9 +3,8 @@ source file of the LilyPond music typesetter - (c) 1997--2005 Jan Nieuwenhuizen - Han-Wen Nienhuys - + (c) 1997--2006 Jan Nieuwenhuizen + Han-Wen Nienhuys */ #include "duration.hh" @@ -48,7 +47,7 @@ Duration::get_length () const { Rational mom (1 << abs (durlog_)); - if (durlog_> 0) + if (durlog_ > 0) mom = Rational (1) / mom; Rational delta = mom; @@ -61,13 +60,13 @@ Duration::get_length () const return mom * factor_; } -String +string Duration::to_string () const { - String s; + string s; - if (durlog_ < 0 ) - s = "log = " + ::to_string (durlog_); + if (durlog_ < 0) + s = "log = " + ::to_string (durlog_); else s = ::to_string (1 << durlog_); @@ -77,7 +76,6 @@ Duration::to_string () const return s; } - IMPLEMENT_TYPE_P (Duration, "ly:duration?"); SCM @@ -90,20 +88,20 @@ IMPLEMENT_SIMPLE_SMOBS (Duration); int Duration::print_smob (SCM s, SCM port, scm_print_state *) { - Duration *r = (Duration *) SCM_CELL_WORD_1 (s); + Duration *r = (Duration *) SCM_CELL_WORD_1 (s); scm_puts ("#to_string ().to_str0 ()), port); + scm_display (scm_makfrom0str (r->to_string ().c_str ()), port); scm_puts (" >", port); return 1; } SCM -Duration::equal_p (SCM a , SCM b) +Duration::equal_p (SCM a, SCM b) { - Duration *p = (Duration *) SCM_CELL_WORD_1 (a); - Duration *q = (Duration *) SCM_CELL_WORD_1 (b); + Duration *p = (Duration *) SCM_CELL_WORD_1 (a); + Duration *q = (Duration *) SCM_CELL_WORD_1 (b); bool eq = p->dots_ == q->dots_ && p->durlog_ == q->durlog_ @@ -112,7 +110,6 @@ Duration::equal_p (SCM a , SCM b) return eq ? SCM_BOOL_T : SCM_BOOL_F; } - int Duration::duration_log () const {