X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fduration-scheme.cc;h=8ac8b2d6e3bb0dfcaf1f2498ef0f1b040e5ca284;hb=38d7d319eabc906e82fb42002678c6d42a23b6f7;hp=de8646e85879a5e5fdd18057e172318ee8c56116;hpb=73c936b8ce96f051ca113fa366da16ad41024839;p=lilypond.git diff --git a/lily/duration-scheme.cc b/lily/duration-scheme.cc index de8646e858..8ac8b2d6e3 100644 --- a/lily/duration-scheme.cc +++ b/lily/duration-scheme.cc @@ -3,7 +3,7 @@ source file of the LilyPond music typesetter - (c) 1997--2006 Jan Nieuwenhuizen + (c) 1997--2009 Jan Nieuwenhuizen Han-Wen Nienhuys */ @@ -27,12 +27,12 @@ LY_DEFINE (ly_duration_less_p, "ly:durationduration_log ()); } LY_DEFINE (ly_duration_dot_count, "ly:duration-dot-count", 1, 0, 0, (SCM dur), - "Extract the dot count from @var{dur}") + "Extract the dot count from @var{dur}.") { - SCM_ASSERT_TYPE (unsmob_duration (dur), dur, SCM_ARG1, __FUNCTION__, "duration"); + LY_ASSERT_SMOB (Duration, dur, 1); return scm_from_int (unsmob_duration (dur)->dot_count ()); } @@ -108,32 +106,33 @@ LY_DEFINE (ly_intlog2, "ly:intlog2", 1, 0, 0, (SCM d), "The 2-logarithm of 1/@var{d}.") { - SCM_ASSERT_TYPE (scm_is_number (d), d, SCM_ARG1, __FUNCTION__, "integer"); + LY_ASSERT_TYPE (scm_is_number, d, 1); int log = intlog2 (scm_to_int (d)); return scm_from_int (log); } LY_DEFINE (ly_duration_length, "ly:duration-length", 1, 0, 0, (SCM dur), - "The length of the duration as a Moment.") + "The length of the duration as a @code{moment}.") { - SCM_ASSERT_TYPE (unsmob_duration (dur), dur, SCM_ARG1, __FUNCTION__, "duration"); + LY_ASSERT_SMOB (Duration, dur, 1); return Moment (unsmob_duration (dur)->get_length ()).smobbed_copy (); } -LY_DEFINE (ly_duration2string, "ly:duration->string", +LY_DEFINE (ly_duration_2_string, "ly:duration->string", 1, 0, 0, (SCM dur), - "Convert @var{dur} to string.") + "Convert @var{dur} to a string.") { - SCM_ASSERT_TYPE (unsmob_duration (dur), dur, SCM_ARG1, __FUNCTION__, "duration"); + LY_ASSERT_SMOB (Duration, dur, 1); return ly_string2scm (unsmob_duration (dur)->to_string ()); } LY_DEFINE (ly_duration_factor, "ly:duration-factor", 1, 0, 0, (SCM dur), - "Extract the compression factor from @var{dur}. Return as a pair.") + "Extract the compression factor from @var{dur}." + " Return it as a pair.") { - SCM_ASSERT_TYPE (unsmob_duration (dur), dur, SCM_ARG1, __FUNCTION__, "duration"); + LY_ASSERT_SMOB (Duration, dur, 1); Rational r = unsmob_duration (dur)->factor (); - return scm_cons (scm_from_int (r.num ()), scm_from_int (r.den ())); + return scm_cons (scm_from_int64 (r.num ()), scm_from_int64 (r.den ())); }