]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/page-turn-engraver.cc
Replace C++ (in)equality checks with proper SCM syntax
[lilypond.git] / lily / page-turn-engraver.cc
index d7c7ccec3258a19940c6bb92eb1fdddeda525efb..c658c0c94bbd4241c9aa8e9054cc2ac48f7415dc 100644 (file)
@@ -1,7 +1,7 @@
 /*
   This file is part of LilyPond, the GNU music typesetter.
 
-  Copyright (C) 2006--2012 Joe Neeman <joeneeman@gmail.com>
+  Copyright (C) 2006--2015 Joe Neeman <joeneeman@gmail.com>
 
   LilyPond is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
@@ -66,7 +66,7 @@ public:
     if (duration_[LEFT] < penalty.duration_[LEFT])
       ret.push_back (Page_turn_event (duration_[LEFT], penalty.duration_[LEFT], permission_, penalty_));
 
-    if (penalty.permission_ != SCM_EOL)
+    if (!scm_is_null (penalty.permission_))
       ret.push_back (Page_turn_event (intersect[LEFT], intersect[RIGHT], permission_, new_pen));
 
     if (penalty.duration_[RIGHT] < duration_[RIGHT])
@@ -148,7 +148,7 @@ Page_turn_engraver::acknowledge_note_head (Grob_info gi)
   Stream_event *cause = gi.event_cause ();
 
   Duration *dur_ptr = cause
-                      ? unsmob_duration (cause->get_property ("duration"))
+                      ? Duration::unsmob (cause->get_property ("duration"))
                       : 0;
 
   if (!dur_ptr)
@@ -208,7 +208,7 @@ Page_turn_engraver::start_translation_timestep ()
 void
 Page_turn_engraver::stop_translation_timestep ()
 {
-  Grob *pc = unsmob_grob (get_property ("currentCommandColumn"));
+  Grob *pc = Grob::unsmob (get_property ("currentCommandColumn"));
 
   if (pc)
     {
@@ -229,9 +229,9 @@ Page_turn_engraver::stop_translation_timestep ()
   for (; scm_is_pair (cs); cs = scm_cdr (cs))
     {
       SCM command = scm_car (cs);
-      if (command == ly_symbol2scm ("start-repeat"))
+      if (scm_is_eq (command, ly_symbol2scm ("start-repeat")))
         start = true;
-      else if (command == ly_symbol2scm ("end-repeat"))
+      else if (scm_is_eq (command, ly_symbol2scm ("end-repeat")))
         end = true;
     }
 
@@ -239,7 +239,7 @@ Page_turn_engraver::stop_translation_timestep ()
     {
       Rational now = now_mom ().main_part_;
       Real pen = penalty ((now_mom () - rest_begin_).main_part_ + repeat_begin_rest_length_);
-      Moment *m = unsmob_moment (get_property ("minimumRepeatLengthForPageTurn"));
+      Moment *m = Moment::unsmob (get_property ("minimumRepeatLengthForPageTurn"));
       if (m && *m > (now_mom () - repeat_begin_))
         pen = infinity_f;
 
@@ -265,9 +265,10 @@ Page_turn_engraver::stop_translation_timestep ()
 SCM
 Page_turn_engraver::max_permission (SCM perm1, SCM perm2)
 {
-  if (perm1 == SCM_EOL)
+  if (scm_is_null (perm1))
     return perm2;
-  if (perm1 == ly_symbol2scm ("allow") && perm2 == ly_symbol2scm ("force"))
+  if (scm_is_eq (perm1, ly_symbol2scm ("allow"))
+      && scm_is_eq (perm2, ly_symbol2scm ("force")))
     return perm2;
   return perm1;
 }