]> git.cworth.org Git - scherzo/commitdiff
Change the various score add_note functions to not return a score_note_t.
authorCarl Worth <cworth@cworth.org>
Mon, 30 Sep 2013 00:25:19 +0000 (17:25 -0700)
committerCarl Worth <cworth@cworth.org>
Mon, 30 Sep 2013 00:26:41 +0000 (17:26 -0700)
With the callers no longer doing anything with this return value, we
can now drop it entirely.

score.c
score.h

diff --git a/score.c b/score.c
index ba27844fb02e9fc6835188f1409cd36e0442b5d2..5772c0fc7918c89f6c6c14a89769f8352eea4188 100644 (file)
--- 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
diff --git a/score.h b/score.h
index b8791f67f1caa5f8dd0ab9257efa9997d312fb46..573af22725a23f3a02c49b53ca4c2a67167b0ed9 100644 (file)
--- a/score.h
+++ b/score.h
@@ -114,14 +114,14 @@ score_add_staff (score_t *score, score_clef_t clef);
  * _EIGHTH, etc.) or numerical as simply the denominator (WHOLE=1,
  * QUARTER=4, EIGHTH=8, etc.)
  */
-score_note_t *
+void
 score_staff_add_note (score_staff_t *staff,
                      pitch_t pitch,
                      score_duration_t duration);
 
 /* Add a note to the score, (automatically selecting the nearest
  * staff) */
-score_note_t *
+void
 score_add_note (score_t *score, pitch_t pitch, score_duration_t duration);
 
 /* Add a chord symbol of 'name' to a staff.