X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fscore.cc;h=b313b1abeee830878b13aa6a9263563e86afa9a4;hb=a57ca40f07d1bdd4191a9d857847af26b4d7c5f1;hp=b5316954696a1dad0f0166c5a1ef90fd51f986fc;hpb=bf090c279f6f8e0ebbffc72d7ee435172dfaddc8;p=lilypond.git diff --git a/lily/score.cc b/lily/score.cc index b531695469..b313b1abee 100644 --- a/lily/score.cc +++ b/lily/score.cc @@ -52,7 +52,7 @@ Score::Score () error_found_ = false; smobify_self (); - input_location_ = make_input (Input ()); + input_location_ = Input ().smobbed_copy (); } Score::~Score () @@ -62,27 +62,18 @@ Score::~Score () const char Score::type_p_name_[] = "ly:score?"; SCM -Score::mark_smob (SCM s) +Score::mark_smob () { - Score *sc = (Score *) SCM_CELL_WORD_1 (s); + scm_gc_mark (header_); + for (vsize i = defs_.size (); i--;) + scm_gc_mark (defs_[i]->self_scm ()); - scm_gc_mark (sc->header_); - for (vsize i = sc->defs_.size (); i--;) - scm_gc_mark (sc->defs_[i]->self_scm ()); - - scm_gc_mark (sc->input_location_); - return sc->music_; -} - -int -Score::print_smob (SCM, SCM p, scm_print_state *) -{ - scm_puts ("#", p); - - return 1; + scm_gc_mark (input_location_); + return music_; } Score::Score (Score const &s) + : Smob () { header_ = SCM_EOL; music_ = SCM_EOL; @@ -90,7 +81,7 @@ Score::Score (Score const &s) error_found_ = s.error_found_; smobify_self (); - input_location_ = make_input (*s.origin ()); + input_location_ = s.origin ()->smobbed_copy (); Music *m = Music::unsmob (s.music_); if (m) @@ -164,7 +155,7 @@ Score::book_rendering (Output_def *layoutbook, void Score::set_music (SCM music) { - if (Music::unsmob (music_)) + if (Music::is_smob (music_)) { Music::unsmob (music)->origin ()->error (_ ("already have music in score")); Music::unsmob (music_)->origin ()->error (_ ("this is the previous music"));