From 68466b09f103fd72188afe18f8d01f11f2163fde Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Sun, 22 Sep 2013 21:10:58 -0700 Subject: [PATCH] Add a few initializations to quiet compiler warnings. My manual analysis says that none of these are strictly necessary, (the various conditionals currently ensure that none of the variables are ever used uninitialized). But "gcc -O2" likes to complain, so these initializations keep it quiet. --- scherzo.c | 6 ++++-- score.c | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/scherzo.c b/scherzo.c index d6b3af5..8c6d394 100644 --- a/scherzo.c +++ b/scherzo.c @@ -147,7 +147,8 @@ on_key_press_event (GtkWidget *widget, { scherzo_t *scherzo = user_data; int octave; - score_pitch_name_t pitch_name; + /* Initialize to keep the compiler quiet. */ + score_pitch_name_t pitch_name = SCORE_PITCH_C; score_pitch_t pitch; if (scherzo->challenge.note) @@ -253,7 +254,8 @@ on_key_release_event (unused (GtkWidget *widget), { scherzo_t *scherzo = user_data; int octave; - score_pitch_name_t pitch_name; + /* Initialize to keep the compiler quiet. */ + score_pitch_name_t pitch_name = SCORE_PITCH_NAME_C; score_pitch_t pitch; if (scherzo->challenge.note) diff --git a/score.c b/score.c index fe7622d..9ef75bd 100644 --- a/score.c +++ b/score.c @@ -425,7 +425,8 @@ score_draw (score_t *score, cairo_t *cr) if (score->num_braces) { - int brace_width; + /* Initialize to keep the compiler quiet. */ + int brace_width = 0; for (i = 0; i < score->num_braces; i++) _draw_brace (score, cr, score->braces[i], &brace_width); -- 2.43.0