From aa4e6cdf7c4e830a3389e237620725cea144dbde Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Fri, 28 Jan 2005 10:26:05 +0000 Subject: [PATCH] (SCM_VECTOR_P): Compile fix. --- ChangeLog | 4 ++ lily/break-align-interface.cc | 57 ++++++++++++++--------------- lily/function-documentation.cc | 4 +- lily/grob-interface-scheme.cc | 2 +- lily/include/guile-compatibility.hh | 8 ++-- lily/scm-hash.cc | 22 +++++------ scripts/lilypond-book.py | 11 ++---- 7 files changed, 52 insertions(+), 56 deletions(-) diff --git a/ChangeLog b/ChangeLog index 866617ec6f..8301b1a449 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2005-01-28 Jan Nieuwenhuizen + + * lily/include/guile-compatibility.hh (SCM_VECTOR_P): Compile fix. + 2005-01-28 Werner Lemberg * mf/feta-pendaal.mf ("Pedal asterisk"): Remove workaround for diff --git a/lily/break-align-interface.cc b/lily/break-align-interface.cc index ab5e137eb9..c6cad7294c 100644 --- a/lily/break-align-interface.cc +++ b/lily/break-align-interface.cc @@ -10,7 +10,7 @@ #include #include "break-align-interface.hh" -#include // isinf +#include "libc-extension.hh" // isinf #include "self-alignment-interface.hh" #include "side-position-interface.hh" @@ -21,8 +21,7 @@ #include "paper-column.hh" #include "align-interface.hh" -MAKE_SCHEME_CALLBACK (Break_align_interface,alignment_callback,2); - +MAKE_SCHEME_CALLBACK (Break_align_interface, alignment_callback, 2); SCM Break_align_interface::alignment_callback (SCM element_smob, SCM axis) { @@ -36,18 +35,18 @@ Break_align_interface::alignment_callback (SCM element_smob, SCM axis) par->set_property ("positioning-done", SCM_BOOL_T); Break_align_interface::do_alignment (par); } - + return scm_make_real (0); } -MAKE_SCHEME_CALLBACK (Break_align_interface,self_align_callback,2); +MAKE_SCHEME_CALLBACK (Break_align_interface, self_align_callback, 2); SCM Break_align_interface::self_align_callback (SCM element_smob, SCM axis) { Grob *me = unsmob_grob (element_smob); Axis a = (Axis) scm_to_int (axis); assert (a == X_AXIS); - + Item* item = dynamic_cast (me); Direction bsd = item->break_status_dir (); if (bsd == LEFT) @@ -58,7 +57,7 @@ Break_align_interface::self_align_callback (SCM element_smob, SCM axis) /* Force break alignment itself to be done first, in the case */ - return Self_alignment_interface::aligned_on_self (element_smob, axis); + return Self_alignment_interface::aligned_on_self (element_smob, axis); } @@ -66,13 +65,13 @@ Break_align_interface::self_align_callback (SCM element_smob, SCM axis) This is tricky: we cannot modify 'elements, since callers are iterating the same list. Reordering the list in-place, or resetting 'elements will skip elements in the loops of callers. - + So we return the correct order as an array. */ Link_array Break_align_interface::ordered_elements (Grob *grob) { - Item *me = dynamic_cast (grob); + Item *me = dynamic_cast (grob); SCM elts = me->get_property ("elements"); SCM order_vec = me->get_property ("break-align-orders"); if (!scm_is_vector (order_vec) @@ -80,7 +79,7 @@ Break_align_interface::ordered_elements (Grob *grob) return Pointer_group_interface__extract_grobs (me, (Grob*)0, "elements"); SCM order = scm_vector_ref (order_vec, - scm_int2num (me->break_status_dir() + 1)); + scm_int2num (me->break_status_dir () + 1)); /* @@ -90,14 +89,14 @@ Break_align_interface::ordered_elements (Grob *grob) for (; scm_is_pair (order); order = scm_cdr (order)) { SCM sym = scm_car (order); - + for (SCM s = elts; scm_is_pair (s); s = scm_cdr (s)) { Grob *g = unsmob_grob (scm_car (s)); if (g && sym == g->get_property ("break-align-symbol")) { new_elts.push (g); - elts = scm_delq (g->self_scm (), elts); + elts = scm_delq (g->self_scm (), elts); } } } @@ -105,7 +104,7 @@ Break_align_interface::ordered_elements (Grob *grob) } void -Break_align_interface::add_element (Grob*me, Grob *toadd) +Break_align_interface::add_element (Grob *me, Grob *toadd) { Axis_group_interface::add_element (me, toadd); } @@ -115,23 +114,23 @@ Break_align_interface::do_alignment (Grob *grob) { Item * me = dynamic_cast (grob); - + Link_array elems = ordered_elements (me); Array extents; - int last_nonempty = -1; - for (int i = 0; i < elems.size (); i++) + int last_nonempty = -1; + for (int i = 0; i < elems.size (); i++) { Interval y = elems[i]->extent (elems[i], X_AXIS); extents.push (y); if (!y.is_empty ()) - last_nonempty = i; + last_nonempty = i; } int idx = 0; while (idx < extents.size () && extents[idx].is_empty ()) idx++; - + Array offsets; offsets.set_size (elems.size ()); for (int i = 0; i < offsets.size ();i ++) @@ -146,7 +145,7 @@ Break_align_interface::do_alignment (Grob *grob) while (next_idx < elems.size () && extents[next_idx].is_empty () ) next_idx++; - + Grob *l = elems[idx]; Grob *r = 0; @@ -168,7 +167,7 @@ Break_align_interface::do_alignment (Grob *grob) && elt->get_property ("break-align-symbol") == ly_symbol2scm ( "left-edge")) edge_idx = idx; - + SCM l = elt->get_property ("space-alist"); if (scm_is_pair (l)) { @@ -191,7 +190,7 @@ Break_align_interface::do_alignment (Grob *grob) rsym = elt->get_property ("break-align-symbol"); } - + if (rsym == ly_symbol2scm ("left-edge")) edge_idx = next_idx; @@ -209,7 +208,7 @@ Break_align_interface::do_alignment (Grob *grob) String orig_string ; if (unsmob_grob (l->get_property ("cause"))) orig_string = unsmob_grob (l->get_property ("cause"))->name (); - + programming_error (_f ("No spacing entry from %s to `%s'", orig_string.to_str0 (), sym_string.to_str0 ())); @@ -217,11 +216,11 @@ Break_align_interface::do_alignment (Grob *grob) Real distance = 1.0; SCM type = ly_symbol2scm ("extra-space"); - + if (entry_found) { entry = scm_cdr (entry); - + distance = scm_to_double (scm_cdr (entry)); type = scm_car (entry) ; } @@ -237,21 +236,21 @@ Break_align_interface::do_alignment (Grob *grob) } else { - extra_right_space = distance; + extra_right_space = distance; } - + idx = next_idx; } Real here = 0.0; Interval total_extent; - Real alignment_off = 0.0; + Real alignment_off = 0.0; for (int i = 0 ; i < offsets.size (); i++) { here += offsets[i]; if (i == edge_idx) - alignment_off = -here; + alignment_off = -here; total_extent.unite (extents[i] + here); } @@ -282,7 +281,7 @@ ADD_INTERFACE (Break_aligned_interface, "break-aligned-interface", "@item (minimum-space . @var{spc}))\n" " Pad space until the distance is @var{spc}\n" "@item (fixed-space . @var{spc})\n" - " Set a fixed space\n" + " Set a fixed space\n" "@item (semi-fixed-space . @var{spc})\n" " Set a space. Half of it is fixed and half is stretchable. \n" "(does not work at start of line. fixme)\n" diff --git a/lily/function-documentation.cc b/lily/function-documentation.cc index 5f861ab9f1..b65461d81a 100644 --- a/lily/function-documentation.cc +++ b/lily/function-documentation.cc @@ -20,9 +20,9 @@ void ly_add_function_documentation (SCM func, char const * doc) { if (!strlen (doc)) - return ; + return; - if (!scm_is_vector (doc_hash_table )) + if (!scm_is_vector (doc_hash_table)) doc_hash_table = scm_make_vector (scm_int2num (59), SCM_EOL); String s = String (" - ") + "LilyPond procedure: " + fname + " " + varlist diff --git a/lily/grob-interface-scheme.cc b/lily/grob-interface-scheme.cc index 1876236923..6b12dafe05 100644 --- a/lily/grob-interface-scheme.cc +++ b/lily/grob-interface-scheme.cc @@ -18,7 +18,7 @@ LY_DEFINE (ly_add_interface, "ly:add-interface", 3,0,0, (SCM a, SCM b, SCM c), { SCM_ASSERT_TYPE (scm_is_symbol (a), a, SCM_ARG1, __FUNCTION__, "symbol"); SCM_ASSERT_TYPE (scm_is_string (b), b, SCM_ARG2, __FUNCTION__, "string"); - SCM_ASSERT_TYPE (ly_c_list_p (c), c, SCM_ARG3, __FUNCTION__, "list of syms"); + SCM_ASSERT_TYPE (ly_c_list_p (c), c, SCM_ARG3, __FUNCTION__, "list of syms"); if (!scm_is_vector (all_ifaces)) all_ifaces = scm_make_vector (scm_int2num (40), SCM_EOL); diff --git a/lily/include/guile-compatibility.hh b/lily/include/guile-compatibility.hh index 6f494ac5db..cee168d5ea 100644 --- a/lily/include/guile-compatibility.hh +++ b/lily/include/guile-compatibility.hh @@ -35,8 +35,8 @@ inline SCM scm_caadr (SCM x) { return SCM_CAADR (x); } inline SCM scm_cadar (SCM x) { return SCM_CADAR (x); } #define scm_gc_unregister_collectable_memory(a, b, c) scm_done_free (b) #define scm_gc_register_collectable_memory(a, b, c) scm_done_malloc (b) -#define scm_is_vector(x) (SCM_VECTORP(x)) -#define SCM_HASHTABLE_P(x) (SCM_VECTORP (x)) +#define scm_is_vector(x) (SCM_VECTORP ((SCM) x)) +#define SCM_HASHTABLE_P(x) (SCM_VECTORP ((SCM) x)) #define SCM_VECTOR_REF(v, i) (SCM_VELTS ((v))[(i)]) #define scm_from_bool(x) (x ? SCM_BOOL_T : SCM_BOOL_F) #define scm_from_int(x) SCM_MAKINUM (x) @@ -61,8 +61,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_c_vector_length(x) SCM_VECTOR_LENGTH(x) -#define scm_c_vector_ref(x,y) SCM_VECTOR_REF(x,y) +#define scm_c_vector_length(x) SCM_VECTOR_LENGTH (x) +#define scm_c_vector_ref(x, y) SCM_VECTOR_REF(x, y) inline double ly_scm2double (SCM x) { return scm_num2dbl (x, "ly_scm2double"); } #define scm_to_double(x) (ly_scm2double (x)) diff --git a/lily/scm-hash.cc b/lily/scm-hash.cc index 483adb42b2..015fc62e02 100644 --- a/lily/scm-hash.cc +++ b/lily/scm-hash.cc @@ -1,8 +1,8 @@ -/* +/* scm-hash.cc -- implement Scheme_hash_table - + source file of the GNU LilyPond music typesetter - + (c) 1999--2004 Han-Wen Nienhuys */ @@ -45,7 +45,7 @@ Scheme_hash_table::Scheme_hash_table (Scheme_hash_table const &src) elt_count_ = 0; smobify_self (); - hash_tab_ = scm_make_vector (scm_int2num (src.elt_count_ >? 11 ), SCM_EOL); + hash_tab_ = scm_make_vector (scm_int2num (src.elt_count_ >? 11 ), SCM_EOL); elt_count_ = copy_scm_hashes (hash_tab_, src.hash_tab_); } @@ -54,8 +54,8 @@ Scheme_hash_table::operator = (Scheme_hash_table const & src) { if (&src == this) return; - - hash_tab_ = scm_make_vector (scm_int2num (src.elt_count_ >? 11), SCM_EOL); + + hash_tab_ = scm_make_vector (scm_int2num (src.elt_count_ >? 11), SCM_EOL); elt_count_ = copy_scm_hashes (hash_tab_, src.hash_tab_); } @@ -78,8 +78,8 @@ Scheme_hash_table::print_smob (SCM s, SCM p, scm_print_state*) char str[1000]; sprintf (str, "#hash_tab_, p); - scm_puts ("> ",p); + scm_display (me->hash_tab_, p); + scm_puts ("> ",p); return 1; } @@ -109,7 +109,7 @@ Scheme_hash_table::set (SCM k, SCM v) SCM handle = scm_hashq_create_handle_x (hash_tab_, k, SCM_UNDEFINED); if (scm_cdr (handle) == SCM_UNDEFINED) elt_count_++; - + scm_set_cdr_x (handle, v); /* @@ -123,7 +123,7 @@ Scheme_hash_table::set (SCM k, SCM v) } } -// UGH. +// UGH. SCM Scheme_hash_table::get (SCM k) const { @@ -154,5 +154,3 @@ Scheme_hash_table::to_alist () const IMPLEMENT_SMOBS (Scheme_hash_table); IMPLEMENT_DEFAULT_EQUAL_P (Scheme_hash_table); - - diff --git a/scripts/lilypond-book.py b/scripts/lilypond-book.py index 65c025feda..9fd3ffba08 100644 --- a/scripts/lilypond-book.py +++ b/scripts/lilypond-book.py @@ -896,7 +896,7 @@ class Lilypond_snippet (Snippet): ok = self.ly_is_outdated () ok = ok and (os.path.exists (base + '.texstr')) return not ok - + def filter_text (self): code = self.substring ('code') s = run_filter (code) @@ -1139,7 +1139,7 @@ def process_snippets (cmd, ly_snippets, texstr_snippets, png_snippets): status = 0 def my_system (cmd): - status = ly.system (cmd, + status = ly.system (cmd, ignore_error = 1, progress_p = 1) if status: @@ -1150,16 +1150,13 @@ def process_snippets (cmd, ly_snippets, texstr_snippets, png_snippets): # the --process=CMD switch is a bad idea # it is too generic for lilypond-book. if texstr_names and re.search ('^[0-9A-Za-z/]*lilypond', cmd): - + my_system (string.join ([cmd + ' --backend texstr ' ] + texstr_names)) for l in texstr_names: my_system ('latex %s.texstr' % l) - if ly_names: my_system (string.join ([cmd] + ly_names)) - - if format == HTML or format == TEXINFO: for i in png_names: @@ -1457,5 +1454,3 @@ def main (): if __name__ == '__main__': main () - -# EOF -- 2.39.5