From: Werner Lemberg Date: Mon, 15 Aug 2011 07:37:43 +0000 (+0200) Subject: Clean up g++ 4.6.1 compiler warnings (-Wunused-but-set-variable). X-Git-Tag: release/2.15.9-1~10^2~3 X-Git-Url: https://git.donarmstrong.com/?p=lilypond.git;a=commitdiff_plain;h=a1e77b006a67e9047cb13610e5b71956817f97c0 Clean up g++ 4.6.1 compiler warnings (-Wunused-but-set-variable). --- diff --git a/lily/break-alignment-interface.cc b/lily/break-alignment-interface.cc index a471a7ba9f..619d8eaab2 100644 --- a/lily/break-alignment-interface.cc +++ b/lily/break-alignment-interface.cc @@ -103,13 +103,10 @@ Break_alignment_interface::calc_positioning_done (SCM smob) vector elems = ordered_elements (me); vector extents; - int last_nonempty = -1; for (vsize i = 0; i < elems.size (); i++) { Interval y = elems[i]->extent (elems[i], X_AXIS); extents.push_back (y); - if (!y.is_empty ()) - last_nonempty = i; } vsize idx = 0; diff --git a/lily/breathing-sign.cc b/lily/breathing-sign.cc index 85da75c961..f1f89093ea 100644 --- a/lily/breathing-sign.cc +++ b/lily/breathing-sign.cc @@ -70,16 +70,9 @@ SCM Breathing_sign::divisio_maior (SCM smob) { Grob *me = unsmob_grob (smob); - Real staff_space = Staff_symbol_referencer::staff_space (me); - Real staff_size; Real thickness = Staff_symbol_referencer::line_thickness (me); thickness *= robust_scm2double (me->get_property ("thickness"), 1.0); - if (Staff_symbol_referencer::get_staff_symbol (me)) - staff_size = (Staff_symbol_referencer::line_count (me) - 1) * staff_space; - else - staff_size = 0.0; - Real blotdiameter = me->layout ()->get_dimension (ly_symbol2scm ("blot-diameter")); /* diff --git a/lily/chord-tremolo-iterator.cc b/lily/chord-tremolo-iterator.cc index 1658e55782..effa751425 100644 --- a/lily/chord-tremolo-iterator.cc +++ b/lily/chord-tremolo-iterator.cc @@ -34,7 +34,6 @@ Chord_tremolo_iterator::get_music_list () const { Music *mus = get_music (); Input *origin = mus->origin (); - Moment l = mus->get_length (); Music *body = Repeated_music::body (mus); bool body_is_sequential = body->is_mus_type ("sequential-music"); diff --git a/lily/dispatcher.cc b/lily/dispatcher.cc index a6cee709ce..0e3ad8998e 100644 --- a/lily/dispatcher.cc +++ b/lily/dispatcher.cc @@ -89,7 +89,9 @@ Dispatcher::dispatch (SCM sev) ev->origin ()->warning (_f ("Unknown event class %s", ly_symbol2string (class_symbol).c_str ())); return; } +#if 0 bool sent = false; +#endif int num_classes = scm_ilength (class_list); /* @@ -148,7 +150,9 @@ Dispatcher::dispatch (SCM sev) Listener *l = unsmob_listener (scm_cdar (lists[0].list)); l->listen (ev->self_scm ()); +#if 0 sent = true; +#endif } // go to the next listener; bubble-sort the class list. SCM next = scm_cdr (lists[0].list); @@ -161,10 +165,11 @@ Dispatcher::dispatch (SCM sev) lists[i].list = next; } - /* TODO: Uncomment. +#if 0 + /* TODO: Uncomment. */ if (!sent) warning (_f ("Junking event: %s", ly_symbol2string (class_symbol).c_str ())); - */ +#endif } void diff --git a/lily/dynamic-engraver.cc b/lily/dynamic-engraver.cc index 0107e7f436..06f16cf8a8 100644 --- a/lily/dynamic-engraver.cc +++ b/lily/dynamic-engraver.cc @@ -167,9 +167,6 @@ Dynamic_engraver::process_music () Axis_group_interface::add_element (line_spanner_, script_); } - Stream_event *stop_ev = accepted_spanevents_drul_ [STOP] - ? accepted_spanevents_drul_[STOP] : script_ev_; - if (accepted_spanevents_drul_[STOP] || script_ev_) { /* @@ -193,10 +190,7 @@ Dynamic_engraver::process_music () current_cresc_ev_ = 0; } else if (accepted_spanevents_drul_[STOP]) - { - accepted_spanevents_drul_[STOP]->origin ()->warning (_ ("cannot find start of (de)crescendo")); - stop_ev = 0; - } + accepted_spanevents_drul_[STOP]->origin ()->warning (_ ("cannot find start of (de)crescendo")); } if (accepted_spanevents_drul_[START]) diff --git a/lily/general-scheme.cc b/lily/general-scheme.cc index e74bf0bf16..a630fd90f5 100644 --- a/lily/general-scheme.cc +++ b/lily/general-scheme.cc @@ -379,13 +379,16 @@ LY_DEFINE (ly_stderr_redirect, "ly:stderr-redirect", LY_ASSERT_TYPE (scm_is_string, file_name, 1); string m = "w"; + string f = ly_scm2string (file_name); FILE *stderrfile; if (mode != SCM_UNDEFINED && scm_string_p (mode)) m = ly_scm2string (mode); /* dup2 and (fileno (current-error-port)) do not work with mingw'c gcc -mwindows. */ fflush (stderr); - stderrfile = freopen (ly_scm2string (file_name).c_str (), m.c_str (), stderr); + stderrfile = freopen (f.c_str (), m.c_str (), stderr); + if (!stderrfile) + error (_f ("failed redirecting stderr to `%s'", f.c_str ())); return SCM_UNSPECIFIED; } diff --git a/lily/note-collision.cc b/lily/note-collision.cc index 24c9ce92a4..b7060092e1 100644 --- a/lily/note-collision.cc +++ b/lily/note-collision.cc @@ -213,7 +213,6 @@ check_meshing_chords (Grob *me, && (up_style == ly_symbol2scm ("fa") || up_style == ly_symbol2scm ("faThin")) && (down_style == ly_symbol2scm ("fa") || down_style == ly_symbol2scm ("faThin"))) { - Interval uphead_size = head_up->extent (head_up, Y_AXIS); Offset att = Offset (0.0, -1.0); head_up->set_property ("stem-attachment", ly_offset2scm (att)); head_up->set_property ("transparent", SCM_BOOL_T); diff --git a/lily/spacing-engraver.cc b/lily/spacing-engraver.cc index c9049f3398..b2d25f0713 100644 --- a/lily/spacing-engraver.cc +++ b/lily/spacing-engraver.cc @@ -219,7 +219,6 @@ Spacing_engraver::stop_translation_timestep () Stream_event *ev = playing_durations_[i].info_.event_cause (); if (ev) { - Moment now = now_mom (); Moment m = get_event_length (ev); shortest_playing = min (shortest_playing, m); } diff --git a/lily/tie.cc b/lily/tie.cc index b52f84db0f..078d4fc5dd 100644 --- a/lily/tie.cc +++ b/lily/tie.cc @@ -189,7 +189,6 @@ Tie::get_default_control_points (Grob *me_grob) Tie_formatting_problem problem; problem.from_tie (me); - Tie_specification spec = problem.get_tie_specification (0); if (!me->is_live ()) return SCM_EOL;