From ea55832341e89ced461dcde0a78861620d4c983c Mon Sep 17 00:00:00 2001 From: hanwen Date: Thu, 4 Aug 2005 11:11:31 +0000 Subject: [PATCH] (derived_mark): new method. Yes. We have to protect even those unlikely-to-be-corrupted data members. --- ChangeLog | 5 +++++ THANKS | 1 + VERSION | 2 +- lily/auto-beam-engraver.cc | 18 ++++++++++++++++-- lily/clef-engraver.cc | 12 +++++++++++- lily/hara-kiri-engraver.cc | 8 ++++++++ lily/stanza-number-engraver.cc | 8 ++++++++ lily/time-signature-engraver.cc | 8 ++++++++ lily/volta-engraver.cc | 9 +++++++++ 9 files changed, 67 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 346116ce3d..7393877f33 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-08-04 Han-Wen Nienhuys + + * lily/auto-beam-engraver.cc (derived_mark): new method. Yes. We + have to protect even those unlikely-to-be-corrupted data members. + 2005-08-03 Mats Bengtsson * Documentation/user/lilypond-book.itely (An example of a diff --git a/THANKS b/THANKS index 0d007c6070..aef612c9ec 100644 --- a/THANKS +++ b/THANKS @@ -74,6 +74,7 @@ Bruce McIntyre Bruce Fairchild Daniel Johnson David Rogers +Donald Axel Dylan Nicholson Ed Jackson Erik Ronström diff --git a/VERSION b/VERSION index 4dbc564328..c39372e5e7 100644 --- a/VERSION +++ b/VERSION @@ -1,6 +1,6 @@ PACKAGE_NAME=LilyPond MAJOR_VERSION=2 MINOR_VERSION=6 -PATCH_LEVEL=2 +PATCH_LEVEL=3 MY_PATCH_LEVEL= diff --git a/lily/auto-beam-engraver.cc b/lily/auto-beam-engraver.cc index 46f0bf36bb..7dc86355aa 100644 --- a/lily/auto-beam-engraver.cc +++ b/lily/auto-beam-engraver.cc @@ -29,6 +29,7 @@ protected: virtual void finalize (); virtual void acknowledge_grob (Grob_info); virtual void process_acknowledged_grobs (); + virtual void derived_mark () const; private: bool test_moment (Direction, Moment); @@ -63,11 +64,18 @@ private: // We act as if beam were created, and start a grouping anyway. Beaming_info_list *grouping_; - SCM beam_settings_; // ugh. should protect ? + SCM beam_settings_; Beaming_info_list *finished_grouping_; }; +void +Auto_beam_engraver::derived_mark () const +{ + scm_gc_mark (beam_settings_); +} + + void Auto_beam_engraver::process_music () { @@ -150,7 +158,13 @@ Auto_beam_engraver::create_beam () if (to_boolean (get_property ("skipTypesetting"))) return 0; - Spanner *beam = new Spanner (beam_settings_, context ()->get_grob_key ("Beam")); + /* + Can't use make_spanner_from_properties() because we have to use + beam_settings_. + */ + Spanner *beam = new Spanner (beam_settings_, + context ()->get_grob_key ("Beam")); + for (int i = 0; i < stems_->size (); i++) { /* diff --git a/lily/clef-engraver.cc b/lily/clef-engraver.cc index e7a0d00304..30ec5bfaa1 100644 --- a/lily/clef-engraver.cc +++ b/lily/clef-engraver.cc @@ -25,6 +25,8 @@ public: Direction octave_dir_; protected: + + virtual void derived_mark () const; virtual void stop_translation_timestep (); virtual void process_music (); virtual void acknowledge_grob (Grob_info); @@ -40,6 +42,14 @@ private: void inspect_clef_properties (); }; +void +Clef_engraver::derived_mark () const +{ + scm_gc_mark (prev_octavation_); + scm_gc_mark (prev_cpos_); + scm_gc_mark (prev_glyph_); +} + Clef_engraver::Clef_engraver () { clef_ = 0; @@ -49,7 +59,7 @@ Clef_engraver::Clef_engraver () /* will trigger a clef at the start since #f != ' () */ - prev_cpos_ = prev_glyph_ = SCM_BOOL_F; + prev_octavation_ = prev_cpos_ = prev_glyph_ = SCM_BOOL_F; } void diff --git a/lily/hara-kiri-engraver.cc b/lily/hara-kiri-engraver.cc index 343bdb08c8..54eed38fe2 100644 --- a/lily/hara-kiri-engraver.cc +++ b/lily/hara-kiri-engraver.cc @@ -20,10 +20,18 @@ protected: virtual void add_element (Grob *e); virtual void start_translation_timestep (); + virtual void derived_mark () const; + SCM interesting_; public: TRANSLATOR_DECLARATIONS (Hara_kiri_engraver); }; +void +Hara_kiri_engraver::derived_mark () const +{ + scm_gc_mark (interesting_); +} + void Hara_kiri_engraver::start_translation_timestep () diff --git a/lily/stanza-number-engraver.cc b/lily/stanza-number-engraver.cc index d74f0d8bcb..0c9c18fed3 100644 --- a/lily/stanza-number-engraver.cc +++ b/lily/stanza-number-engraver.cc @@ -26,6 +26,12 @@ public: virtual void acknowledge_grob (Grob_info); }; +void +Stanza_number_engraver::derived_mark () const +{ + scm_gc_mark (last_stanza_); +} + /* TODO: should make engraver that collects all the stanzas on a higher level, and then groups them to the side. Stanza numbers should be @@ -34,6 +40,8 @@ public: Stanza_number_engraver::Stanza_number_engraver () { + last_stanza_ = SCM_EOL; + text_ = 0; } diff --git a/lily/time-signature-engraver.cc b/lily/time-signature-engraver.cc index 77fd444f12..b3c9dd3bfa 100644 --- a/lily/time-signature-engraver.cc +++ b/lily/time-signature-engraver.cc @@ -20,12 +20,20 @@ class Time_signature_engraver : public Engraver SCM last_time_fraction_; protected: + virtual void derived_mark () const; virtual void stop_translation_timestep (); virtual void process_music (); public: TRANSLATOR_DECLARATIONS (Time_signature_engraver); }; +void +Time_signature_engraver::derived_mark () const +{ + scm_gc_mark (last_time_fraction_); +} + + Time_signature_engraver::Time_signature_engraver () { time_signature_ = 0; diff --git a/lily/volta-engraver.cc b/lily/volta-engraver.cc index 03e940650d..2590d0ed53 100644 --- a/lily/volta-engraver.cc +++ b/lily/volta-engraver.cc @@ -30,6 +30,7 @@ protected: virtual void stop_translation_timestep (); virtual void process_music (); + virtual void derived_mark () const; Moment started_mom_; Spanner *volta_span_; Spanner *end_volta_span_; @@ -39,8 +40,16 @@ protected: bool staff_eligible (); }; +void +Volta_engraver::derived_mark () const +{ + scm_gc_mark (staff_); + scm_gc_mark (start_string_); +} + Volta_engraver::Volta_engraver () { + start_string_ = SCM_EOL; staff_ = SCM_EOL; volta_span_ = 0; end_volta_span_ = 0; -- 2.39.5