]> git.donarmstrong.com Git - lilypond.git/commitdiff
*** empty log message ***
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 27 Jan 2005 22:55:06 +0000 (22:55 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 27 Jan 2005 22:55:06 +0000 (22:55 +0000)
12 files changed:
ChangeLog
input/twinkle-pop.ly
lily/break-substitution.cc
lily/font-select.cc
lily/include/guile-compatibility.hh
lily/lily-guile.cc
lily/note-heads-engraver.cc
lily/quote-iterator.cc
lily/scm-hash.cc
lily/stencil-scheme.cc
scm/define-markup-commands.scm
scm/framework-ps.scm

index 3760e91ed7d0832f5fbf6aabfc3b1af4986a17c8..d128cba70ea09a8b710d2290e0694022b34156d0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2005-01-27  Han-Wen Nienhuys  <hanwen@xs4all.nl>
+
+       * lily/*.cc: Scheme deprecation of SCM_VECTOR_* 
+
+2005-01-27  Han-Wen Nienhuys  <hanwen@xs4all.nl>
+
+       * scm/define-markup-commands.scm (line): filter out empty stencils
+       from line command.
+
+       * lily/stencil-scheme.cc (LY_DEFINE): only allow finite real
+       amount.
+
 2005-01-27  Graham Percival  <gperlist@shaw.ca>
 
        * Documentation/user/notation.itely: added info about what
index 1c90375b47019fc8599aa6077bc49b066703f477..ef8c568b465d5dcfdba84cc054db810b23147677 100644 (file)
@@ -1,4 +1,3 @@
-#(ly:set-option 'old-relative)
 \version "2.4.0"
 \header{
 filename =      "twinkle-pop.ly"
@@ -64,7 +63,7 @@ text = \lyricmode{
            \context Lyrics \text
         >>
        \header{
-               piece = "clarinet in B$\flat$"
+         piece = \markup  { "clarinet in B" \flat }
        }
         \layout {  }
 }
index 29298fe15aab2ed123b02c92a8b8eb6eb5c60d42..355386bdf94ed10eaf6bb97c0a29f1c791d546f5 100644 (file)
@@ -91,7 +91,7 @@ do_break_substitution (SCM src)
     return substitute_grob (unsmob_grob (src));
   else if (ly_c_vector_p (src))
     {
-      int len = SCM_VECTOR_LENGTH (src);
+      int len = scm_c_vector_length (src);
       SCM nv = scm_c_make_vector (len, SCM_UNDEFINED);
       for (int i = 0; i < len; i++)
        {
index cc234bf7910fa8443f11da18bc9723dbdae860d7..0a8a093ca957658c015aa5d94f20b9c75656c6b2 100644 (file)
@@ -21,7 +21,7 @@ Font_metric *
 get_font_by_design_size (Output_def *layout, Real requested,
                         SCM font_vector)
 {
-  int n = SCM_VECTOR_LENGTH (font_vector);
+  int n = scm_c_vector_length (font_vector);
   Real size = 1e6;
   Real last_size = -1e6;
   int i = 0;
@@ -29,7 +29,7 @@ get_font_by_design_size (Output_def *layout, Real requested,
   String pango_description_string;
   for (; i < n; i++)
     {
-      SCM entry = SCM_VECTOR_REF (font_vector, i);
+      SCM entry = scm_c_vector_ref (font_vector, i);
       
       if (scm_promise_p (entry) == SCM_BOOL_T)
        {
@@ -78,7 +78,7 @@ get_font_by_design_size (Output_def *layout, Real requested,
     }
   else
     {
-      fm = unsmob_metrics (scm_force (SCM_VECTOR_REF (font_vector, i)));
+      fm = unsmob_metrics (scm_force (scm_c_vector_ref (font_vector, i)));
     }
 
   return find_scaled_font (layout, fm, requested / size);
index a0db2d3ff886bbf8482470721800dcb95502b2a4..35e516e8963961770abef53e81e2121306556a2a 100644 (file)
@@ -60,6 +60,8 @@ inline bool ly_c_eq_p (SCM x, SCM y) { return SCM_EQ_P (x, y); }
 #define scm_c_string_length(x) SCM_STRING_LENGTH (x)
 #define scm_is_pair(x) (SCM_CONSP (x))
 
+#define SCM_VECTOR_LENGTH(x) scm_c_vector_length(x)
+#define SCM_VECTOR_REF(x,y) scm_c_vector_ref(x,y)
 
 inline double ly_scm2double (SCM x) { return scm_num2dbl (x, "ly_scm2double"); }
 #define scm_to_double(x) (ly_scm2double (x))
index 5c3c3a134e70d4eee60b89d9ba7e3cd4ef445136..b8c06fad55bc3d7725d5d53eefac5f8eb215d79a 100644 (file)
@@ -305,7 +305,7 @@ ly_deep_copy (SCM src)
     return scm_cons (ly_deep_copy (scm_car (src)), ly_deep_copy (scm_cdr (src)));
   else if (ly_c_vector_p (src))
     {
-      int len = SCM_VECTOR_LENGTH (src);
+      int len = scm_c_vector_length (src);
       SCM nv = scm_c_make_vector (len, SCM_UNDEFINED);
       for (int i = 0 ;i < len ; i++)
        {
index 23de800ffc9e770e6b47676d753eccb6d884a118..334b2506379f55e373bab0a59688e6208f0dac79 100644 (file)
@@ -99,7 +99,7 @@ Note_heads_engraver::process_music ()
          unsigned int delta = (pit->get_notename() - tonic.get_notename() + 7) % 7;
          
          SCM style = SCM_EOL;
-         if (SCM_VECTOR_LENGTH (shape_vector) > delta
+         if (scm_c_vector_length (shape_vector) > delta
              && scm_is_symbol (scm_vector_ref (shape_vector, scm_from_int (delta))))
            {
              style = scm_vector_ref (shape_vector, scm_from_int (delta));
index de3993b3eff4e47384fd1b161e416844330c06d8..cf765e9d3b71e085e62fc19e0d00345738ca7b3f 100644 (file)
@@ -74,14 +74,14 @@ int
 binsearch_scm_vector (SCM vec, SCM key, bool (*is_less)(SCM a,SCM b))
 {
   int lo = 0;
-  int hi = SCM_VECTOR_LENGTH (vec);
+  int hi = scm_c_vector_length (vec);
 
   /* binary search */
   do
   {
     int cmp = (lo + hi) / 2;
 
-      SCM when = scm_caar (SCM_VECTOR_REF (vec, cmp));
+      SCM when = scm_caar (scm_c_vector_ref (vec, cmp));
       bool result =  (*is_less) (key, when);
       if (result)
           hi = cmp;
@@ -171,7 +171,7 @@ Quote_iterator::pending_moment () const
 Moment
 Quote_iterator::vector_moment (int idx) const
 {
-  SCM entry = SCM_VECTOR_REF (event_vector_, idx);
+  SCM entry = scm_c_vector_ref (event_vector_, idx);
   return *unsmob_moment (scm_caar (entry));
 }
 
@@ -212,7 +212,7 @@ Quote_iterator::process (Moment m)
 
   if (quote_ok ())
     {
-      SCM entry = SCM_VECTOR_REF (event_vector_, event_idx_);
+      SCM entry = scm_c_vector_ref (event_vector_, event_idx_);
       Pitch * quote_pitch = unsmob_pitch (scm_cdar (entry));
 
       /*
index b4bd0a936f34837fccc7f0142b38a35fc54f221a..483adb42b20e05d7c200c89560035da6d0ccd4d2 100644 (file)
@@ -19,7 +19,7 @@ int
 copy_scm_hashes (SCM dest, SCM src)
 {
   int k = 0;
-  for (int i = SCM_VECTOR_LENGTH (src); i--;)
+  for (int i = scm_c_vector_length (src); i--;)
     for (SCM s = scm_vector_ref (src, scm_from_int (i)); scm_is_pair (s); s = scm_cdr (s))
       {
        scm_hashq_set_x (dest, scm_caar (s), scm_cdar (s));
@@ -115,7 +115,7 @@ Scheme_hash_table::set (SCM k, SCM v)
   /*
     resize if getting too large.
   */
-  if (elt_count_ > 2 * SCM_VECTOR_LENGTH (hash_tab_))
+  if (elt_count_ > 2 * scm_c_vector_length (hash_tab_))
     {
       SCM nh = scm_make_vector (scm_int2num (3* elt_count_+1), SCM_EOL);
       elt_count_ = copy_scm_hashes (nh, hash_tab_);
@@ -145,7 +145,7 @@ SCM
 Scheme_hash_table::to_alist () const
 {
   SCM lst = SCM_EOL;
-  for (int i = SCM_VECTOR_LENGTH (hash_tab_); i--;)
+  for (int i = scm_c_vector_length (hash_tab_); i--;)
     for (SCM s = scm_vector_ref (hash_tab_, scm_int2num (i)); scm_is_pair (s);
         s = scm_cdr (s))
       lst = scm_acons (scm_caar (s), scm_cdar (s), lst);
index 3a4b6e167220969def7cfacac1e0f236a6c241a7..0bffa6edb356a43d9720b9ba0db6fbf18f431bd5 100644 (file)
@@ -6,6 +6,10 @@
   (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
+#include <math.h>
+
+#include <libc-extension.hh>   // isinf
+
 #include "font-metric.hh"
 #include "stencil.hh"
 #include "lookup.hh"
@@ -40,12 +44,17 @@ LY_DEFINE (ly_translate_stencil_axis, "ly:stencil-translate-axis",
 {
   Stencil *s = unsmob_stencil (stil);
   SCM_ASSERT_TYPE (s, stil, SCM_ARG1, __FUNCTION__, "stencil");
-  SCM_ASSERT_TYPE (scm_is_number (amount), amount, SCM_ARG2, __FUNCTION__, "number pair");
+  SCM_ASSERT_TYPE (scm_is_number (amount), amount, SCM_ARG2, __FUNCTION__, "number");
+
+  Real real_amount = scm_to_double (amount);
+  SCM_ASSERT_TYPE (!isinf (real_amount) && !isnan (real_amount),
+                  amount, SCM_ARG2, __FUNCTION__, "finite number");
+  
   SCM_ASSERT_TYPE (is_axis (axis), axis, SCM_ARG3, __FUNCTION__, "axis");
 
   SCM new_s = s->smobbed_copy ();
   Stencil *q = unsmob_stencil (new_s);
-  q->translate_axis (scm_to_double (amount), Axis (scm_to_int (axis)));
+  q->translate_axis (real_amount, Axis (scm_to_int (axis)));
   return new_s;
 
 }
index 44206f9e7a61897fc41f412c6118ee9dffd38e69..641a4485074c521eb1e5d58b834b27ec8dc89fb7 100644 (file)
@@ -136,7 +136,8 @@ gsave /ecrm10 findfont
 determines the space between each markup in @var{args}."
   (stack-stencil-line
    (chain-assoc-get 'word-space props)
-   (map (lambda (m) (interpret-markup layout props m)) args)))
+   (remove ly:stencil-empty?
+          (map (lambda (m) (interpret-markup layout props m)) args))))
 
 (def-markup-command (fromproperty layout props symbol) (symbol?)
   "Read the @var{symbol} from property settings, and produce a stencil
@@ -364,7 +365,7 @@ alignment accordingly."
 
 (def-markup-command (musicglyph layout props glyph-name) (string?)
   "This is converted to a musical symbol, e.g. @code{\\musicglyph
-#\"accidentals-0\"} will select the natural sign from the music font.
+#\"accidentals.0\"} will select the natural sign from the music font.
 See @usermanref{The Feta font} for  a complete listing of the possible glyphs."
   (ly:font-get-glyph
    (ly:paper-get-font layout (cons '((font-encoding . fetaMusic))
index d2657fb4fdafb5887a346914f60a9b80a87f205e..b3b8dcdaca0130c099550d4ddbd765eb9c50d942 100644 (file)
    (setup paper)))
 
 (define-public (output-framework basename book scopes fields)
+  (display (gc-live-object-stats))
   (let* ((filename (format "~a.ps" basename))
         (outputter  (ly:make-paper-outputter filename
                                              (ly:output-backend)))