]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/accidental-engraver.cc
release commit
[lilypond.git] / lily / accidental-engraver.cc
index fd26acd16c1c3251243f829c828878f586ade08d..23958478898ae7a1fec65e7335531cd8481e74e1 100644 (file)
@@ -2,7 +2,7 @@
   accidental-engraver.cc -- implement accidental_engraver
 
   (c)  1997--2003 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  Modified 2001-2002 by Rune Zedeler <rz@daimi.au.dk>
+  Modified 2001--2002 by Rune Zedeler <rz@daimi.au.dk>
 */
 
 #include "event.hh"
@@ -17,6 +17,7 @@
 #include "arpeggio.hh"
 #include "warn.hh"
 #include "translator-group.hh"
+#include "protected-scm.hh"
 
 /**
 
@@ -58,13 +59,7 @@ protected:
   virtual void finalize ();
 public:
 
-  /*
-    TODO -> property.
-    
-    This is not a property, and it is not protected.  This poses a
-    very small risk of the value being GC'd from under us.
-  */
-  SCM last_keysig_;
+  Protected_scm last_keysig_;
 
   /*
     Urgh. Since the accidentals depend on lots of variables, we have to
@@ -83,7 +78,8 @@ public:
 };
 
 
-static void set_property_on_children (Translator_group * trans, const char * sym, SCM val)
+static void
+set_property_on_children (Translator_group * trans, const char * sym, SCM val)
 {
   trans->set_property (sym, val);
   for (SCM p = trans -> trans_group_list_; gh_pair_p (p); p = ly_cdr(p)) {
@@ -134,7 +130,7 @@ number_accidentals (SCM sig, Music * note, Pitch *pitch, SCM curbarnum, SCM lazy
   if (ignore_octave_b)
     prev = ly_assoc_cdr (scm_int2num (n), sig);
   else
-    prev = gh_assoc (gh_cons (scm_int2num (o), scm_int2num (n)), sig);
+    prev = scm_assoc (gh_cons (scm_int2num (o), scm_int2num (n)), sig);
 
   /* should really be true unless prev == SCM_BOOL_F */
   if (gh_pair_p (prev) && gh_pair_p (ly_cdr (prev)))
@@ -146,7 +142,7 @@ number_accidentals (SCM sig, Music * note, Pitch *pitch, SCM curbarnum, SCM lazy
   /* If an accidental was not found or the accidental was too old */
   if (prev == SCM_BOOL_F ||
       (gh_number_p (lazyness) && curbarnum_i > accbarnum_i + gh_scm2int (lazyness)))
-    prev = gh_assoc (scm_int2num (n), sig);
+    prev = scm_assoc (scm_int2num (n), sig);
 
 
   SCM prev_acc = (prev == SCM_BOOL_F) ? scm_int2num (0) : ly_cdr (prev);