]> git.donarmstrong.com Git - lilypond.git/commitdiff
Issue 5052: Information preserving parts of issue 4342
authorDavid Kastrup <dak@gnu.org>
Sat, 4 Feb 2017 12:43:41 +0000 (13:43 +0100)
committerDavid Kastrup <dak@gnu.org>
Sat, 11 Feb 2017 07:49:30 +0000 (08:49 +0100)
Those should not affect any output.

18 files changed:
lily/accidental-engraver.cc
lily/book-scheme.cc
lily/break-alignment-interface.cc
lily/grob-pq-engraver.cc
lily/key-engraver.cc
lily/music.cc
lily/ottava-engraver.cc
lily/page-breaking.cc
lily/page-layout-problem.cc
lily/paper-book.cc
lily/paper-column.cc
lily/parser.yy
lily/prob-scheme.cc
lily/script-column.cc
lily/simple-spacer.cc
lily/spring-smob.cc
lily/stanza-number-engraver.cc
lily/time-signature-engraver.cc

index d8cc647bc0b07a0f809881bcd08355c6fc94f59b..003b37ff318f56f11638bb099ffbfffe76efb7fc 100644 (file)
@@ -508,7 +508,7 @@ void
 Accidental_engraver::process_music ()
 {
   SCM sig = get_property ("keyAlterations");
-  if (last_keysig_ != sig)
+  if (!scm_is_eq (last_keysig_, sig))
     update_local_key_signature (sig);
 }
 
