From: David Kastrup Date: Sat, 23 Jun 2012 15:14:03 +0000 (+0200) Subject: Make third argument @var{alter} of ly:make-pitch optional. X-Git-Tag: release/2.15.41-1~15 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=5a3cea00a530d2f80cfce66e58dbeadbfe373bb6;p=lilypond.git Make third argument @var{alter} of ly:make-pitch optional. This has already been the case in the function signature, but actual use as an optional function argument resulted in an error message. --- diff --git a/lily/pitch-scheme.cc b/lily/pitch-scheme.cc index a188469fbd..a1f58ae63b 100644 --- a/lily/pitch-scheme.cc +++ b/lily/pitch-scheme.cc @@ -32,18 +32,20 @@ LY_DEFINE (ly_pitch_transpose, "ly:pitch-transpose", return t->transposed (*d).smobbed_copy (); } -/* Should add optional args. */ LY_DEFINE (ly_make_pitch, "ly:make-pitch", 2, 1, 0, (SCM octave, SCM note, SCM alter), "@var{octave} is specified by an integer, zero for the octave" " containing middle@tie{}C. @var{note} is a number indexing the" " global default scale, with 0 corresponding to pitch@tie{}C" - " and 6 usually corresponding to pitch@tie{}B. @var{alter} is" + " and 6 usually corresponding to pitch@tie{}B. " + " Optional @var{alter} is" " a rational number of 200-cent whole tones for alteration.") { LY_ASSERT_TYPE (scm_is_integer, octave, 1); LY_ASSERT_TYPE (scm_is_integer, note, 2); + if (SCM_UNBNDP (alter)) + alter = SCM_INUM0; LY_ASSERT_TYPE (scm_is_rational, alter, 3); Pitch p (scm_to_int (octave), scm_to_int (note),