]> git.donarmstrong.com Git - lilypond.git/commitdiff
(scm_from_double): more compat glue.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 3 Sep 2004 23:54:16 +0000 (23:54 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 3 Sep 2004 23:54:16 +0000 (23:54 +0000)
43 files changed:
lily/align-interface.cc
lily/bar-line.cc
lily/beam-quanting.cc
lily/beam.cc
lily/book-paper-def.cc
lily/book.cc
lily/break-align-interface.cc
lily/coherent-ligature-engraver.cc
lily/dynamic-performer.cc
lily/font-select.cc
lily/font-size-engraver.cc
lily/gourlay-breaking.cc
lily/grob-scheme.cc
lily/grob.cc
lily/hairpin.cc
lily/include/lily-guile.hh
lily/lily-guile.cc
lily/lookup.cc
lily/mensural-ligature-engraver.cc
lily/modified-font-metric.cc
lily/note-collision.cc
lily/output-def.cc
lily/parser.yy
lily/score-engraver.cc
lily/score.cc
lily/self-aligment-interface.cc
lily/separation-item.cc
lily/side-position-interface.cc
lily/simple-spacer.cc
lily/slur-scoring.cc
lily/span-bar.cc
lily/staff-spacing.cc
lily/staff-symbol-referencer.cc
lily/staff-symbol.cc
lily/stem-tremolo.cc
lily/stem.cc
lily/stencil-scheme.cc
lily/system-start-delimiter-engraver.cc
lily/system-start-delimiter.cc
lily/text-spanner.cc
lily/tie.cc
lily/tuplet-bracket.cc
scm/page-layout.scm

index 952f012b5ef46866d35ddb8a052010ccb9eeb194..e11671ca51e9a6e2aa4c7c23643fa1be2960ee28 100644 (file)
@@ -218,7 +218,7 @@ Align_interface::align_elements_to_extents (Grob * me, Axis a)
        line-of-score.
        */
       if (ly_c_number_p (align))
-       center_offset = total.linear_combination (ly_scm2double (align));
+       center_offset = total.linear_combination (scm_to_double (align));
 
       for (int j = 0 ;  j < all_grobs.size (); j++)
        all_grobs[j]->translate_axis (all_translates[j] - center_offset, a);
index 832ab1af32b773d98b5830992f1708606770424c..56609b231f9e7b940d5aa27310c3d1d1fb3e2766 100644 (file)
@@ -196,7 +196,7 @@ Bar_line::get_staff_bar_size (SCM smob)
   Real ss = Staff_symbol_referencer::staff_space (me);
   SCM size = me->get_property ("bar-size");
   if (ly_c_number_p (size))
-    return scm_make_real (ly_scm2double (size)*ss);
+    return scm_make_real (scm_to_double (size)*ss);
   else if (Staff_symbol_referencer::get_staff_symbol (me))
     {
       /*
index 51ccb2e9424a6d524ea8c1ba7b0d73305838f831..c329bafcc505eb03dee17434b59f0383439cd000 100644 (file)
@@ -94,8 +94,8 @@ Beam::quanting (SCM smob)
   Grob *me = unsmob_grob (smob);
 
   SCM s = me->get_property ("positions");
-  Real yl = ly_scm2double (ly_car (s));
-  Real yr = ly_scm2double (ly_cdr (s));
+  Real yl = scm_to_double (ly_car (s));
+  Real yr = scm_to_double (ly_cdr (s));
 
 
   /*
@@ -108,7 +108,7 @@ Beam::quanting (SCM smob)
   Real slt = Staff_symbol_referencer::line_thickness (me) / ss;
 
   SCM sdy = me->get_property ("least-squares-dy");
-  Real dy_mus = ly_c_number_p (sdy) ? ly_scm2double (sdy) : 0.0;
+  Real dy_mus = ly_c_number_p (sdy) ? scm_to_double (sdy) : 0.0;
   
   Real straddle = 0.0;
   Real sit = (thickness - slt) / 2;
@@ -282,7 +282,7 @@ Beam::quanting (SCM smob)
   if (to_boolean (me->get_paper ()->lookup_variable (ly_symbol2scm ("debug-beam-quanting")))
       && ly_c_pair_p (inspect_quants))
     {
-      Drul_array<Real> ins = scm_to_interval (inspect_quants);
+      Drul_array<Real> ins = ly_scm2interval (inspect_quants);
 
       int i = 0;
 
index cad26f019018a6b4dab57fe6db8984590bb2d322..03f5206e04d5e3a9ab228672ef11bbbb3b44d746 100644 (file)
@@ -80,7 +80,7 @@ Beam::get_beam_translation (Grob *me)
   if (ly_c_procedure_p (func))
     {
       SCM s = scm_call_2 (func, me->self_scm (), scm_int2num (get_beam_count (me)));
-      return ly_scm2double (s);
+      return scm_to_double (s);
     }
   else
     {
@@ -455,7 +455,7 @@ Beam::print (SCM grob)
 
              SCM proc = me->get_property ("flag-width-function");
              SCM result = scm_call_1 (proc, scm_int2num (t));
-             nw_f = ly_scm2double (result);
+             nw_f = scm_to_double (result);
            }
          else
            nw_f = break_overshoot / 2;
@@ -667,7 +667,7 @@ Beam::consider_auto_knees (Grob* me)
   if (!ly_c_number_p (scm))
     return ;
 
-  Real threshold = ly_scm2double (scm);
+  Real threshold = scm_to_double (scm);
   
   Int_set gaps;
 
@@ -789,7 +789,7 @@ Beam::set_stem_shorten (Grob *me)
   
   SCM shorten_elt =
     robust_list_ref (beam_count -1, shorten_list);
-  Real shorten_f = ly_scm2double (shorten_elt) * staff_space;
+  Real shorten_f = scm_to_double (shorten_elt) * staff_space;
 
   /* your similar cute comment here */
   shorten_f *= forced_fraction;
@@ -992,7 +992,7 @@ Beam::shift_region_to_valid (SCM grob)
   
   Real dx = lvs->relative_coordinate (commonx, X_AXIS) - x0;
 
-  Drul_array<Real> pos = scm_to_interval ( me->get_property ("positions"));
+  Drul_array<Real> pos = ly_scm2interval ( me->get_property ("positions"));
 
   scale_drul (&pos,  Staff_symbol_referencer::staff_space (me));
   
@@ -1101,7 +1101,7 @@ Beam::check_concave (SCM smob)
   SCM gap = me->get_property ("concaveness-gap");
   if (ly_c_number_p (gap))
     {
-      Real r1 = ly_scm2double (gap);
+      Real r1 = scm_to_double (gap);
       Real dy = Stem::chord_start_y (stems.top ())
        - Stem::chord_start_y (stems[0]);
 
@@ -1138,7 +1138,7 @@ Beam::check_concave (SCM smob)
   Real r2 = infinity_f;
   if (!is_concave1 && ly_c_number_p (thresh))
     {
-      r2 = ly_scm2double (thresh);
+      r2 = scm_to_double (thresh);
       
       Interval iv;
       iv.add_point (Stem::chord_start_y (stems[0]));
@@ -1157,7 +1157,7 @@ Beam::check_concave (SCM smob)
   /* TODO: some sort of damping iso -> plain horizontal */
   if (is_concave1 || concaveness2 > r2)
     {
-      Drul_array<Real> pos = scm_to_interval (me->get_property ("positions"));
+      Drul_array<Real> pos = ly_scm2interval (me->get_property ("positions"));
       Real r = linear_combination (pos, 0.0);
 
       r /= Staff_symbol_referencer::staff_space (me);
@@ -1185,7 +1185,7 @@ Beam::slope_damping (SCM smob)
 
   if (damping)
     {
-      Drul_array<Real>  pos = scm_to_interval (me->get_property ("positions"));
+      Drul_array<Real>  pos = ly_scm2interval (me->get_property ("positions"));
       scale_drul (&pos,  Staff_symbol_referencer::staff_space (me));
       
       Real dy = pos[RIGHT] - pos[LEFT];
@@ -1471,7 +1471,7 @@ Beam::rest_collision_callback (SCM element_smob, SCM axis)
   Drul_array<Real> pos (0, 0);
   SCM s = beam->get_property ("positions");
   if (ly_c_pair_p (s) && ly_c_number_p (ly_car (s)))
-    pos = scm_to_interval (s);
+    pos = ly_scm2interval (s);
   Real staff_space = Staff_symbol_referencer::staff_space (rest);
 
   scale_drul (&pos, staff_space);
index d2ca7103f0a010c857567a3bd9cd34f948d1a4ff..baf444e9d1805b0ec6b4155f81240801e9d687a5 100644 (file)
@@ -16,7 +16,7 @@
 Real
 output_scale (Output_def *od)
 {
-  return ly_scm2double (od->lookup_variable (ly_symbol2scm ("outputscale")));
+  return scm_to_double (od->lookup_variable (ly_symbol2scm ("outputscale")));
 }
 
 /* TODO: should add nesting for Output_def here too. */
index 3e68631b289ee5b716a0e49660948912e90cf8d8..0eff1b511710ad0cdc2af80a39b9d7e0926c2f9d 100644 (file)
@@ -65,7 +65,7 @@ Paper_book *
 Book::process (String outname, Output_def *default_def)
 {
   Paper_book *paper_book = new Paper_book ();
-  Real scale = ly_scm2double (bookpaper_->c_variable ("outputscale"));
+  Real scale = scm_to_double (bookpaper_->c_variable ("outputscale"));
   
   Output_def * scaled_bookdef = scale_output_def (bookpaper_, scale);
 
index c4d429a008ea4f7104f33de831662d81a8b9bc40..c7ec2daabba69ba7cdbf595e4dc5ab7c9290fb1d 100644 (file)
@@ -223,7 +223,7 @@ Break_align_interface::do_alignment (Grob *grob)
        {
          entry = ly_cdr (entry);
          
-         distance = ly_scm2double (ly_cdr (entry));
+         distance = scm_to_double (ly_cdr (entry));
          type = ly_car (entry) ;
        }
 
index 05f9a96d3e50902f224ce9404b5a7dad61f3409c..1bc75b847a8a85663aab3346866c26fe46784fa0 100644 (file)
@@ -86,7 +86,7 @@
          Real distance;
          if (incr_scm != SCM_EOL)
            {
-             distance = ly_scm2double (incr_scm);
+             distance = scm_to_double (incr_scm);
            }
          else
            {
index 0cd1b49952b90b5fb39d185b6c22ee04da5e4735..7f6008cb798ce54a4390fc7b8fbb48541493093a 100644 (file)
@@ -63,9 +63,9 @@ Dynamic_performer::create_audio_elements ()
        {
          Interval iv (0, 1);
          if (ly_c_number_p (min))
-           iv[MIN] = ly_scm2double (min);
+           iv[MIN] = scm_to_double (min);
          if (ly_c_number_p (max))
-           iv[MAX] = ly_scm2double (max);
+           iv[MAX] = scm_to_double (max);
          volume = iv[MIN] + iv.length () * volume;
        }
       else
@@ -90,7 +90,7 @@ Dynamic_performer::create_audio_elements ()
 
          if (is_number_pair (s))
            {
-             Interval iv = scm_to_interval (s);
+             Interval iv = ly_scm2interval (s);
              volume = iv[MIN] + iv.length () * volume;
            }
        }
index 1e5134a24cb8144e9d796b93fbd359b6f28397be..df6e008684e68c7339309bbdf937c16d3b1f9ca6 100644 (file)
@@ -138,9 +138,9 @@ select_encoded_font (Output_def *paper, SCM chain, SCM input_encoding)
       SCM font_size = ly_assoc_chain (ly_symbol2scm ("font-size"), chain);
       Real req = 0;
       if (ly_c_pair_p (font_size))
-       req = ly_scm2double (ly_cdr (font_size));
+       req = scm_to_double (ly_cdr (font_size));
 
-      return get_font_by_mag_step (paper, req, vec, ly_scm2double (base_size),
+      return get_font_by_mag_step (paper, req, vec, scm_to_double (base_size),
                                   input_encoding);
     }
 
index 6c6bfa91d1bbc8d100f1fd119c752011cab8084b..edb728a5c5f448c3e7b79bff887de2de30614664 100644 (file)
@@ -36,9 +36,9 @@ Font_size_engraver::acknowledge_grob (Grob_info gi)
   if (gi.origin_trans_->context () != context ())
     return ;
   
-  if (ly_c_number_p (sz) && ly_scm2double (sz))
+  if (ly_c_number_p (sz) && scm_to_double (sz))
     {
-      Real font_size = ly_scm2double (sz);
+      Real font_size = scm_to_double (sz);
       
       font_size +=  robust_scm2double (gi.grob_->get_property ("font-size"), 0);
       gi.grob_->set_property ("font-size", scm_make_real (font_size));
index a8245fe7d7c1e8f54e18ee2e04feecf724718081..14b65f7fc98c3c03ed15ddb192475ed304a4476a 100644 (file)
@@ -237,9 +237,9 @@ Gourlay_breaking::combine_demerits (Column_x_positions const &prev,
   if (pc->original_)
     {
       SCM pen = pc->get_property ("penalty");
-      if (ly_c_number_p (pen) && fabs (ly_scm2double (pen)) < 10000)
+      if (ly_c_number_p (pen) && fabs (scm_to_double (pen)) < 10000)
        {
-         break_penalties += ly_scm2double (pen);
+         break_penalties += scm_to_double (pen);
        }
     }
 
index d05a56104613ff4ae78f73a00ed7b30220da9476..d1fd9c38f18612ab4abfb2345e73edb6a51dea55 100644 (file)
@@ -190,7 +190,7 @@ LY_DEFINE (ly_grob_translate_axis_x, "ly:grob-translate-axis!",
   SCM_ASSERT_TYPE (ly_c_number_p (d), d, SCM_ARG2, __FUNCTION__, "dimension");
   SCM_ASSERT_TYPE (is_axis (a), a, SCM_ARG3, __FUNCTION__, "axis");
 
-  me->translate_axis (ly_scm2double (d), Axis (scm_to_int (a)));
+  me->translate_axis (scm_to_double (d), Axis (scm_to_int (a)));
   return SCM_UNSPECIFIED;
 }
 
index baefcc77d1864587b10c141d672265cc9c52cfec..d66dccb9607a3269fb8b6fdc7865f3f9260bc6c4 100644 (file)
@@ -373,7 +373,7 @@ Grob::get_offset (Axis a) const
       SCM cb = scm_list_ref (dim_cache_[a].offset_callbacks_, scm_int2num (l));
       SCM retval = scm_call_2 (cb, self_scm (), scm_int2num (a));
 
-      Real r =  ly_scm2double (retval);
+      Real r =  scm_to_double (retval);
       if (isinf (r) || isnan (r))
        {
          programming_error (INFINITY_MSG);
@@ -409,7 +409,7 @@ Grob::extent (Grob *refp, Axis a) const
   if (!ly_c_pair_p (d->dimension_))
     return ext;
 
-  ext = scm_to_interval (d->dimension_);
+  ext = ly_scm2interval (d->dimension_);
 
   SCM extra = get_property (a == X_AXIS
                            ? "extra-X-extent"
@@ -418,16 +418,16 @@ Grob::extent (Grob *refp, Axis a) const
   /* Signs ?  */
   if (ly_c_pair_p (extra))
     {
-      ext[BIGGER] += ly_scm2double (ly_cdr (extra));
-      ext[SMALLER] += ly_scm2double (ly_car (extra));
+      ext[BIGGER] += scm_to_double (ly_cdr (extra));
+      ext[SMALLER] += scm_to_double (ly_car (extra));
     }
 
   extra = get_property (a == X_AXIS
                        ? "minimum-X-extent"
                        : "minimum-Y-extent");
   if (ly_c_pair_p (extra))
-    ext.unite (Interval (ly_scm2double (ly_car (extra)),
-                        ly_scm2double (ly_cdr (extra))));
+    ext.unite (Interval (scm_to_double (ly_car (extra)),
+                        scm_to_double (ly_cdr (extra))));
 
   ext.translate (x);
 
index d5c17d720949a9182aa911a93d00563e52bece48..799616bf1495cdba098a643a8f25fb8d7588b7aa 100644 (file)
@@ -35,7 +35,7 @@ Hairpin::print (SCM smob)
   
   Direction grow_dir = to_dir (s);
 
-  Real padding = ly_scm2double (me->get_property ("bound-padding"));
+  Real padding = scm_to_double (me->get_property ("bound-padding"));
  
   Drul_array<bool> broken;
   Drul_array<Item*> bounds ;
index 7004c02605109ece6caa84fb13c091124f2ee37d..40f5339a7a38c65d22c02b94eaa0a37f4ca000ee 100644 (file)
@@ -1,4 +1,4 @@
-/*
+ii/*
   lily-guile.hh encapsulate guile
 
   source file of the GNU LilyPond music typesetter
 #define scm_i_string_chars(x) SCM_STRING_CHARS(x)
 #define scm_i_string_length(x) SCM_STRING_LENGTH(x)
 #define scm_is_number(x) (scm_number_p(x)==SCM_BOOL_T)
+inline int ly_scm2int (SCM x) { return scm_num2int (x, 0, "ly_scm2int"); }
 #define scm_to_int(x) (ly_scm2int(x))
+
+inline double ly_scm2double (SCM x) { return scm_num2dbl (x, "ly_scm2double"); }
 #define scm_to_double(x) (ly_scm2double(x))
 #define scm_from_double(x) (scm_make_real(x))
 #endif /* SCM_MINOR_VERSION < 7 */
@@ -164,8 +167,6 @@ inline bool ly_c_equal_p (SCM x, SCM y) {
 
 inline bool ly_scm2bool (SCM x) { return SCM_NFALSEP (x); }
 inline char ly_scm2char (SCM x) { return SCM_CHAR(x); }
-inline int ly_scm2int (SCM x) { return scm_num2int (x, 0, "ly_scm2int"); }
-inline double ly_scm2double (SCM x) { return scm_num2dbl (x, "ly_scm2double"); }
 inline unsigned long ly_length (SCM x) {
   return scm_num2ulong (scm_length (x), 0, "ly_length");
 }
index bda59bf2913ed5b4d83eb5f68b8b34385fb9139b..67ab65e028e1090accebf5dedbdcdcd69d4ea1df 100644 (file)
@@ -283,16 +283,16 @@ to_dir (SCM s)
 }
 
 Interval
-scm_to_interval (SCM p)
+ly_scm2interval (SCM p)
 {
-  return Interval (ly_scm2double (ly_car (p)), ly_scm2double (ly_cdr (p)));
+  return Interval (scm_to_double (ly_car (p)), scm_to_double (ly_cdr (p)));
 }
 
 Drul_array<Real>
 ly_scm2realdrul (SCM p)
 {
-  return Drul_array<Real> (ly_scm2double (ly_car (p)),
-                          ly_scm2double (ly_cdr (p)));
+  return Drul_array<Real> (scm_to_double (ly_car (p)),
+                          scm_to_double (ly_cdr (p)));
 }
 
 SCM
@@ -336,8 +336,8 @@ ly_offset2scm (Offset o)
 Offset
 ly_scm2offset (SCM s)
 {
-  return Offset (ly_scm2double (ly_car (s)),
-                ly_scm2double (ly_cdr (s)));
+  return Offset (scm_to_double (ly_car (s)),
+                scm_to_double (ly_cdr (s)));
 }
 
 LY_DEFINE (ly_number2string, "ly:number->string",
@@ -350,7 +350,7 @@ LY_DEFINE (ly_number2string, "ly:number->string",
 
   if (scm_exact_p (s) == SCM_BOOL_F)
     {
-      Real r (ly_scm2double (s));
+      Real r (scm_to_double (s));
 
       if (my_isinf (r) || my_isnan (r))
        {
@@ -730,7 +730,7 @@ Real
 robust_scm2double (SCM k, double x)
 {
   if (ly_c_number_p (k))
-    x = ly_scm2double (k);
+    x = scm_to_double (k);
   return x;
 }
 
@@ -741,7 +741,7 @@ robust_scm2interval (SCM k, Drul_array<Real> v)
   i[LEFT]= v[LEFT];
   i[RIGHT]= v[RIGHT];
   if (is_number_pair (k))
-    i = scm_to_interval (k);
+    i = ly_scm2interval (k);
   return i;
 }
 
@@ -749,7 +749,7 @@ Drul_array<Real>
 robust_scm2drul (SCM k, Drul_array<Real> v)
 {
   if (is_number_pair (k))
-    v = scm_to_interval (k);
+    v = ly_scm2interval (k);
   return v;
 }
 
index bb622cb97f2175b472d47814a001870aa06a56c2..8d5c22acffee92734563396b669400a3f3356862 100644 (file)
@@ -712,10 +712,10 @@ LY_DEFINE (ly_bracket ,"ly:bracket",
   SCM_ASSERT_TYPE (ly_c_number_p (p), a, SCM_ARG4, __FUNCTION__, "number") ;
 
 
-  return Lookup::bracket ((Axis)scm_to_int (a), scm_to_interval (iv),
-                         ly_scm2double (t),
-                         ly_scm2double (p),
-                         0.95 * ly_scm2double (t)).smobbed_copy ();
+  return Lookup::bracket ((Axis)scm_to_int (a), ly_scm2interval (iv),
+                         scm_to_double (t),
+                         scm_to_double (p),
+                         0.95 * scm_to_double (t)).smobbed_copy ();
 }
 
 
@@ -732,7 +732,7 @@ LY_DEFINE (ly_filled_box ,"ly:round-filled-box",
   SCM_ASSERT_TYPE (is_number_pair (yext), yext, SCM_ARG2, __FUNCTION__, "number pair") ;
   SCM_ASSERT_TYPE (ly_c_number_p (blot), blot, SCM_ARG3, __FUNCTION__, "number") ;
 
-  return Lookup::round_filled_box (Box (scm_to_interval (xext), scm_to_interval (yext)),
-                                  ly_scm2double (blot)).smobbed_copy ();
+  return Lookup::round_filled_box (Box (ly_scm2interval (xext), ly_scm2interval (yext)),
+                                  scm_to_double (blot)).smobbed_copy ();
 }
 
index 518948ebe340f83e20034b2429ee0dfa4110622c..da419df21f209392afc633fca93388dda10accff 100644 (file)
@@ -407,8 +407,8 @@ Mensural_ligature_engraver::fold_up_primitives (Array<Grob_info> primitives)
        }
 
       distance +=
-       ly_scm2double (current->get_property ("head-width")) -
-       ly_scm2double (current->get_property ("thickness"));
+       scm_to_double (current->get_property ("head-width")) -
+       scm_to_double (current->get_property ("thickness"));
     }
 }
 
index 6bb485fa96e236d0ffb1aea2517781a6c3df4fb4..a28c1bd37231f0333e3644016cb1b71e23b1a627 100644 (file)
@@ -34,7 +34,7 @@ Modified_font_metric::Modified_font_metric (String input_encoding,
   
   SCM desc = m->description_;
 
-  Real total_mag = magn * ly_scm2double (ly_cdr (desc));
+  Real total_mag = magn * scm_to_double (ly_cdr (desc));
   assert (total_mag);
   
   description_ = scm_cons (ly_car (desc), scm_make_real (total_mag));
index 51bf6d13ee13766a055e343ea577cbc2278fed79..ae6f74cd9c3dfdc655849ebbd3bdf243cec82600 100644 (file)
@@ -321,7 +321,7 @@ Note_collision_interface::do_shifts (Grob* me)
   for (; ly_c_pair_p (hand); hand =ly_cdr (hand))
     {
       Grob * s = unsmob_grob (ly_caar (hand));
-      Real amount = ly_scm2double (ly_cdar (hand)) * wid;
+      Real amount = scm_to_double (ly_cdar (hand)) * wid;
 
       done.push (s);
       amounts.push (amount);
@@ -332,7 +332,7 @@ Note_collision_interface::do_shifts (Grob* me)
   for (; ly_c_pair_p (autos); autos =ly_cdr (autos))
     {
       Grob * s = unsmob_grob (ly_caar (autos));
-      Real amount = ly_scm2double (ly_cdar (autos)) *wid;
+      Real amount = scm_to_double (ly_cdar (autos)) *wid;
       
       if (!done.find (s))
        {
index 1895daa6606929c70620e2ea7cc8a0864e99a391..2bf1ea1d2b02a763b645cc6250bedd23f423ae4a 100644 (file)
@@ -103,7 +103,7 @@ Real
 Output_def::get_dimension (SCM s) const
 {
   SCM val = lookup_variable (s);
-  return ly_scm2double (val);
+  return scm_to_double (val);
 }
 
 SCM
index df8b34a62c364f2c3fe641409906d61704208291..7d2db4160521d47be15f1e4a288c7e113fcc802c 100644 (file)
@@ -2374,10 +2374,10 @@ bare_number:
                $$ = $1;
        }
        | REAL NUMBER_IDENTIFIER        {
-               $$ = scm_make_real (ly_scm2double ($1) *ly_scm2double ($2));
+               $$ = scm_make_real (scm_to_double ($1) *scm_to_double ($2));
        }
        | UNSIGNED NUMBER_IDENTIFIER    {
-               $$ = scm_make_real ($1 *ly_scm2double ($2));
+               $$ = scm_make_real ($1 *scm_to_double ($2));
        }
        ;
 
index 881ff8958f68593f96a823e9d3264428418dfd47..2227ee00ac0b17d014e7fc11940169ec54bfe6d0 100644 (file)
@@ -245,11 +245,11 @@ Score_engraver::try_music (Music *m)
   if (m->is_mus_type ("break-event"))
     {
       SCM pen = command_column_->get_property ("penalty");
-      Real total_penalty = ly_c_number_p (pen) ? ly_scm2double (pen) : 0.0;
+      Real total_penalty = ly_c_number_p (pen) ? scm_to_double (pen) : 0.0;
 
       SCM mpen = m->get_property ("penalty");
       if (ly_c_number_p (mpen))
-       total_penalty += ly_scm2double (mpen);
+       total_penalty += scm_to_double (mpen);
 
       command_column_->set_property ("penalty", scm_make_real (total_penalty));
 
@@ -258,10 +258,10 @@ Score_engraver::try_music (Music *m)
        forbid_breaks ();
 
       SCM page_pen = command_column_->get_property ("page-penalty");
-      Real total_pp = ly_c_number_p (page_pen) ? ly_scm2double (page_pen) : 0.0;
+      Real total_pp = ly_c_number_p (page_pen) ? scm_to_double (page_pen) : 0.0;
       SCM mpage_pen = m->get_property ("page-penalty");
       if (ly_c_number_p (mpage_pen))
-       total_pp += ly_scm2double (mpage_pen);
+       total_pp += scm_to_double (mpage_pen);
       
       command_column_->set_property ("page-penalty", scm_make_real (total_pp));
       return true;
index 774cdba07c17c89d601044abb41348f5d549c766..2dadb3f7f4eaf11b19c15b1888a345be4a0c4afa 100644 (file)
@@ -167,7 +167,7 @@ default_rendering (SCM music, SCM outdef,
   /* ugh.  */
   if (bpd->c_variable ("is-bookpaper") == SCM_BOOL_T)
     {
-      Real scale = ly_scm2double (bpd->c_variable ("outputscale"));
+      Real scale = scm_to_double (bpd->c_variable ("outputscale"));
       
       Output_def *def = scale_output_def (unsmob_output_def (outdef), scale);
       scaled_def = def->self_scm ();
@@ -225,7 +225,7 @@ Score::book_rendering (String outname,
   Real scale = 1.0;
 
   if (paperbook && paperbook->c_variable ("is-bookpaper") == SCM_BOOL_T)
-    scale = ly_scm2double (paperbook->c_variable ("outputscale"));
+    scale = scm_to_double (paperbook->c_variable ("outputscale"));
   
   SCM out = scm_makfrom0str (outname.to_str0 ());
   SCM systems = SCM_EOL;
index badd4899a9e0ea94d8e5bb049d2d4a5b249ed9e5..17e53b9b6306565714aa49418a1899a42368dd9a 100644 (file)
@@ -39,7 +39,7 @@ Self_alignment_interface::aligned_on_parent (SCM element_smob, SCM axis)
     return scm_int2num (0);
 
   Real x = 0.0;
-  Real align = ly_scm2double (align_prop);
+  Real align = scm_to_double (align_prop);
       
   Interval ext (me->extent (me, a));
   if (ext.is_empty ())
@@ -86,7 +86,7 @@ Self_alignment_interface::aligned_on_self (SCM element_smob, SCM axis)
       if (ext.is_empty ())
        programming_error ("I'm empty. Can't align on self");
       else
-       return scm_make_real (- ext.linear_combination (ly_scm2double (align)));
+       return scm_make_real (- ext.linear_combination (scm_to_double (align)));
     }
   return scm_make_real (0.0);
 }
index 0fc3075d459312b7070e3d496362293b5df43684..4a308146e1c98ae6aff83b53283c847cab508475 100644 (file)
@@ -77,7 +77,7 @@ Separation_item::width (Grob *me)
   SCM sw = me->get_property ("X-extent");
   if (is_number_pair (sw))
     {
-      return scm_to_interval (sw);
+      return ly_scm2interval (sw);
     }
 
   Item *item = dynamic_cast<Item*> (me);
index 7c0596e98557311ffc92afb0b63a36b3095dabdb..a65d8f25fa37ec70ff11a30e548c875747bc84c6 100644 (file)
@@ -201,7 +201,7 @@ Side_position_interface::aligned_side (SCM element_smob, SCM axis)
   
   Direction d = Side_position_interface::get_direction (me);
   
-  Real o = ly_scm2double (aligned_on_support_extents (element_smob,axis));
+  Real o = scm_to_double (aligned_on_support_extents (element_smob,axis));
 
   Interval iv =  me->extent (me, a);
 
@@ -226,7 +226,7 @@ Side_position_interface::aligned_side (SCM element_smob, SCM axis)
     {
       Real padding=
       Staff_symbol_referencer::staff_space (me)
-      * ly_scm2double (me->get_property ("staff-padding"));
+      * scm_to_double (me->get_property ("staff-padding"));
   
       Grob *common = me->common_refpoint (st, Y_AXIS);
       
index a7fd8a7680a141835c51ad8a10167a4e12f19112..8261f702fa12d12bc286740f186f362d5909a14e 100644 (file)
@@ -414,9 +414,9 @@ Simple_spacer_wrapper::solve (Column_x_positions *positions, bool ragged)
       SCM p = positions->cols_[i]->get_property ( "penalty");
       if (ly_c_number_p (p))
        {
-         if (ly_scm2double (p) < -9999)
+         if (scm_to_double (p) < -9999)
            break_satisfy = break_satisfy && (i == 0 || i == sz -1);
-         if (ly_scm2double (p) > 9999)
+         if (scm_to_double (p) > 9999)
            break_satisfy = break_satisfy && !(i == 0 || i == sz -1);
        }
       
@@ -505,7 +505,7 @@ Simple_spacer_wrapper::add_columns (Link_array<Grob> const &icols)
          int oi = cols.find_index (other);
          if (oi >= 0)
            {
-             spacer_->add_rod (i, oi, ly_scm2double (ly_cdar (s)));
+             spacer_->add_rod (i, oi, scm_to_double (ly_cdar (s)));
            }
        }
     }
index 2223b372bbfb09a2f0d4cededa4e15d8328e070a..0db9b834a3b60b893efa402a95cfc41afb9fe108 100644 (file)
@@ -489,7 +489,7 @@ set_end_points (Grob *me)
                  ->lookup_variable (ly_symbol2scm ("debug-slur-quanting")))
       && ly_c_pair_p (inspect_quants))
     {
-      Drul_array<Real> ins = scm_to_interval (inspect_quants);
+      Drul_array<Real> ins = ly_scm2interval (inspect_quants);
       Real mindist = 1e6;
       for (int i = 0; i < scores.size (); i ++)
        {
@@ -651,7 +651,7 @@ generate_curves (Grob *me, Grob **common,
   (void) extremes;
   Real staff_space = Staff_symbol_referencer::staff_space ((Grob *) me);
   Real r_0 = robust_scm2double (me->get_property ("ratio"), 0.33);
-  Real h_inf = staff_space * ly_scm2double (me->get_property ("height-limit"));
+  Real h_inf = staff_space * scm_to_double (me->get_property ("height-limit"));
   for (int i = 0; i < scores->size(); i++)
     {
       Bezier bez= get_bezier (me, 
index 7bd2df59c7529058d8e33f99cdc9f25434149b19..869c1d1681bc9486f5ba5ce49308250443a277d3 100644 (file)
@@ -218,7 +218,7 @@ Span_bar::evaluate_glyph (Grob*me)
 Interval
 Span_bar::get_spanned_interval (Grob*me) 
 {
-  return scm_to_interval (Axis_group_interface::group_extent_callback
+  return ly_scm2interval (Axis_group_interface::group_extent_callback
                          (me->self_scm (), scm_int2num (Y_AXIS))); 
 }
 
index c8684e791a131b3c1fd70dfab9660fb6febaa8be..4e0e0497cfbe1a1008eb194684627ade2283ddee 100644 (file)
@@ -209,7 +209,7 @@ Staff_spacing::get_spacing_params (Grob *me, Real * space, Real * fixed)
     }
 
   space_def = ly_cdr (space_def);
-  Real distance = ly_scm2double (ly_cdr (space_def));
+  Real distance = scm_to_double (ly_cdr (space_def));
   SCM type = ly_car (space_def) ;
 
   *fixed = last_ext[RIGHT];
index 9fbe6f8b4387c9f8838f4bcea2006447d9d9bd54..b7a42e1aaee719adfd5f48aad15a53201a984957 100644 (file)
@@ -121,7 +121,7 @@ Staff_symbol_referencer::callback (SCM element_smob, SCM)
   if (ly_c_number_p (pos))
     {
       Real space = Staff_symbol_referencer::staff_space (me);
-      off = ly_scm2double (pos) * space / 2.0;
+      off = scm_to_double (pos) * space / 2.0;
       me->set_property ("staff-position", scm_int2num (0));
     }
 
index 7a74c25bbf3c3193ccc5e55fd025c7d6e906bcd9..9526e36dd88eca9c1ddadcfac44e91ad9e7b500b 100644 (file)
@@ -52,7 +52,7 @@ Staff_symbol::print (SCM smob)
            since that would make aligning staff symbols of different sizes to
            one right margin hell.
          */      
-         span_points[RIGHT] = ly_scm2double (width_scm);
+         span_points[RIGHT] = scm_to_double (width_scm);
        }
       else
        {
index 008bd90094d46c4e40ff3929ef7fecfb22249534..508a37f8f5bfaf4acb16cadce788565664a6c82a 100644 (file)
@@ -59,7 +59,7 @@ Stem_tremolo::raw_stencil (Grob *me)
       Real dy = 0;
       SCM s = beam->get_property ("positions");
       if (is_number_pair (s))
-       dy = -ly_scm2double (ly_car (s)) +ly_scm2double (ly_cdr (s));
+       dy = -scm_to_double (ly_car (s)) +scm_to_double (ly_cdr (s));
       
       Real dx = Beam::last_visible_stem (beam)->relative_coordinate (0, X_AXIS)
        - Beam::first_visible_stem (beam)->relative_coordinate (0, X_AXIS);
@@ -138,7 +138,7 @@ Stem_tremolo::print (SCM grob)
   Real beamthickness = 0.0;
   SCM sbt = (beam) ? beam->get_property ("thickness") : SCM_EOL ;
   if (ly_c_number_p (sbt))
-    beamthickness = ly_scm2double (sbt) * ss;
+    beamthickness = scm_to_double (sbt) * ss;
 
   Real end_y
     = Stem::stem_end_position (stem) * ss / 2
index 966d036151cd5e7a33fa597fff1da2261df1c06e..c83c7a7b370c1a80d8eaaade74d4b79112bbed8f 100644 (file)
@@ -97,7 +97,7 @@ Stem::stem_end_position (Grob *me)
       me->set_property ("stem-end-position", scm_make_real (pos));
     }
   else
-    pos = ly_scm2double (p);
+    pos = scm_to_double (p);
 
   return pos;
 }
@@ -272,12 +272,12 @@ Stem::get_default_stem_end_position (Grob *me)
   Real length = 7;
   SCM scm_len = me->get_property ("length");
   if (ly_c_number_p (scm_len))
-    length = ly_scm2double (scm_len);
+    length = scm_to_double (scm_len);
   else
     {
       s = me->get_property ("lengths");
       if (ly_c_pair_p (s))
-       length = 2 * ly_scm2double (robust_list_ref (durlog - 2, s));
+       length = 2 * scm_to_double (robust_list_ref (durlog - 2, s));
     }
 
   /* URGURGURG
@@ -622,7 +622,7 @@ Stem::dim_callback (SCM e, SCM ax)
 Real
 Stem::thickness (Grob *me)
 {
-  return ly_scm2double (me->get_property ("thickness"))
+  return scm_to_double (me->get_property ("thickness"))
     * Staff_symbol_referencer::line_thickness (me);
 }
 
@@ -743,8 +743,8 @@ Stem::get_stem_info (Grob *me)
 
   Stem_info si;
   si.dir_ = get_grob_direction (me);
-  si.ideal_y_ = ly_scm2double (ly_car (scm_info));
-  si.shortest_y_ = ly_scm2double (ly_cadr (scm_info));
+  si.ideal_y_ = scm_to_double (ly_car (scm_info));
+  si.shortest_y_ = scm_to_double (ly_cadr (scm_info));
   return si;
 }
 
@@ -771,7 +771,7 @@ Stem::calc_stem_info (Grob *me)
   /* Simple standard stem length */
   SCM lengths = me->get_property ("beamed-lengths");
   Real ideal_length =
-    ly_scm2double (robust_list_ref (beam_count - 1,lengths))
+    scm_to_double (robust_list_ref (beam_count - 1,lengths))
                
     * staff_space
     /* stem only extends to center of beam
@@ -782,7 +782,7 @@ Stem::calc_stem_info (Grob *me)
   /* Condition: sane minimum free stem length (chord to beams) */
   lengths = me->get_property ("beamed-minimum-free-lengths");
   Real ideal_minimum_free =
-    ly_scm2double (robust_list_ref (beam_count - 1, lengths))
+    scm_to_double (robust_list_ref (beam_count - 1, lengths))
     * staff_space;
 
 
@@ -842,7 +842,7 @@ Stem::calc_stem_info (Grob *me)
   ideal_y -= robust_scm2double (beam->get_property ("shorten"), 0);
 
   Real minimum_free =
-    ly_scm2double (robust_list_ref
+    scm_to_double (robust_list_ref
                   (beam_count - 1,
                    me->get_property
                    ("beamed-extreme-minimum-free-lengths")))
index 4a34f130258627c824227627c7bcd667491b8d43..09f317fd0885a1cdfaa11e438ce24566c78ad601 100644 (file)
@@ -27,7 +27,7 @@ LY_DEFINE (ly_stencil_set_extent_x, "ly:stencil-set-extent!",
   SCM_ASSERT_TYPE (is_number_pair (np), np, SCM_ARG3, __FUNCTION__,
                   "number pair");
 
-  Interval iv = scm_to_interval (np);
+  Interval iv = ly_scm2interval (np);
   s->dim_[Axis (scm_to_int (axis))] = iv;
 
   return SCM_UNSPECIFIED;
@@ -44,7 +44,7 @@ LY_DEFINE (ly_translate_stencil_axis, "ly:stencil-translate-axis",
 
   SCM new_s = s->smobbed_copy ();
   Stencil *q = unsmob_stencil (new_s);
-  q->translate_axis (ly_scm2double (amount), Axis (scm_to_int (axis)));
+  q->translate_axis (scm_to_double (amount), Axis (scm_to_int (axis)));
   return new_s;
 
 }
@@ -106,13 +106,13 @@ LY_DEFINE (ly_stencil_moved_to_edge, "ly:stencil-moved-to-edge",
   if (padding != SCM_UNDEFINED)
     {
       SCM_ASSERT_TYPE (ly_c_number_p (padding), padding, SCM_ARG5, __FUNCTION__, "number");
-      p = ly_scm2double (padding);
+      p = scm_to_double (padding);
     }
   Real m = 0.0;
   if (minimum != SCM_UNDEFINED)
     {
       SCM_ASSERT_TYPE (ly_c_number_p (minimum), minimum, SCM_ARG6, __FUNCTION__, "number");
-      m = ly_scm2double (minimum);
+      m = scm_to_double (minimum);
     }
 
   if (s1)
@@ -156,13 +156,13 @@ LY_DEFINE (ly_stencil_combine_at_edge, "ly:stencil-combine-at-edge",
   if (padding != SCM_UNDEFINED)
     {
       SCM_ASSERT_TYPE (ly_c_number_p (padding), padding, SCM_ARG5, __FUNCTION__, "number");
-      p = ly_scm2double (padding);
+      p = scm_to_double (padding);
     }
   Real m = 0.0;
   if (minimum != SCM_UNDEFINED)
     {
       SCM_ASSERT_TYPE (ly_c_number_p (minimum), minimum, SCM_ARG6, __FUNCTION__, "number");
-      m = ly_scm2double (minimum);
+      m = scm_to_double (minimum);
     }
 
   if (s1)
@@ -210,7 +210,7 @@ LY_DEFINE (ly_make_stencil, "ly:make-stencil",
   SCM_ASSERT_TYPE (is_number_pair (xext), xext, SCM_ARG2, __FUNCTION__, "number pair");
   SCM_ASSERT_TYPE (is_number_pair (yext), yext, SCM_ARG3, __FUNCTION__, "number pair");
 
-  Box b (scm_to_interval (xext), scm_to_interval (yext));
+  Box b (ly_scm2interval (xext), ly_scm2interval (yext));
   Stencil s (b, expr);
   return s.smobbed_copy ();
 }
@@ -227,6 +227,6 @@ LY_DEFINE (ly_stencil_align_to_x, "ly:stencil-align-to!",
   SCM_ASSERT_TYPE (ly_c_number_p (dir), dir, SCM_ARG3, __FUNCTION__, "number");
 
   unsmob_stencil (stil)->align_to ((Axis)scm_to_int (axis),
-                                  ly_scm2double (dir));
+                                  scm_to_double (dir));
   return stil;
 }
index 158d201330ce1d4db9718406374f30e3aa054c67..3aeb41b1304ca74462c1a80fc75a937fffca4d74 100644 (file)
@@ -56,7 +56,7 @@ System_start_delimiter_engraver::acknowledge_grob (Grob_info inf)
        {
          inf.grob_->translate_axis ( -0.8, X_AXIS); // ugh
          inf.grob_->set_property ("arch-height",
-                                      scm_make_real (ly_scm2double (inf.grob_->get_property
+                                      scm_make_real (scm_to_double (inf.grob_->get_property
                                        ("arch-height"))+0.5));
        }
     }
index 2aa3da9d4cbf751da326625bd4d4619fe310319b..0127310b01895df300449672a7a45b6ffc0bfb4f 100644 (file)
@@ -22,7 +22,7 @@
 Stencil
 System_start_delimiter::staff_bracket (Grob*me,Real height)  
 {
-  Real arc_height = ly_scm2double (me->get_property ("arch-height")) ;
+  Real arc_height = scm_to_double (me->get_property ("arch-height")) ;
   
   SCM at = scm_list_n (ly_symbol2scm ("bracket"),
                    me->get_property ("arch-angle"),
index dea9d39d3ec90a8232d0ee6d069127806be6039d..5e43a0880b92ed85a7b3a679f7961bfd28df8a85 100644 (file)
@@ -71,11 +71,11 @@ Text_spanner::print (SCM smob)
              robust_relative_extent (b, common, X_AXIS).linear_combination (d * encl);
 
            if (is_number_pair (shorten))
-             span_points -= d * ly_scm2double (index_get_cell (shorten, d));
+             span_points -= d * scm_to_double (index_get_cell (shorten, d));
          }
       
       if (is_number_pair (flare))
-       span_points -= d * ly_scm2double (index_get_cell (flare, d));
+       span_points -= d * scm_to_double (index_get_cell (flare, d));
     }
   while (flip (&d) != LEFT);
 
@@ -115,7 +115,7 @@ Text_spanner::print (SCM smob)
          
          Real dx = 0.0;
          if (is_number_pair (flare))
-           dx = ly_scm2double (index_get_cell (flare, d)) * d;
+           dx = scm_to_double (index_get_cell (flare, d)) * d;
 
          Real dy = - dir * edge_height[d] ;
          if (dy)
index 2690f4920bae7b013de630836946ae396c553ffc..1f4d4a58b0fed6f8b424323eb3fd7ec4bc650851 100644 (file)
@@ -206,8 +206,8 @@ Tie::get_control_points (SCM smob)
   SCM lim // groetjes aan de chirurgendochter.
     = scm_assq (ly_symbol2scm ("height-limit"),details);
   
-  Real h_inf = ly_scm2double (ly_cdr (lim)) *  staff_space;
-  Real r_0 = ly_scm2double (ly_cdr (scm_assq (ly_symbol2scm ("ratio"),details)));
+  Real h_inf = scm_to_double (ly_cdr (lim)) *  staff_space;
+  Real r_0 = scm_to_double (ly_cdr (scm_assq (ly_symbol2scm ("ratio"),details)));
 
   Bezier b  = slur_shape (width, h_inf, r_0);
   
@@ -220,7 +220,7 @@ Tie::get_control_points (SCM smob)
   */
 
   Real ypos = Tie::get_position (me) * staff_space/2
-    + dir * ly_scm2double (me->get_property ("y-offset"));;
+    + dir * scm_to_double (me->get_property ("y-offset"));;
 
   /*
     Make sure we don't start on a dots
@@ -268,7 +268,7 @@ Tie::get_control_points (SCM smob)
       Real diff = ry - y;
       Real newy = y;
 
-      Real clear = staff_space * ly_scm2double (me->get_property ("staffline-clearance"));
+      Real clear = staff_space * scm_to_double (me->get_property ("staffline-clearance"));
 
       if (fabs (y) <=
          Staff_symbol_referencer::staff_radius (me) * staff_space + clear
index 8e2aa1b249761537c30ab3b2472ce803fe4eccfe..ecf3c725984915df366af5b5c4fee2de95554d93 100644 (file)
@@ -213,11 +213,11 @@ Tuplet_bracket::print (SCM smob)
       do {
        flare[d] =  height[d] = shorten[d] = 0.0;
        if (is_number_pair (fl))
-         flare[d] +=  ss * ly_scm2double (index_get_cell (fl, d));
+         flare[d] +=  ss * scm_to_double (index_get_cell (fl, d));
        if (is_number_pair (eh))
-         height[d] +=  - dir * ss *ly_scm2double (index_get_cell (eh, d));
+         height[d] +=  - dir * ss *scm_to_double (index_get_cell (eh, d));
        if (is_number_pair (sp))
-         shorten[d] +=  ss *ly_scm2double (index_get_cell (sp, d));
+         shorten[d] +=  ss *scm_to_double (index_get_cell (sp, d));
       }
       while (flip (&d) != LEFT);
       
@@ -383,7 +383,7 @@ Tuplet_bracket::calc_position_and_height (Grob*me,Real *offset, Real * dy)
     }
 
   // padding
-  *offset +=  ly_scm2double (me->get_property ("padding")) *dir;
+  *offset +=  scm_to_double (me->get_property ("padding")) *dir;
 
   
   /*
@@ -473,13 +473,13 @@ Tuplet_bracket::after_line_breaking (SCM smob)
     {
       SCM ps =  par_beam->get_property ("positions"); 
 
-      Real lp = ly_scm2double (ly_car (ps));
-      Real rp = ly_scm2double (ly_cdr (ps));
+      Real lp = scm_to_double (ly_car (ps));
+      Real rp = scm_to_double (ly_cdr (ps));
 
       /*
        duh. magic.
 <       */
-      offset = lp + dir * (0.5 + ly_scm2double (me->get_property ("padding")));
+      offset = lp + dir * (0.5 + scm_to_double (me->get_property ("padding")));
       dy = rp- lp;
     }
   
@@ -489,11 +489,11 @@ Tuplet_bracket::after_line_breaking (SCM smob)
   
   if (ly_c_number_p (lp) && !ly_c_number_p (rp))
     {
-      rp = scm_make_real (ly_scm2double (lp) + dy);
+      rp = scm_make_real (scm_to_double (lp) + dy);
     }
   else if (ly_c_number_p (rp) && !ly_c_number_p (lp))
     {
-      lp = scm_make_real (ly_scm2double (rp) - dy);
+      lp = scm_make_real (scm_to_double (rp) - dy);
     }
   else if (!ly_c_number_p (rp) && !ly_c_number_p (lp))
     {
index 65f15c78e4b1396b867d4b4bc8051c984d5e10f4..35876065618054dd18497d99a46cc6c77111f06b 100644 (file)
@@ -213,6 +213,7 @@ of lines. "
   (define (get-path node done)
     "Follow NODE.PREV, and return as an ascending list of pages. DONE
 is what have collected so far, and has ascending page numbers."
+    
     (if (is-a? node <optimally-broken-page-node>)
        (get-path (node-prev node) (cons node done))
        done))
@@ -368,7 +369,7 @@ CURRENT-BEST is the best result sofar, or #f."
                           #:penalty total-penalty)
                          current-best)))
       
-      (if #t ;; debug
+      (if #f ;; debug
           (display
            (list
             "\nuser pen " user-penalty