X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=score.c;h=5772c0fc7918c89f6c6c14a89769f8352eea4188;hb=81cfa1750954a0f7293f8caf3b3f27bf9a4e5e3d;hp=ba27844fb02e9fc6835188f1409cd36e0442b5d2;hpb=367e517451123c7c79ead28eca6d2489bfed6467;p=scherzo diff --git a/score.c b/score.c index ba27844..5772c0f 100644 --- a/score.c +++ b/score.c @@ -605,7 +605,7 @@ score_remove_chord (score_chord_t *chord) staff->num_chords -= 1; } -score_note_t * +void score_staff_add_note (score_staff_t *staff, pitch_t pitch, score_duration_t duration) @@ -620,13 +620,13 @@ score_staff_add_note (score_staff_t *staff, if (note->pitch == pitch && note->duration == duration) { - return note; + return; } } note = talloc (staff, score_note_t); if (note == NULL) - return NULL; + return; note->staff = staff; note->pitch = pitch; @@ -654,15 +654,13 @@ score_staff_add_note (score_staff_t *staff, staff->num_notes); if (staff->notes == NULL) { staff->num_notes = 0; - return NULL; + return; } staff->notes[staff->num_notes - 1] = note; - - return note; } -score_note_t * +void score_add_note (score_t *score, pitch_t pitch, score_duration_t duration) { score_staff_t *staff, *nearest_staff = NULL; @@ -671,7 +669,7 @@ score_add_note (score_t *score, pitch_t pitch, score_duration_t duration) /* Nothing to do if we have no staff, (there's no place to add a note) . */ if (score->num_staves == 0) - return NULL; + return; /* Find the staff where the note will be closest to the center of * the staff. */ @@ -684,7 +682,7 @@ score_add_note (score_t *score, pitch_t pitch, score_duration_t duration) } } - return score_staff_add_note (nearest_staff, pitch, duration); + score_staff_add_note (nearest_staff, pitch, duration); } void