index af0cb6263221e745f6b5d27d2dce49ba6fa9668c..c63f47dd078b49597c22ee8aeaef54368cb564d6 100644 (file)
@@ -152,7 +152,7 @@ LY_DEFINE (ly_book_header, "ly:book-header",
 {
   LY_ASSERT_SMOB (Book, book, 1);
   Book *b = unsmob<Book> (book);
-  return b->header_ ? b->header_ : SCM_BOOL_F;
+  return ly_is_module (b->header_) ? b->header_ : SCM_BOOL_F;
 }
 
 LY_DEFINE (ly_book_set_header_x, "ly:book-set-header!",
index e2a546f6a676ed1ecbbbc85ef56414aea512e0a2..a1d7606445353ece111cbf221a4bc9eda9257f53 100644 (file)
@@ -73,7 +73,7 @@ Break_alignment_interface::ordered_elements (Grob *grob)
       for (vsize i = writable_elts.size (); i--;)
         {
           Grob *g = writable_elts[i];
-          if (g && sym == g->get_property ("break-align-symbol"))
+          if (g && scm_is_eq (sym, g->get_property ("break-align-symbol")))
             {
               new_elts.push_back (g);
               writable_elts.erase (writable_elts.begin () + i);
@@ -277,9 +277,10 @@ Break_alignable_interface::self_align_callback (SCM grob)
       SCM sym = scm_car (symbol_list);
       for (vsize i = 0; i < elements.size (); i++)
         {
-          if (elements[i]->get_property ("break-align-symbol") == sym)
+          if (scm_is_eq (sym, elements[i]->get_property ("break-align-symbol")))
             {
               if (Item::break_visible (elements[i])
+                  // TODO SCM: simplify syntax?
                   && !elements[i]->extent (elements[i], X_AXIS).is_empty ())
                 {
                   break_aligned_grob = i;
index 174b93c26aee235b01b554371729ef082bc35b3c..a9fa75eda51d9708252519adc7f7e34b89ad9927 100644 (file)
@@ -145,7 +145,7 @@ Grob_pq_engraver::start_translation_timestep ()
       busy = scm_cdr (busy);
     }
 
-  if (start_busy != busy)
+  if (!scm_is_eq (start_busy, busy))
     context ()->set_property ("busyGrobs", busy);
 }
 
index f54421cf255081c91b8baaa7cc6d9d503758c70a..a61d7701d768dbb4c28246ac72743c3d7265303a 100644 (file)
@@ -148,7 +148,8 @@ void
 Key_engraver::process_music ()
 {
   if (key_event_
-      || get_property ("lastKeyAlterations") != get_property ("keyAlterations"))
+      || !scm_is_eq (get_property ("lastKeyAlterations"),
+                     get_property ("keyAlterations")))
     create_key (false);
 }
 
index 8b9da5596d02d5d217c397bd2b47b9b1be5c346d..ae75ff795273da024d404a76d144f10da52613bd 100644 (file)
@@ -237,7 +237,7 @@ Prob::transpose (Pitch delta)
                && scm_is_pair (val))
         new_val = ly_transpose_key_alist (val, delta.smobbed_copy ());
 
-      if (val != new_val)
+      if (!scm_is_eq (val, new_val))
         scm_set_cdr_x (entry, new_val);
     }
 }
index 9a846377fb1c89de85e0c6cbae25177c82fec8a1..e9bcbe94d5ffdb3f53bd5b9da14a749e7f067dbb 100644 (file)
@@ -64,7 +64,7 @@ void
 Ottava_spanner_engraver::process_music ()
 {
   SCM ott = get_property ("ottavation");
-  if (ott != last_ottavation_)
+  if (!scm_is_eq (ott, last_ottavation_))
     {
       finished_ = span_;
       span_ = 0;
index ef9e095d6abe144f189e39b34709d2cb490a7406..fb476848983f6a6ff0ce60ea10c014fd9e294fa0 100644 (file)
@@ -651,7 +651,7 @@ Page_breaking::make_pages (vector<vsize> lines_per_page, SCM systems)
       SCM lines = scm_caar (s);
       SCM config = scm_cdar (s);
 
-      bool bookpart_last_page = (s == systems_configs_fncounts);
+      bool bookpart_last_page = scm_is_eq (s, systems_configs_fncounts);
       SCM page = draw_page (lines, config, page_num, bookpart_last_page);
       /* collect labels */
       SCM page_num_scm = scm_from_int (page_num);
@@ -760,7 +760,7 @@ Page_breaking::find_chunks_and_breaks (Break_predicate is_break, Prob_break_pred
 
               bool last = (j == cols.size () - 1);
               bool break_point = is_break && is_break (cols[j]);
-              bool chunk_end = cols[j]->get_property ("page-break-permission") == force_sym;
+              bool chunk_end = scm_is_eq (cols[j]->get_property ("page-break-permission"), force_sym);
               Break_position cur_pos = Break_position (i,
                                                        line_breaker_columns.size (),
                                                        cols[j],
index 8f1951223c4e8a4721047f848ec296ebc50a5e3f..479ac72bf72ec1152a3b4bd78affeae26fe78262 100644 (file)
@@ -449,7 +449,7 @@ Page_layout_problem::Page_layout_problem (Paper_book *pb, SCM page_scm, SCM syst
 
   for (SCM s = systems; scm_is_pair (s); s = scm_cdr (s))
     {
-      bool first = (s == systems);
+      bool first = scm_is_eq (s, systems);
 
       if (Grob *g = unsmob<Grob> (scm_car (s)))
         {
index 3a672198b538df5a880c19b1032db80adb1af946..c17ed576f1895c0a91febb29164ea9987dda1b0f 100644 (file)
@@ -514,7 +514,7 @@ Paper_book::get_system_specs ()
               SCM footnotes = get_footnotes (unsmob<Stencil> (t)->expr ());
               ps->set_property ("footnotes", footnotes);
               ps->set_property ("is-title", SCM_BOOL_T);
-              if (list == texts)
+              if (scm_is_eq (list, texts))
                 first = ps;
               else
                 {
index da3807c31d6f4ddb33fb75edf69c24ec3baf8175..5462027928693c15aa9a85d00ccca134b8945173 100644 (file)
@@ -209,7 +209,8 @@ Paper_column::break_align_width (Grob *me, SCM align_syms)
           extract_grob_set (me, "elements", elts);
           for (vsize i = 0; i < elts.size (); i++)
             {
-              if (elts[i]->get_property ("break-align-symbol") == align_sym
+              if (scm_is_eq (align_sym, elts[i]->get_property ("break-align-symbol"))
+                  // TODO SCM: there must be a simpler way to put this.
                   && !elts[i]->extent (elts[i], X_AXIS).is_empty ())
                 {
                   align = elts[i];
index 065713de1a8f56ee7e6b115e31b2e51e1018cd98..35d858c46f6dbef1c383c3588bc7dba697fc914b 100644 (file)
@@ -2719,8 +2719,8 @@ context_mod:
        | context_def_mod embedded_scm
        {
                if (!scm_is_string ($2)
-                   && ly_symbol2scm ("consists") != $1
-                   && ly_symbol2scm ("remove") != $1)
+                   && !scm_is_eq ($1, ly_symbol2scm ("consists"))
+                   && !scm_is_eq ($1, ly_symbol2scm ("remove")))
                {
                        $$ = SCM_EOL;
                        parser->parser_error (@1, _ ("only \\consists and \\remove take non-string argument."));
index 03c84eca4d081a943add1ce4d014514d8de6c4d0..a9424da91f5479da82a5c9cf699dec332119e0f5 100644 (file)
@@ -67,7 +67,7 @@ LY_DEFINE (ly_prob_type_p, "ly:prob-type?",
            "Is @var{obj} the specified prob-type?")
 {
   Prob *prob = unsmob<Prob> (obj);
-  return scm_from_bool (prob && prob->type () == type);
+  return scm_from_bool (prob && scm_is_eq (prob->type (), type));
 }
 
 LY_DEFINE (ly_make_prob, "ly:make-prob",
index 94aa8908e70a1dfc3c2dfc791358491edb99e9d9..a12560bf8e19426eaec8f254b782a8e6108ccefb 100644 (file)
@@ -77,8 +77,8 @@ Script_column::row_before_line_breaking (SCM smob)
         {
           affect_all_grobs.push_back (sc);
         }
-      else if (sc->get_property_data ("Y-offset")
-               != Side_position_interface::y_aligned_side_proc)
+      else if (!scm_is_eq (sc->get_property_data ("Y-offset"),
+                           Side_position_interface::y_aligned_side_proc))
         {
           head_scripts_map[sc->get_parent (Y_AXIS)].push_back (sc);
         }
@@ -112,8 +112,8 @@ Script_column::before_line_breaking (SCM smob)
       /*
         Don't want to consider scripts horizontally next to notes.
       */
-      if (sc->get_property_data ("X-offset")
-          != Side_position_interface::x_aligned_side_proc)
+      if (!scm_is_eq (sc->get_property_data ("X-offset"),
+                      Side_position_interface::x_aligned_side_proc))
         staff_sided.push_back (sc);
     }
 
index bf64413a8a4eb28badd8d1e969d6ecd5b4601703..cf4fd5849e35601ad8cf839394d7f6d6ba407c8e 100644 (file)
@@ -470,7 +470,7 @@ get_line_forces (vector<Grob *> const &columns,
                 force[b * breaks.size () + c] = infinity_f;
               break;
             }
-          if (end < cols.size () && cols[end].break_permission_ == force_break)
+          if (end < cols.size () && scm_is_eq (cols[end].break_permission_, force_break))
             break;
         }
     }
index a389df2efdb5921a60b56814a7a2c2f210bb495f..19a5eef4c5ff87ffc4fc18a84f2f0af14fce3286 100644 (file)
@@ -26,7 +26,8 @@
 SCM
 Spring::equal_p (SCM a, SCM b)
 {
-  return a == b ? SCM_BOOL_T : SCM_BOOL_F;
+  // TODO SCM: This could be made simpler.
+  return scm_is_eq (a, b) ? SCM_BOOL_T : SCM_BOOL_F;
 }
 
 LY_DEFINE (ly_make_spring, "ly:make-spring",
index f823e099190bed0a82e9d96cf91fc144769c61b5..4b7eaa5a8a3e760e199f3270246e55a622a12bc8 100644 (file)
@@ -60,7 +60,7 @@ Stanza_number_engraver::process_music ()
   SCM stanza = get_property ("stanza");
 
   if (Text_interface::is_markup (stanza)
-      && stanza != last_stanza_)
+      && !scm_is_eq (stanza, last_stanza_))
     {
       last_stanza_ = stanza;
 
index 1f7a8d6fe3c270c1dccd0402cce7e74bc1b43567..e4e76e17d685154c2868ab75c2efd8d8feae5dbe 100644 (file)
@@ -74,8 +74,7 @@ Time_signature_engraver::process_music ()
     return;
 
   SCM fr = get_property ("timeSignatureFraction");
-  if (last_time_fraction_ != fr
-      && scm_is_pair (fr))
+  if (!scm_is_eq (last_time_fraction_, fr) && scm_is_pair (fr))
     {
       time_signature_ = make_item ("TimeSignature", time_cause_);
       time_signature_->set_property ("fraction", fr);