X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fduration-scheme.cc;h=a90fb1fda81079f6a8b95659e1bfb25a36add4ee;hb=5b4b0d6e9a197e8f9eb085b7c2ad78b8be3e5cfc;hp=4b8c4605c0e19e40c984c4b1e4fe424a7b112d0c;hpb=f9214bac21e9926dc3248416f58190c98c4167a9;p=lilypond.git diff --git a/lily/duration-scheme.cc b/lily/duration-scheme.cc index 4b8c4605c0..a90fb1fda8 100644 --- a/lily/duration-scheme.cc +++ b/lily/duration-scheme.cc @@ -3,7 +3,7 @@ source file of the LilyPond music typesetter - (c) 1997--2007 Jan Nieuwenhuizen + (c) 1997--2008 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 ())); }