From: Jan Nieuwenhuizen Date: Wed, 11 Jul 2001 12:39:44 +0000 (+0200) Subject: patch::: 1.5.1.jcn2 X-Git-Tag: release/1.5.2~3 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=a78c70be8951804126d19eb74b344ae1858023e5;p=lilypond.git patch::: 1.5.1.jcn2 1.5.1.jcn2 --- diff --git a/CHANGES b/CHANGES index 4b0fa782be..b0510c8971 100644 --- a/CHANGES +++ b/CHANGES @@ -1,9 +1,13 @@ *** WARNING(reminder): all output via TeX (ie: using ly2dvi or plain *** lilypond) still yields broken stems, bars and staff lines. -1.5.1.jcn1 +1.5.1.jcn2 ========== +* Use blot diameter for postscript beams and boxes. + +* Guile-1.5.0-cvs updates and Guile-1.4.x compatibility. + * Beam knee fix. * Now really included lexer-gcc-3.0.patch. diff --git a/Documentation/windows/compiling.texi b/Documentation/windows/compiling.texi index c3e6b19023..8332a24e1d 100644 --- a/Documentation/windows/compiling.texi +++ b/Documentation/windows/compiling.texi @@ -40,14 +40,14 @@ needs a number of extra tricks. All code for these tricks can be found in the source package directory @file{Documentation/windows}. @table @asis -@item @var{guile-1.4-gnu-windows.patch} +@item @file{guile-1.4-gnu-windows.patch} You may (Cygwin gets better every day) need this patch to compile GUILE. -@item @var{cygwin-installer.patch} +@item @file{cygwin-installer.patch} Apply this patch to the @file{cinstall} directory of @file{winsup-src/cinstall}, to get the LilyPond installer. Compiling @file{setup.exe} has been complicated a bit with the -introduction of the non-feature bzip2. Here's how I did it: +introduction of the bzip2 feature: @quotation @example tar xjf cygwin-src-20010531.tar.bz2 @@ -55,16 +55,17 @@ introduction of the non-feature bzip2. Here's how I did it: tar xzf mingw-20010424-1.tar.gz cd winsup/cinstall patch < ../../cygwin-installer.patch - cp /home/cygwin/cygwin-1.3.2/usr/lib/mingw/crt2.o . cd ../bz2lib MINGW32=yes CFLAGS='-mno-cygwin' ./configure make cd - + MINGW32=yes CFLAGS='-mno-cygwin' ./configure + cp /home/cygwin/cygwin-1.3.2/usr/lib/mingw/crt2.o . make w32api_lib=/home/cygwin/cygwin-1.3.2/usr/lib/w32api \ CXX='g++ -L/home/cygwin/cygwin-1.3.2/usr/lib/mingw' @end example @end quotation -@item @var{--prefix=/usr/lilypond-x.y.x} +@item @file{--prefix=/usr/lilypond-x.y.x} The standard binary installation installs LilyPond into its own prefix. We think it's silly, but do this is on special request of Windows users. @item @file{fix-suffixes.sh} diff --git a/Documentation/windows/cygwin-installer.patch b/Documentation/windows/cygwin-installer.patch index 11bac9d269..91fd1871fc 100644 --- a/Documentation/windows/cygwin-installer.patch +++ b/Documentation/windows/cygwin-installer.patch @@ -40,7 +40,7 @@ diff -urN ../cinstall/desktop.cc ./desktop.cc static void +make_lily_bat () +{ -+ batname = backslash (concat (root_dir, "/lilypond.bat", 0)); ++ batname = backslash (concat (get_root_dir (), "/lilypond.bat", 0)); + + /* if the batch file exists, don't overwrite it */ + if (_access (batname, 0) == 0) @@ -52,8 +52,8 @@ diff -urN ../cinstall/desktop.cc ./desktop.cc + + fprintf (bat, "@echo off\n\n"); + -+ fprintf (bat, "%.2s\n", root_dir); -+ fprintf (bat, "chdir %s\n\n", backslash (concat (root_dir+2, "/bin", 0))); ++ fprintf (bat, "%.2s\n", get_root_dir ()); ++ fprintf (bat, "chdir %s\n\n", backslash (concat (get_root_dir ()+2, "/bin", 0))); + + /* fprintf (bat, "bash --rcfile /bin/lilypond-profile\n"); */ + fprintf (bat, "bash --login -i\n"); @@ -64,7 +64,7 @@ diff -urN ../cinstall/desktop.cc ./desktop.cc +static void make_etc_profile () { - char *fname = concat (root_dir, "/etc/profile", 0); + char *fname = concat (get_root_dir (), "/etc/profile", 0); @@ -299,11 +321,11 @@ } @@ -72,8 +72,8 @@ diff -urN ../cinstall/desktop.cc ./desktop.cc -save_icon () +save_icon (char* iconfile, char* iconres) { -- iconname = backslash (concat (root_dir, "/cygwin.ico", 0)); -+ iconname = backslash (concat (root_dir, iconfile, 0)); +- iconname = backslash (concat (get_root_dir (), "/cygwin.ico", 0)); ++ iconname = backslash (concat (get_root_dir (), iconfile, 0)); - HRSRC rsrc = FindResource (NULL, "CYGWIN.ICON", "FILE"); + HRSRC rsrc = FindResource (NULL, iconres, "FILE"); diff --git a/VERSION b/VERSION index d340a16921..5854e483d1 100644 --- a/VERSION +++ b/VERSION @@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond MAJOR_VERSION=1 MINOR_VERSION=5 PATCH_LEVEL=1 -MY_PATCH_LEVEL=jcn1 +MY_PATCH_LEVEL=jcn2 # use the above to send patches: MY_PATCH_LEVEL is always empty for a # released version. diff --git a/aclocal.m4 b/aclocal.m4 index a7d59a36f0..720f2db629 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -203,9 +203,15 @@ else {last =0}} then AC_STEPMAKE_WARN("Guile version "$need_guile_version" or newer is needed") fi + changequote(<<, >>)dnl + GUILE_MAJOR_VERSION=`expr $guile_version : '\([0-9]*\)'` + GUILE_MINOR_VERSION=`expr $guile_version : '[0-9]*\.\([0-9]*\)'` + changequote([, ])dnl GUILE_FLAGS AC_PATH_PROG(GUILE, guile, error) AC_SUBST(GUILE) + AC_DEFINE_UNQUOTED(GUILE_MAJOR_VERSION, $GUILE_MAJOR_VERSION) + AC_DEFINE_UNQUOTED(GUILE_MINOR_VERSION, $GUILE_MINOR_VERSION) ]) AC_DEFUN(AC_STEPMAKE_INIT, [ diff --git a/config.hh.in b/config.hh.in index e6a8195c5d..04d22f741f 100644 --- a/config.hh.in +++ b/config.hh.in @@ -56,3 +56,9 @@ /* define if you have sys/stat.h */ #define STAT_MACROS_BROKEN 0 + +/* define GUILE major version */ +#define GUILE_MAJOR_VERSION 0 + +/* define GUILE minor version */ +#define GUILE_MINOR_VERSION 0 diff --git a/lily/all-font-metrics.cc b/lily/all-font-metrics.cc index 6d728efd0a..61a66c33bc 100644 --- a/lily/all-font-metrics.cc +++ b/lily/all-font-metrics.cc @@ -30,8 +30,8 @@ All_font_metrics::All_font_metrics (String path) All_font_metrics::~All_font_metrics () { - scm_unprotect_object (afm_p_dict_->self_scm ()); - scm_unprotect_object (tfm_p_dict_->self_scm ()); + scm_gc_unprotect_object (afm_p_dict_->self_scm ()); + scm_gc_unprotect_object (tfm_p_dict_->self_scm ()); } Adobe_font_metric * @@ -72,7 +72,7 @@ All_font_metrics::find_afm (String name) afm_p_dict_->set (sname,val); - scm_unprotect_object (val); + scm_gc_unprotect_object (val); Adobe_font_metric *afm @@ -145,7 +145,7 @@ All_font_metrics::find_tfm (String name) unsmob_metrics (val)->description_ = gh_cons (name_str, gh_double2scm (1.0)); tfm_p_dict_->set (sname, val); - scm_unprotect_object (val); + scm_gc_unprotect_object (val); } return diff --git a/lily/auto-beam-engraver.cc b/lily/auto-beam-engraver.cc index 31e26d349c..58f289b822 100644 --- a/lily/auto-beam-engraver.cc +++ b/lily/auto-beam-engraver.cc @@ -231,7 +231,7 @@ Auto_beam_engraver::create_beam_p () */ if (Stem::beam_l ((*stem_l_arr_p_)[i])) { - scm_unprotect_object (beam_p->self_scm ()); + scm_gc_unprotect_object (beam_p->self_scm ()); return 0; } Beam::add_stem (beam_p, (*stem_l_arr_p_)[i]); diff --git a/lily/break-align-item.cc b/lily/break-align-item.cc index 8bad438909..28b93b8184 100644 --- a/lily/break-align-item.cc +++ b/lily/break-align-item.cc @@ -122,7 +122,7 @@ Break_align_interface::do_alignment (Grob *me) next_origin = ly_symbol2scm ("begin-of-note"); SCM alist = me->get_grob_property ("space-alist"); - SCM e = scm_assoc (scm_listify (current_origin, + SCM e = scm_assoc (scm_list_n (current_origin, next_origin, SCM_UNDEFINED), alist); @@ -136,7 +136,7 @@ Break_align_interface::do_alignment (Grob *me) warning (_f ("unknown spacing pair `%s', `%s'", ly_symbol2string (current_origin), ly_symbol2string (next_origin))); - extra_space = scm_listify (ly_symbol2scm ("minimum-space"), gh_double2scm (0.0), SCM_UNDEFINED); + extra_space = scm_list_n (ly_symbol2scm ("minimum-space"), gh_double2scm (0.0), SCM_UNDEFINED); } SCM symbol = gh_car (extra_space); diff --git a/lily/chord.cc b/lily/chord.cc index dd20c964ee..3cf7aa3312 100644 --- a/lily/chord.cc +++ b/lily/chord.cc @@ -392,7 +392,7 @@ Chord::get_chord (SCM tonic, SCM add, SCM sub, SCM inversion, SCM bass, SCM dur) n->set_mus_property ("duration", dur); n->set_mus_property ("inversion", SCM_BOOL_T); list = gh_cons (n->self_scm (), list); - scm_unprotect_object (n->self_scm ()); + scm_gc_unprotect_object (n->self_scm ()); } else warning (_f ("invalid inversion pitch: not part of chord: %s", @@ -407,7 +407,7 @@ Chord::get_chord (SCM tonic, SCM add, SCM sub, SCM inversion, SCM bass, SCM dur) n->set_mus_property ("duration", dur); n->set_mus_property ("bass", SCM_BOOL_T); list = gh_cons (n->self_scm (), list); - scm_unprotect_object (n->self_scm ()); + scm_gc_unprotect_object (n->self_scm ()); } for (SCM i = pitches; gh_pair_p (i); i = gh_cdr (i)) @@ -416,7 +416,7 @@ Chord::get_chord (SCM tonic, SCM add, SCM sub, SCM inversion, SCM bass, SCM dur) n->set_mus_property ("pitch", gh_car (i)); n->set_mus_property ("duration", dur); list = gh_cons (n->self_scm (), list); - scm_unprotect_object (n->self_scm ()); + scm_gc_unprotect_object (n->self_scm ()); } Simultaneous_music*v = new Request_chord (SCM_EOL); diff --git a/lily/cxx-function-smob.cc b/lily/cxx-function-smob.cc index f0d5beec1f..b17c4cb38a 100644 --- a/lily/cxx-function-smob.cc +++ b/lily/cxx-function-smob.cc @@ -10,7 +10,7 @@ #include "cxx-function-smob.hh" #include "ly-smobs.icc" -static long callback_tag; +static scm_t_bits callback_tag; static SCM mark_smob (SCM) @@ -25,8 +25,8 @@ print_smob (SCM, SCM port, scm_print_state *) return 1; } -static -scm_sizet free_smob (SCM) +static size_t +free_smob (SCM) { return 0; } @@ -35,16 +35,19 @@ scm_sizet free_smob (SCM) SCM cxx_function_type_p (SCM x) { - return (SCM_CELL_TYPE (x) == callback_tag) ? SCM_BOOL_T : SCM_BOOL_F; + return (SCM_CELL_TYPE (x)) == callback_tag ? SCM_BOOL_T : SCM_BOOL_F; } void init_cxx_function_smobs () { - callback_tag = scm_make_smob_type_mfpe ("callback", 0, - mark_smob, free_smob, - print_smob, 0); + callback_tag = scm_make_smob_type ("callback", 0); + scm_set_smob_mark (callback_tag, mark_smob); + scm_set_smob_free (callback_tag, free_smob); + scm_set_smob_print (callback_tag, print_smob); + scm_set_smob_equalp (callback_tag, 0); - scm_make_gsubr ("c++-function?", 1, 0, 0, (Scheme_function_unknown) cxx_function_type_p); + scm_c_define_gsubr ("c++-function?", 1, 0, 0, + (Scheme_function_unknown) cxx_function_type_p); } SCM diff --git a/lily/duration.cc b/lily/duration.cc index c0a97084bf..38cb80f6ca 100644 --- a/lily/duration.cc +++ b/lily/duration.cc @@ -139,7 +139,8 @@ make_duration (SCM l, SCM d) static void add_funcs () { - scm_make_gsubr ("make-duration", 2, 0, 0, (Scheme_function_unknown)make_duration); + scm_c_define_gsubr ("make-duration", 2, 0, 0, + (Scheme_function_unknown)make_duration); } ADD_SCM_INIT_FUNC (duration, add_funcs); diff --git a/lily/font-interface.cc b/lily/font-interface.cc index f801cefa01..0ea3bf7675 100644 --- a/lily/font-interface.cc +++ b/lily/font-interface.cc @@ -144,7 +144,8 @@ init_syms () design_sz_sym = scm_permanent_object (ly_symbol2scm ("font-design-size")); wild_sym = scm_permanent_object (ly_symbol2scm ("*")); - scm_make_gsubr ("ly-get-default-font", 1 , 0, 0, (Scheme_function_unknown) ly_font_interface_get_default_font); + scm_c_define_gsubr ("ly-get-default-font", 1 , 0, 0, + (Scheme_function_unknown) ly_font_interface_get_default_font); } diff --git a/lily/font-metric.cc b/lily/font-metric.cc index 930d5f3b2c..4f5ba93be8 100644 --- a/lily/font-metric.cc +++ b/lily/font-metric.cc @@ -151,7 +151,8 @@ ly_find_glyph_by_name (SCM font, SCM name) static void font_metric_init () { - scm_make_gsubr ("ly-find-glyph-by-name", 2 , 0, 0, (Scheme_function_unknown) ly_find_glyph_by_name); + scm_c_define_gsubr ("ly-find-glyph-by-name", 2 , 0, 0, + (Scheme_function_unknown) ly_find_glyph_by_name); } ADD_SCM_INIT_FUNC (font_metric_init, font_metric_init); diff --git a/lily/grob.cc b/lily/grob.cc index f6c84bc079..abbe22874b 100644 --- a/lily/grob.cc +++ b/lily/grob.cc @@ -49,7 +49,7 @@ Grob::Grob (SCM basicprops) */ pscore_l_=0; - status_i_ = 0; + status_c_ = 0; original_l_ = 0; immutable_property_alist_ = basicprops; mutable_property_alist_ = SCM_EOL; @@ -97,7 +97,7 @@ Grob::Grob (Grob const&s) immutable_property_alist_ = s.immutable_property_alist_; mutable_property_alist_ = SCM_EOL; - status_i_ = s.status_i_; + status_c_ = s.status_c_; pscore_l_ = s.pscore_l_; smobify_self (); @@ -222,18 +222,16 @@ Grob::paper_l () const void Grob::calculate_dependencies (int final, int busy, SCM funcname) { - assert (status_i_ >=0); - - if (status_i_ >= final) + if (status_c_ >= final) return; - if (status_i_== busy) + if (status_c_== busy) { programming_error ("Element is busy, come back later"); return; } - status_i_= busy; + status_c_= busy; for (SCM d= get_grob_property ("dependencies"); gh_pair_p (d); d = gh_cdr (d)) { @@ -247,7 +245,7 @@ Grob::calculate_dependencies (int final, int busy, SCM funcname) if (gh_procedure_p (proc)) gh_call1 (proc, this->self_scm ()); - status_i_= final; + status_c_= final; } @@ -866,9 +864,12 @@ init_functions () { interfaces_sym = scm_permanent_object (ly_symbol2scm ("interfaces")); - scm_make_gsubr ("ly-get-grob-property", 2, 0, 0, (Scheme_function_unknown)ly_get_grob_property); - scm_make_gsubr ("ly-set-grob-property", 3, 0, 0, (Scheme_function_unknown)ly_set_grob_property); - scm_make_gsubr ("ly-get-spanner-bound", 2 , 0, 0, (Scheme_function_unknown) spanner_get_bound); + scm_c_define_gsubr ("ly-get-grob-property", 2, 0, 0, + (Scheme_function_unknown)ly_get_grob_property); + scm_c_define_gsubr ("ly-set-grob-property", 3, 0, 0, + (Scheme_function_unknown)ly_set_grob_property); + scm_c_define_gsubr ("ly-get-spanner-bound", 2 , 0, 0, + (Scheme_function_unknown) spanner_get_bound); } bool diff --git a/lily/include/grob.hh b/lily/include/grob.hh index 2de2b88fc2..e1820f9d07 100644 --- a/lily/include/grob.hh +++ b/lily/include/grob.hh @@ -46,7 +46,7 @@ public: 0 means ORPHAN, */ - char status_i_; + char status_c_; String name () const; /* @@ -89,7 +89,7 @@ public: /** Recursively track all dependencies of this Grob. The - status_i_ field is used as a mark-field. It is marked with + status_c_ field is used as a mark-field. It is marked with #busy# during execution of this function, and marked with #final# when finished. diff --git a/lily/include/lily-guile.hh b/lily/include/lily-guile.hh index fecff2483d..0dc9e3406e 100644 --- a/lily/include/lily-guile.hh +++ b/lily/include/lily-guile.hh @@ -11,9 +11,35 @@ #include #include +#include "config.h" +/* Guile 1.3.4 compatibility */ +#if GUILE_MINOR_VERSION < 4 #define fix_guile_1_3_4_scm_puts(scm_data, port) scm_puts ((char*)scm_data, port) #define scm_puts(scm_data, port) fix_guile_1_3_4_scm_puts (scm_data, port) +#endif + +/* Guile 1.4.x compatibility */ +#if GUILE_MINOR_VERSION < 5 + +#define scm_t_bits scm_bits_t + +#define fix_guile_1_4_gh_scm2newstr(str, lenp) gh_scm2newstr (str, (int*)lenp) +#define gh_scm2newstr(str, lenp) fix_guile_1_4_gh_scm2newstr (str, lenp) + +#define fix_guile_1_4_scm_primitive_eval(form) scm_eval_3 (form, 1, SCM_EOL) +#define scm_primitive_eval(form) fix_guile_1_4_scm_primitive_eval (form) + +#define scm_c_define_gsubr scm_make_gsubr +#define scm_c_memq scm_sloppy_memq +#define scm_gc_protect_object scm_protect_object +#define scm_gc_unprotect_object scm_unprotect_object +#define scm_list_n scm_listify +#define SCM_STRING_CHARS SCM_CHARS +#define SCM_STRING_LENGTH SCM_LENGTH +#endif + + #include "direction.hh" #include "flower-proto.hh" diff --git a/lily/include/ly-smobs.icc b/lily/include/ly-smobs.icc index 0405b9c506..69c7d2ecfe 100644 --- a/lily/include/ly-smobs.icc +++ b/lily/include/ly-smobs.icc @@ -23,7 +23,7 @@ return CL::unsmob (s); \ #define IMPLEMENT_TYPE_P(CL, FUNCNAME)\ void init_type_p_ ## CL ()\ {\ - scm_make_gsubr (FUNCNAME, 1, 0, 0, (Scheme_function_unknown) CL::smob_p);\ + scm_c_define_gsubr (FUNCNAME, 1, 0, 0, (Scheme_function_unknown) CL::smob_p);\ }\ ADD_SCM_INIT_FUNC (init_type_p_ ## CL, init_type_p_ ## CL) @@ -37,7 +37,7 @@ ADD_SCM_INIT_FUNC (init_type_p_ ## CL, init_type_p_ ## CL) #define IMPLEMENT_SIMPLE_SMOBS(CL) \ -long CL::smob_tag_; \ +scm_t_bits CL::smob_tag_; \ SCM \ CL::smob_p (SCM s) \ { \ @@ -50,15 +50,17 @@ CL::smob_p (SCM s) \ void \ CL::init_smobs () \ { \ - smob_tag_ = scm_make_smob_type_mfpe ( \ - #CL, 0, CL::mark_smob, CL::free_smob, CL::print_smob, \ - CL::equal_p); \ + smob_tag_ = scm_make_smob_type (#CL, 0); \ + scm_set_smob_mark (smob_tag_, CL::mark_smob); \ + scm_set_smob_free (smob_tag_, CL::free_smob); \ + scm_set_smob_print (smob_tag_, CL::print_smob); \ + scm_set_smob_equalp (smob_tag_, CL::equal_p); \ } \ SCM CL::smobbed_self () const \ { \ SCM s; \ s = gh_cons (SCM_PACK (CL::smob_tag_), SCM_PACK (this)); \ - scm_done_malloc (sizeof (CL)); \ + scm_done_malloc (sizeof (CL)); \ \ return s; \ } \ @@ -70,7 +72,7 @@ CL::unsmob (SCM s) \ else \ return 0; \ } \ -scm_sizet \ +size_t \ CL::free_smob (SCM ses) \ { \ CL * s = (CL*) SCM_CDR (ses); \ @@ -85,7 +87,7 @@ SCM \ CL::smobify_self () \ { \ SCM s = unprotected_smobify_self ();\ - scm_protect_object (s);\ + scm_gc_protect_object (s);\ return s;\ }\ SCM \ diff --git a/lily/include/scm-hash.hh b/lily/include/scm-hash.hh index c2169f3fdb..5b50c22c01 100644 --- a/lily/include/scm-hash.hh +++ b/lily/include/scm-hash.hh @@ -45,7 +45,7 @@ typedef std::map Scm_stl_map; 2. UPON DESTRUCTION, DO - scm_unprotect_object (tab->self_scm_); + scm_gc_unprotect_object (tab->self_scm_); diff --git a/lily/include/smobs.hh b/lily/include/smobs.hh index 45be2c08ae..a295473616 100644 --- a/lily/include/smobs.hh +++ b/lily/include/smobs.hh @@ -75,7 +75,7 @@ class Bla { Csmob *ptr; - ~Bla () { scm_unprotect_object (ptr->self_scm_); } + ~Bla () { scm_gc_unprotect_object (ptr->self_scm_); } }; @@ -104,9 +104,9 @@ protected: \ friend class Non_existant_class ; \ SCM smobbed_self () const; \ private:\ - static long smob_tag_; \ + static scm_t_bits smob_tag_; \ static SCM mark_smob (SCM); \ - static scm_sizet free_smob (SCM s); \ + static size_t free_smob (SCM s); \ static int print_smob (SCM s, SCM p, scm_print_state*); \ public: \ static SCM equal_p (SCM a, SCM b);\ diff --git a/lily/input-smob.cc b/lily/input-smob.cc index 5b6ad8b779..bd7061a3d0 100644 --- a/lily/input-smob.cc +++ b/lily/input-smob.cc @@ -28,8 +28,8 @@ print_smob (SCM s, SCM port, scm_print_state *) return 1; } -static -scm_sizet free_smob (SCM s) +static size_t +free_smob (SCM s) { delete unsmob_input (s); return 0; @@ -44,13 +44,15 @@ ly_input_p (SCM x) static void start_input_smobs () { - input_tag - = scm_make_smob_type_mfpe ("input", 0, - mark_smob, free_smob, - print_smob, 0); - scm_make_gsubr ("ly-input-location?", 1, 0, 0, (Scheme_function_unknown)ly_input_p); - -} + input_tag = scm_make_smob_type ("input", 0); + scm_set_smob_mark (input_tag, mark_smob); + scm_set_smob_free (input_tag, free_smob); + scm_set_smob_print (input_tag, print_smob); + scm_set_smob_equalp (input_tag, 0); + + scm_c_define_gsubr ("ly-input-location?", 1, 0, 0, + (Scheme_function_unknown)ly_input_p); + } SCM make_input (Input ip) @@ -70,7 +72,7 @@ unsmob_input (SCM s) { if (SCM_IMP (s)) return 0; - if ((long)SCM_CAR (s) == input_tag) // ugh. + if (SCM_CAR (s) == (SCM)input_tag) // ugh. return (Input*) SCM_CDR (s); else return 0; diff --git a/lily/item.cc b/lily/item.cc index 52f647f732..eeed9d86cc 100644 --- a/lily/item.cc +++ b/lily/item.cc @@ -160,7 +160,7 @@ Item::handle_prebroken_dependencies () SCM vis = get_grob_property ("visibility-lambda"); if (gh_procedure_p (vis)) { - SCM args = scm_listify (gh_int2scm (break_status_dir ()), SCM_UNDEFINED); + SCM args = scm_list_n (gh_int2scm (break_status_dir ()), SCM_UNDEFINED); SCM result = gh_apply (vis, args); bool trans = gh_scm2bool (gh_car (result)); bool empty = gh_scm2bool (gh_cdr (result)); diff --git a/lily/key-performer.cc b/lily/key-performer.cc index 74f702c6af..e945412924 100644 --- a/lily/key-performer.cc +++ b/lily/key-performer.cc @@ -47,9 +47,9 @@ Key_performer::create_audio_elements () if (key_req_l_) { SCM pitchlist = key_req_l_->get_mus_property ("pitch-alist"); - SCM proc = scm_eval2 (ly_symbol2scm ("accidentals-in-key"), SCM_EOL); + SCM proc = scm_primitive_eval (ly_symbol2scm ("accidentals-in-key")); SCM acc = gh_call1 (proc, pitchlist); - proc = scm_eval2 (ly_symbol2scm ("major-key"), SCM_EOL); + proc = scm_primitive_eval (ly_symbol2scm ("major-key")); SCM major = gh_call1 (proc, pitchlist); audio_p_ = new Audio_key (gh_scm2int (acc), major == SCM_BOOL_T); Audio_element_info info (audio_p_, key_req_l_); diff --git a/lily/lily-guile.cc b/lily/lily-guile.cc index 30ac299bf8..b474ab2849 100644 --- a/lily/lily-guile.cc +++ b/lily/lily-guile.cc @@ -45,7 +45,7 @@ ly_write2scm (SCM s) SCM_OPN | SCM_WRTNG, "ly_write2string"); // SCM write = scm_eval_3 (ly_symbol2scm ("write"), s, SCM_EOL); - SCM write = scm_eval2 (ly_symbol2scm ("write"), SCM_EOL); + SCM write = scm_primitive_eval (ly_symbol2scm ("write")); // scm_apply (write, port, SCM_EOL); gh_call2 (write, s, port); @@ -74,8 +74,8 @@ ly_parse_scm (char const* s, int* n) /* Read expression from port */ if (!SCM_EOF_OBJECT_P (form = scm_read (port))) - answer = scm_eval_3 (form, 1, SCM_EOL); // guh? - + answer = scm_primitive_eval (form); + /* After parsing @@ -126,7 +126,7 @@ String ly_symbol2string (SCM s) { assert (gh_symbol_p (s)); - return String ((Byte*)SCM_CHARS (s), (int) SCM_LENGTH (s)); + return String ((Byte*)SCM_STRING_CHARS (s), (int) SCM_STRING_LENGTH (s)); } @@ -183,8 +183,9 @@ String ly_scm2string (SCM s) { assert (gh_string_p (s)); - int len; - char * p = gh_scm2newstr (s , &len); + + size_t len; + char *p = gh_scm2newstr (s , &len); String r (p); @@ -452,12 +453,15 @@ ly_version () static void init_functions () { - scm_make_gsubr ("ly-warn", 1, 0, 0, (Scheme_function_unknown)ly_warning); - scm_make_gsubr ("ly-version", 0, 0, 0, (Scheme_function_unknown)ly_version); - scm_make_gsubr ("ly-gulp-file", 1,0, 0, (Scheme_function_unknown)ly_gulp_file); - scm_make_gsubr ("dir?", 1,0, 0, (Scheme_function_unknown)ly_isdir_p); - - scm_make_gsubr ("ly-number->string", 1, 0,0, (Scheme_function_unknown) ly_number2string); + scm_c_define_gsubr ("ly-warn", 1, 0, 0, + (Scheme_function_unknown)ly_warning); + scm_c_define_gsubr ("ly-version", 0, 0, 0, + (Scheme_function_unknown)ly_version); + scm_c_define_gsubr ("ly-gulp-file", 1,0, 0, + (Scheme_function_unknown)ly_gulp_file); + scm_c_define_gsubr ("dir?", 1,0, 0, (Scheme_function_unknown)ly_isdir_p); + scm_c_define_gsubr ("ly-number->string", 1, 0,0, + (Scheme_function_unknown) ly_number2string); #ifdef TEST_GC diff --git a/lily/line-of-score.cc b/lily/line-of-score.cc index b788a54857..9c70f62adb 100644 --- a/lily/line-of-score.cc +++ b/lily/line-of-score.cc @@ -52,7 +52,7 @@ Line_of_score::typeset_grob (Grob * elem_p) { elem_p->pscore_l_ = pscore_l_; Pointer_group_interface::add_element (this, "all-elements",elem_p); - scm_unprotect_object (elem_p->self_scm ()); + scm_gc_unprotect_object (elem_p->self_scm ()); } void diff --git a/lily/midi-item.cc b/lily/midi-item.cc index e095fbc125..2e9d260163 100644 --- a/lily/midi-item.cc +++ b/lily/midi-item.cc @@ -135,7 +135,7 @@ Midi_instrument::str() const { Byte program_byte = 0; bool found = false; - SCM proc = scm_eval2 (ly_symbol2scm ("midi-program"), SCM_EOL); + SCM proc = scm_primitive_eval (ly_symbol2scm ("midi-program")); SCM program = gh_call1 (proc, ly_symbol2scm (audio_l_->str_.ch_C())); found = (program != SCM_BOOL_F); if (found) diff --git a/lily/molecule.cc b/lily/molecule.cc index e577691f8f..b226c741e7 100644 --- a/lily/molecule.cc +++ b/lily/molecule.cc @@ -202,10 +202,10 @@ make_molecule (SCM expr, SCM xext, SCM yext) static void molecule_init () { - scm_make_gsubr ("ly-make-molecule", 3, 0, 0, (Scheme_function_unknown) make_molecule); - scm_make_gsubr ("ly-combine-molecule-at-edge", 5 , 0, 0, (Scheme_function_unknown) Molecule::ly_molecule_combined_at_edge); - scm_make_gsubr ("ly-set-molecule-extent!", 3 , 0, 0, (Scheme_function_unknown) Molecule::ly_set_molecule_extent_x); - scm_make_gsubr ("ly-get-molecule-extent", 2 , 0, 0, (Scheme_function_unknown) Molecule::ly_get_molecule_extent); + scm_c_define_gsubr ("ly-make-molecule", 3, 0, 0, (Scheme_function_unknown) make_molecule); + scm_c_define_gsubr ("ly-combine-molecule-at-edge", 5 , 0, 0, (Scheme_function_unknown) Molecule::ly_molecule_combined_at_edge); + scm_c_define_gsubr ("ly-set-molecule-extent!", 3 , 0, 0, (Scheme_function_unknown) Molecule::ly_set_molecule_extent_x); + scm_c_define_gsubr ("ly-get-molecule-extent", 2 , 0, 0, (Scheme_function_unknown) Molecule::ly_get_molecule_extent); } ADD_SCM_INIT_FUNC (molecule,molecule_init); diff --git a/lily/moment.cc b/lily/moment.cc index 8653e38514..ca6188f944 100644 --- a/lily/moment.cc +++ b/lily/moment.cc @@ -69,7 +69,7 @@ make_rational (SCM n, SCM d) void init_moments () { - scm_make_gsubr ("make-moment", 2 , 0, 0, (Scheme_function_unknown) make_rational); + scm_c_define_gsubr ("make-moment", 2 , 0, 0, (Scheme_function_unknown) make_rational); } ADD_SCM_INIT_FUNC (moms,init_moments); diff --git a/lily/music-list.cc b/lily/music-list.cc index 8b13789179..e69de29bb2 100644 --- a/lily/music-list.cc +++ b/lily/music-list.cc @@ -1 +0,0 @@ - diff --git a/lily/music-output-def.cc b/lily/music-output-def.cc index d3b6d7c7f6..c37cf1178b 100644 --- a/lily/music-output-def.cc +++ b/lily/music-output-def.cc @@ -37,8 +37,8 @@ Music_output_def::Music_output_def () translator_p_dict_p_ = new Scope (translator_tab_); smobify_self (); - scm_unprotect_object (variable_tab_->self_scm ()); - scm_unprotect_object (translator_tab_->self_scm ()); + scm_gc_unprotect_object (variable_tab_->self_scm ()); + scm_gc_unprotect_object (translator_tab_->self_scm ()); } Music_output_def::~Music_output_def () @@ -53,8 +53,8 @@ Music_output_def::Music_output_def (Music_output_def const &s) style_sheet_ = SCM_EOL; scaled_fonts_ = SCM_EOL; smobify_self (); - scm_unprotect_object (variable_tab_->self_scm ()); - scm_unprotect_object (translator_tab_->self_scm ()); + scm_gc_unprotect_object (variable_tab_->self_scm ()); + scm_gc_unprotect_object (translator_tab_->self_scm ()); scope_p_ = new Scope (variable_tab_); diff --git a/lily/music-sequence.cc b/lily/music-sequence.cc index 35c8bb16b3..47927f6cb9 100644 --- a/lily/music-sequence.cc +++ b/lily/music-sequence.cc @@ -48,7 +48,7 @@ Music_sequence::append_music (Music *m) { set_mus_property ("elements", gh_append2 (music_list (), gh_cons (m->self_scm (), SCM_EOL))); - scm_unprotect_object (m->self_scm ()); + scm_gc_unprotect_object (m->self_scm ()); } Music_sequence::Music_sequence (SCM l) diff --git a/lily/music.cc b/lily/music.cc index 1da9e5329f..edb75a4899 100644 --- a/lily/music.cc +++ b/lily/music.cc @@ -19,7 +19,7 @@ ly_deep_mus_copy (SCM m) if (unsmob_music (m)) { SCM ss = unsmob_music (m)->clone ()->self_scm (); - scm_unprotect_object (ss); + scm_gc_unprotect_object (ss); return ss; } else if (gh_pair_p (m)) @@ -284,7 +284,7 @@ ly_make_music (SCM type) else { SCM s = get_music (ly_scm2string (type))->self_scm (); - scm_unprotect_object (s); + scm_gc_unprotect_object (s); return s; } } @@ -307,10 +307,10 @@ ly_music_name (SCM mus) static void init_functions () { - scm_make_gsubr ("ly-get-mus-property", 2, 0, 0, (Scheme_function_unknown)ly_get_mus_property); - scm_make_gsubr ("ly-set-mus-property", 3, 0, 0, (Scheme_function_unknown)ly_set_mus_property); - scm_make_gsubr ("ly-make-music", 1, 0, 0, (Scheme_function_unknown)ly_make_music); - scm_make_gsubr ("ly-music-name", 1, 0, 0, (Scheme_function_unknown)ly_music_name); + scm_c_define_gsubr ("ly-get-mus-property", 2, 0, 0, (Scheme_function_unknown)ly_get_mus_property); + scm_c_define_gsubr ("ly-set-mus-property", 3, 0, 0, (Scheme_function_unknown)ly_set_mus_property); + scm_c_define_gsubr ("ly-make-music", 1, 0, 0, (Scheme_function_unknown)ly_make_music); + scm_c_define_gsubr ("ly-music-name", 1, 0, 0, (Scheme_function_unknown)ly_music_name); } ADD_SCM_INIT_FUNC (musicscm,init_functions); ADD_MUSIC(Music); diff --git a/lily/my-lily-lexer.cc b/lily/my-lily-lexer.cc index c27bf01d0d..9c07514277 100644 --- a/lily/my-lily-lexer.cc +++ b/lily/my-lily-lexer.cc @@ -146,7 +146,7 @@ My_lily_lexer::set_identifier (String name_str, SCM s) My_lily_lexer::~My_lily_lexer () { delete keytable_p_; - scm_unprotect_object (toplevel_variable_tab_->self_scm ()); + scm_gc_unprotect_object (toplevel_variable_tab_->self_scm ()); delete scope_p_ ; } diff --git a/lily/note-head.cc b/lily/note-head.cc index f7ef57ecc9..2a1c813a84 100644 --- a/lily/note-head.cc +++ b/lily/note-head.cc @@ -99,11 +99,10 @@ Note_head::brew_molecule (SCM smob) UGH: use grob-property. */ Molecule out = Font_interface::get_default_font (me)->find_by_name (String ("noteheads-") + - ly_scm2string (scm_eval2 (gh_list (ly_symbol2scm ("find-notehead-symbol"), + ly_scm2string (scm_primitive_eval (gh_list (ly_symbol2scm ("find-notehead-symbol"), me->get_grob_property ("duration-log"), ly_quote_scm (style), - SCM_UNDEFINED), - SCM_EOL))); + SCM_UNDEFINED)))); if (streepjes_i) { diff --git a/lily/paper-def.cc b/lily/paper-def.cc index 10e56f0883..0fcdd18fc7 100644 --- a/lily/paper-def.cc +++ b/lily/paper-def.cc @@ -140,7 +140,7 @@ Paper_def::find_font (SCM fn, Real m) SCM val = Scaled_font_metric::make_scaled_font_metric (f, m); scaled_fonts_ = scm_acons (key, val, scaled_fonts_); - scm_unprotect_object (val); + scm_gc_unprotect_object (val); return dynamic_cast (unsmob_metrics (val)); } diff --git a/lily/paper-outputter.cc b/lily/paper-outputter.cc index c146d194a3..59d4fb4ba5 100644 --- a/lily/paper-outputter.cc +++ b/lily/paper-outputter.cc @@ -77,8 +77,8 @@ Paper_outputter::output_header () SCM exp = gh_list (ly_symbol2scm ((output_format_global + "-scm").ch_C ()), ly_quote_scm (ly_symbol2scm ("all-definitions")), SCM_UNDEFINED); - exp = scm_eval2 (exp, SCM_EOL); - scm_eval2 (exp, SCM_EOL); + exp = scm_primitive_eval (exp); + scm_primitive_eval (exp); String creator = gnu_lilypond_version_str (); @@ -139,7 +139,7 @@ Paper_outputter::dump_scheme (SCM s) } else { - SCM result = scm_eval2 (s, SCM_EOL); + SCM result = scm_primitive_eval (s); char *c=gh_scm2newstr (result, NULL); *stream_p_ << c; diff --git a/lily/parser.yy b/lily/parser.yy index 46db204f92..157988a735 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -336,7 +336,7 @@ toplevel_expression: } | lilypond_header { if (global_header_p) - scm_unprotect_object (global_header_p->self_scm ()); + scm_gc_unprotect_object (global_header_p->self_scm ()); global_header_p = $1; } | score_block { @@ -440,22 +440,22 @@ all objects can be unprotected as soon as they're here. identifier_init: score_block { $$ = $1->self_scm (); - scm_unprotect_object ($$); + scm_gc_unprotect_object ($$); } | output_def { $$ = $1->self_scm (); - scm_unprotect_object ($$); + scm_gc_unprotect_object ($$); } | translator_spec_block { $$ = $1; } | Music { $$ = $1->self_scm (); - scm_unprotect_object ($$); + scm_gc_unprotect_object ($$); } | post_request { $$ = $1->self_scm (); - scm_unprotect_object ($$); + scm_gc_unprotect_object ($$); } | explicit_duration { $$ = $1; @@ -555,7 +555,7 @@ score_body: $$->set_spot (THIS->here_input ()); SCM m = $1->self_scm (); - scm_unprotect_object (m); + scm_gc_unprotect_object (m); $$->music_ = m; } | SCORE_IDENTIFIER { @@ -563,7 +563,7 @@ score_body: $$->set_spot (THIS->here_input ()); } | score_body lilypond_header { - scm_unprotect_object ($2->self_scm ()); + scm_gc_unprotect_object ($2->self_scm ()); $$->header_p_ = $2; } | score_body output_def { @@ -659,7 +659,7 @@ Music_list: /* empty */ { | Music_list Music { SCM s = $$; SCM c = gh_cons ($2->self_scm (), SCM_EOL); - scm_unprotect_object ($2->self_scm ()); /* UGH */ + scm_gc_unprotect_object ($2->self_scm ()); /* UGH */ if (gh_pair_p (gh_cdr (s))) gh_set_cdr_x (gh_cdr (s), c); /* append */ else @@ -703,7 +703,7 @@ Repeated_music: if (beg) { r-> set_mus_property ("body", beg->self_scm ()); - scm_unprotect_object (beg->self_scm ()); + scm_gc_unprotect_object (beg->self_scm ()); } r->set_mus_property ("repeat-count", gh_int2scm (times >? 1)); @@ -711,9 +711,9 @@ Repeated_music: { alts->truncate (times); r-> set_mus_property ("alternatives", alts->self_scm ()); - scm_unprotect_object (alts->self_scm ()); + scm_gc_unprotect_object (alts->self_scm ()); } - SCM func = scm_eval2 (ly_symbol2scm ("repeat-name-to-ctor"), SCM_EOL); + SCM func = scm_primitive_eval (ly_symbol2scm ("repeat-name-to-ctor")); SCM result = gh_call1 (func, $2); set_music_properties (r, result); @@ -787,7 +787,7 @@ Composite_music: CONTEXT STRING Music { Context_specced_music *csm = new Context_specced_music (SCM_EOL); csm->set_mus_property ("element", $3->self_scm ()); - scm_unprotect_object ($3->self_scm ()); + scm_gc_unprotect_object ($3->self_scm ()); csm->set_mus_property ("context-type",$2); csm->set_mus_property ("context-id", ly_str02scm ("")); @@ -799,7 +799,7 @@ Composite_music: chm->set_mus_property ("element", $3->self_scm ()); chm->set_mus_property ("iterator-ctor", Auto_change_iterator::constructor_cxx_function); - scm_unprotect_object ($3->self_scm ()); + scm_gc_unprotect_object ($3->self_scm ()); chm->set_mus_property ("what", $2); $$ = chm; @@ -821,14 +821,14 @@ Composite_music: if (stopm) { stopm = stopm->clone (); ms = gh_cons (stopm->self_scm (), ms); - scm_unprotect_object (stopm->self_scm ()); + scm_gc_unprotect_object (stopm->self_scm ()); } ms = gh_cons ($2->self_scm (), ms); - scm_unprotect_object ($2->self_scm()); + scm_gc_unprotect_object ($2->self_scm()); if (startm) { startm = startm->clone (); ms = gh_cons (startm->self_scm () , ms); - scm_unprotect_object (startm->self_scm ()); + scm_gc_unprotect_object (startm->self_scm ()); } Music* seq = new Sequential_music (SCM_EOL); @@ -836,11 +836,11 @@ Composite_music: $$ = new Grace_music (SCM_EOL); $$->set_mus_property ("element", seq->self_scm ()); - scm_unprotect_object (seq->self_scm ()); + scm_gc_unprotect_object (seq->self_scm ()); #else $$ = new Grace_music (SCM_EOL); $$->set_mus_property ("element", $2->self_scm ()); - scm_unprotect_object ($2->self_scm ()); + scm_gc_unprotect_object ($2->self_scm ()); #endif @@ -848,7 +848,7 @@ Composite_music: | CONTEXT string '=' string Music { Context_specced_music *csm = new Context_specced_music (SCM_EOL); csm->set_mus_property ("element", $5->self_scm ()); - scm_unprotect_object ($5->self_scm ()); + scm_gc_unprotect_object ($5->self_scm ()); csm->set_mus_property ("context-type", $2); csm->set_mus_property ("context-id", $4); @@ -869,7 +869,7 @@ Composite_music: $$->set_mus_property ("element", mp->self_scm ()); - scm_unprotect_object (mp->self_scm ()); + scm_gc_unprotect_object (mp->self_scm ()); $$->set_mus_property ("numerator", gh_int2scm (n)); $$->set_mus_property ("denominator", gh_int2scm (d)); $$->compress (Moment (n,d)); @@ -885,7 +885,7 @@ Composite_music: p->transpose (pit); $$->set_mus_property ("element", p->self_scm ()); - scm_unprotect_object (p->self_scm ()); + scm_gc_unprotect_object (p->self_scm ()); } | TRANSPOSE steno_tonic_pitch Music { $$ = new Transposed_music (SCM_EOL); @@ -894,7 +894,7 @@ Composite_music: p->transpose (pit); $$->set_mus_property ("element", p->self_scm ()); - scm_unprotect_object (p->self_scm ()); + scm_gc_unprotect_object (p->self_scm ()); } | APPLY embedded_scm Music { @@ -941,7 +941,7 @@ relative_music: $$ = new Relative_octave_music (SCM_EOL); $$->set_mus_property ("element", p->self_scm ()); - scm_unprotect_object (p->self_scm ()); + scm_gc_unprotect_object (p->self_scm ()); $$->set_mus_property ("last-pitch", p->to_relative_octave (pit).smobbed_copy ()); @@ -953,8 +953,8 @@ re_rhythmed_music: Lyric_combine_music * l = new Lyric_combine_music (SCM_EOL); l->set_mus_property ("music", $2->self_scm ()); l->set_mus_property ("lyrics", $3->self_scm ()); - scm_unprotect_object ($3->self_scm ()); - scm_unprotect_object ($2->self_scm ()); + scm_gc_unprotect_object ($3->self_scm ()); + scm_gc_unprotect_object ($2->self_scm ()); $$ = l; } ; @@ -967,8 +967,8 @@ part_combined_music: p->set_mus_property ("one", $3->self_scm ()); p->set_mus_property ("two", $4->self_scm ()); - scm_unprotect_object ($3->self_scm ()); - scm_unprotect_object ($4->self_scm ()); + scm_gc_unprotect_object ($3->self_scm ()); + scm_gc_unprotect_object ($4->self_scm ()); $$ = p; @@ -995,7 +995,7 @@ property_def: Context_specced_music *csm = new Context_specced_music (SCM_EOL); csm->set_mus_property ("element", t->self_scm ()); - scm_unprotect_object (t->self_scm ()); + scm_gc_unprotect_object (t->self_scm ()); $$ = csm; $$->set_spot (THIS->here_input ()); @@ -1011,7 +1011,7 @@ property_def: Context_specced_music *csm = new Context_specced_music (SCM_EOL); csm->set_mus_property ("element", t->self_scm ()); - scm_unprotect_object (t->self_scm ()); + scm_gc_unprotect_object (t->self_scm ()); $$ = csm; $$->set_spot (THIS->here_input ()); @@ -1028,7 +1028,7 @@ property_def: t->set_mus_property ("grob-value", $8); Context_specced_music *csm = new Context_specced_music (SCM_EOL); csm->set_mus_property ("element", t->self_scm ()); - scm_unprotect_object (t->self_scm ()); + scm_gc_unprotect_object (t->self_scm ()); $$ = csm; $$->set_spot (THIS->here_input ()); @@ -1043,7 +1043,7 @@ property_def: t->set_mus_property ("grob-value", $8); Context_specced_music *csm = new Context_specced_music (SCM_EOL); csm->set_mus_property ("element", t->self_scm ()); - scm_unprotect_object (t->self_scm ()); + scm_gc_unprotect_object (t->self_scm ()); $$ = csm; $$->set_spot (THIS->here_input ()); @@ -1059,7 +1059,7 @@ property_def: Context_specced_music *csm = new Context_specced_music (SCM_EOL); csm->set_mus_property ("element", t->self_scm ()); - scm_unprotect_object (t->self_scm ()); + scm_gc_unprotect_object (t->self_scm ()); $$ = csm; $$->set_spot (THIS->here_input ()); @@ -1104,7 +1104,7 @@ command_element: Context_specced_music *csm = new Context_specced_music (SCM_EOL); csm->set_mus_property ("element", t->self_scm ()); - scm_unprotect_object (t->self_scm ()); + scm_gc_unprotect_object (t->self_scm ()); $$ = csm; $$->set_spot (THIS->here_input ()); @@ -1117,13 +1117,13 @@ command_element: Context_specced_music * sp = new Context_specced_music (SCM_EOL); sp->set_mus_property ("element", p->self_scm ()); - scm_unprotect_object (p->self_scm ()); + scm_gc_unprotect_object (p->self_scm ()); $$ =sp ; sp-> set_mus_property ("context-type", ly_str02scm ( "Score")); } | CLEF STRING { - SCM func = scm_eval2 (ly_symbol2scm ("clef-name-to-properties"), SCM_EOL); + SCM func = scm_primitive_eval (ly_symbol2scm ("clef-name-to-properties")); SCM result = gh_call1 (func, $2); SCM l = SCM_EOL; @@ -1131,14 +1131,14 @@ command_element: Music * p = new Music (SCM_EOL); set_music_properties (p, gh_car (s)); l = gh_cons (p->self_scm (), l); - scm_unprotect_object (p->self_scm ()); + scm_gc_unprotect_object (p->self_scm ()); } Sequential_music * seq = new Sequential_music (SCM_EOL); seq->set_mus_property ("elements", l); Context_specced_music * sp = new Context_specced_music (SCM_EOL); sp->set_mus_property ("element", seq->self_scm ()); - scm_unprotect_object (seq->self_scm ()); + scm_gc_unprotect_object (seq->self_scm ()); $$ =sp ; sp-> set_mus_property ("context-type", ly_str02scm ("Staff")); @@ -1166,10 +1166,10 @@ command_element: - scm_unprotect_object (p3->self_scm ()); - scm_unprotect_object (p2->self_scm ()); - scm_unprotect_object (p1->self_scm ()); - scm_unprotect_object (seq->self_scm ()); + scm_gc_unprotect_object (p3->self_scm ()); + scm_gc_unprotect_object (p2->self_scm ()); + scm_gc_unprotect_object (p1->self_scm ()); + scm_gc_unprotect_object (seq->self_scm ()); $$ = sp; @@ -1959,7 +1959,7 @@ string: $$ = $1; } | string '+' string { - $$ = scm_string_append (scm_listify ($1, $3, SCM_UNDEFINED)); + $$ = scm_string_append (scm_list_n ($1, $3, SCM_UNDEFINED)); } ; diff --git a/lily/part-combine-music-iterator.cc b/lily/part-combine-music-iterator.cc index 68d0516ff5..65596d0ad3 100644 --- a/lily/part-combine-music-iterator.cc +++ b/lily/part-combine-music-iterator.cc @@ -202,11 +202,10 @@ Part_combine_music_iterator::get_state (Moment) if (first_pitches != SCM_EOL && second_pitches != SCM_EOL) { scm_sort_list_x (first_pitches, - scm_eval2 (ly_str02scm ("Pitch::less_p"), - SCM_EOL)); + scm_primitive_eval (ly_str02scm ("Pitch::less_p"))); scm_sort_list_x (second_pitches, - scm_eval2 (ly_str02scm ("Pitch::less_p"), - SCM_EOL)); + scm_primitive_eval (ly_str02scm ("Pitch::less_p"))); + interval = gh_int2scm (unsmob_pitch (gh_car (first_pitches))->steps () - unsmob_pitch (gh_car (scm_last_pair (second_pitches)))->steps ()); } @@ -214,16 +213,14 @@ Part_combine_music_iterator::get_state (Moment) if (first_durations != SCM_EOL) { scm_sort_list_x (first_durations, - scm_eval2 (ly_str02scm ("Duration::less_p"), - SCM_EOL)); + scm_primitive_eval (ly_str02scm ("Duration::less_p"))); first_mom += unsmob_duration (gh_car (first_durations))->length_mom (); } if (second_durations != SCM_EOL) { scm_sort_list_x (second_durations, - scm_eval2 (ly_str02scm ("Duration::less_p"), - SCM_EOL)); + scm_primitive_eval (ly_str02scm ("Duration::less_p"))); second_mom += unsmob_duration (gh_car (second_durations))->length_mom (); } diff --git a/lily/pitch.cc b/lily/pitch.cc index f4052b28c9..aa7774debc 100644 --- a/lily/pitch.cc +++ b/lily/pitch.cc @@ -355,13 +355,13 @@ static void add_funcs () { // should take list?: (make-pitch ' (octave name accidental)) - scm_make_gsubr ("make-pitch", 3, 0, 0, (Scheme_function_unknown)make_pitch); + scm_c_define_gsubr ("make-pitch", 3, 0, 0, (Scheme_function_unknown)make_pitch); - scm_make_gsubr ("pitch-octave", 1, 0, 0, (Scheme_function_unknown)pitch_octave); - scm_make_gsubr ("pitch-notename", 1, 0, 0, (Scheme_function_unknown)pitch_notename); - scm_make_gsubr ("pitch-alteration", 1, 0, 0, (Scheme_function_unknown)pitch_alteration); - scm_make_gsubr ("pitch-semitones", 1, 0, 0, (Scheme_function_unknown)pitch_semitones); - scm_make_gsubr ("Pitch::transpose", 2, 0, 0, (Scheme_function_unknown) pitch_transpose); + scm_c_define_gsubr ("pitch-octave", 1, 0, 0, (Scheme_function_unknown)pitch_octave); + scm_c_define_gsubr ("pitch-notename", 1, 0, 0, (Scheme_function_unknown)pitch_notename); + scm_c_define_gsubr ("pitch-alteration", 1, 0, 0, (Scheme_function_unknown)pitch_alteration); + scm_c_define_gsubr ("pitch-semitones", 1, 0, 0, (Scheme_function_unknown)pitch_semitones); + scm_c_define_gsubr ("Pitch::transpose", 2, 0, 0, (Scheme_function_unknown) pitch_transpose); } ADD_SCM_INIT_FUNC (pitch, add_funcs); diff --git a/lily/property-engraver.cc b/lily/property-engraver.cc index 57a6e04e9a..6209637314 100644 --- a/lily/property-engraver.cc +++ b/lily/property-engraver.cc @@ -51,7 +51,7 @@ Property_engraver::finalize () Property_engraver::~Property_engraver () { if (prop_dict_) - scm_unprotect_object (prop_dict_->self_scm ()); + scm_gc_unprotect_object (prop_dict_->self_scm ()); } void @@ -111,7 +111,7 @@ Property_engraver::apply_properties (SCM p, Grob *e, Translator_group*origin) if (val == SCM_EOL) ; // Not defined in context. - else if (gh_apply (type_p, scm_listify (val, SCM_UNDEFINED)) + else if (gh_apply (type_p, scm_list_n (val, SCM_UNDEFINED)) == SCM_BOOL_T) // defined and right type: do it { e->set_grob_property (elt_prop_sym, val); @@ -140,7 +140,7 @@ Property_engraver::apply_properties (SCM p, Grob *e, Translator_group*origin) if (val != SCM_EOL) { // not the right type: error message. SCM errport = scm_current_error_port (); - SCM typefunc = scm_eval2 (ly_symbol2scm ("type-name"), SCM_EOL); + SCM typefunc = scm_primitive_eval (ly_symbol2scm ("type-name")); SCM type_name = gh_call1 (typefunc, type_p); warning (_f ("Wrong type for property: %s, type: %s, value found: %s, type: %s", ly_symbol2string (prop_sym).ch_C (), diff --git a/lily/protected-scm.cc b/lily/protected-scm.cc index 3c4bcfabf6..7e22baa550 100644 --- a/lily/protected-scm.cc +++ b/lily/protected-scm.cc @@ -17,12 +17,12 @@ Protected_scm::Protected_scm () Protected_scm::Protected_scm (SCM s) { - object_ = SCM_NIMP (s) ? scm_protect_object (s): s; + object_ = SCM_NIMP (s) ? scm_gc_protect_object (s): s; } Protected_scm::Protected_scm (Protected_scm const &s) { - object_ = SCM_NIMP (s.object_) ? scm_protect_object (s.object_) : s.object_; + object_ = SCM_NIMP (s.object_) ? scm_gc_protect_object (s.object_) : s.object_; } Protected_scm & @@ -32,9 +32,9 @@ Protected_scm::operator = (SCM s) return *this; if (SCM_NIMP (object_)) - scm_unprotect_object (object_); + scm_gc_unprotect_object (object_); - object_ = SCM_NIMP (s) ? scm_protect_object (s): s; + object_ = SCM_NIMP (s) ? scm_gc_protect_object (s): s; return *this; } @@ -49,7 +49,7 @@ Protected_scm::~Protected_scm () { if (SCM_NIMP (object_)) { - scm_unprotect_object (object_); + scm_gc_unprotect_object (object_); } } diff --git a/lily/scm-option.cc b/lily/scm-option.cc index b98327d1a3..525c2e54f3 100644 --- a/lily/scm-option.cc +++ b/lily/scm-option.cc @@ -101,7 +101,7 @@ set_lily_option (SCM var, SCM val) static void init_functions () { - scm_make_gsubr ("set-lily-option", 2, 0, 0, (Scheme_function_unknown)set_lily_option); + scm_c_define_gsubr ("set-lily-option", 2, 0, 0, (Scheme_function_unknown)set_lily_option); } diff --git a/lily/score.cc b/lily/score.cc index 962f820257..ae6cf4173d 100644 --- a/lily/score.cc +++ b/lily/score.cc @@ -44,7 +44,7 @@ Score::Score (Score const &s) Music * m =unsmob_music (s.music_); music_ = m?m->clone ()->self_scm () : SCM_EOL; - scm_unprotect_object (music_); + scm_gc_unprotect_object (music_); for (int i=0; i < s.def_p_arr_.size (); i++) def_p_arr_.push (s.def_p_arr_[i]->clone ()); @@ -53,7 +53,7 @@ Score::Score (Score const &s) { header_p_ = (s.header_p_) ? new Scheme_hash_table (*s.header_p_): 0; - scm_unprotect_object (header_p_->self_scm ()); + scm_gc_unprotect_object (header_p_->self_scm ()); } } @@ -106,7 +106,7 @@ Score::run_translator (Music_output_def *odef_l) } Music_output * output = trans_p->get_output_p (); - scm_unprotect_object (trans_p->self_scm ()); + scm_gc_unprotect_object (trans_p->self_scm ()); if (verbose_global_b) progress_indication (_f ("elapsed time: %.2f seconds", timer.read ())); diff --git a/lily/scores.cc b/lily/scores.cc index c711d24a2b..06a65014a9 100644 --- a/lily/scores.cc +++ b/lily/scores.cc @@ -118,12 +118,12 @@ void clear_scores () { for (int i=0; i < score_global_array.size (); i++) - scm_unprotect_object (score_global_array[i]->self_scm ()); + scm_gc_unprotect_object (score_global_array[i]->self_scm ()); score_global_array.clear (); inclusion_global_array.clear (); if (global_header_p) - scm_unprotect_object (global_header_p ->self_scm ()); + scm_gc_unprotect_object (global_header_p ->self_scm ()); global_header_p =0; } diff --git a/lily/slur.cc b/lily/slur.cc index 33d0ce5757..d48c91d7b6 100644 --- a/lily/slur.cc +++ b/lily/slur.cc @@ -336,7 +336,7 @@ Slur::get_attachment (Grob *me, Direction dir, int stemdir = stem ? Stem::get_direction (stem) : 1; int slurdir = gh_scm2int (me->get_grob_property ("direction")); SCM l = scm_assoc - (scm_listify (a, + (scm_list_n (a, gh_int2scm (stemdir * dir), gh_int2scm (slurdir * dir), SCM_UNDEFINED), alist); diff --git a/lily/spanner.cc b/lily/spanner.cc index 0fba92f847..15f0ad8a8c 100644 --- a/lily/spanner.cc +++ b/lily/spanner.cc @@ -287,7 +287,7 @@ Spanner::do_derived_mark () { /* We'd be fucked if this is called before spanned_drul_[] is inited. */ - if (status_i_ == ORPHAN) + if (status_c_ == ORPHAN) return SCM_EOL; Direction d = LEFT; diff --git a/lily/staff-performer.cc b/lily/staff-performer.cc index f79bf760f2..aee7edc6a0 100644 --- a/lily/staff-performer.cc +++ b/lily/staff-performer.cc @@ -91,7 +91,7 @@ Staff_performer::create_audio_elements () void Staff_performer::stop_translation_timestep () { - SCM proc = scm_eval2 (ly_symbol2scm ("percussion-p"), SCM_EOL); + SCM proc = scm_primitive_eval (ly_symbol2scm ("percussion-p")); SCM drums_p = gh_call1 (proc, ly_symbol2scm (instrument_str_.ch_C())); audio_staff_p_->channel_i_ = (drums_p == SCM_BOOL_T ? 9 : -1 ); if (name_p_) diff --git a/lily/stem.cc b/lily/stem.cc index aca140aaf7..1e229e1f0f 100644 --- a/lily/stem.cc +++ b/lily/stem.cc @@ -450,7 +450,7 @@ Stem::set_spacing_hints (Grob*me) Item* item = dynamic_cast (me); Item * col = item->column_l (); SCM dirlist =col->get_grob_property ("dir-list"); - if (scm_sloppy_memq (scmdir, dirlist) == SCM_BOOL_F) + if (scm_c_memq (scmdir, dirlist) == SCM_BOOL_F) { dirlist = gh_cons (scmdir, dirlist); col->set_grob_property ("dir-list", dirlist); diff --git a/lily/translator-def.cc b/lily/translator-def.cc index aa33ce33fa..aaec32d796 100644 --- a/lily/translator-def.cc +++ b/lily/translator-def.cc @@ -231,7 +231,7 @@ trans_list (SCM namelist, Translator_group*tg) tr->daddy_trans_l_ = tg; tr->output_def_l_ = tg->output_def_l_; - scm_unprotect_object (str); + scm_gc_unprotect_object (str); } } return l; diff --git a/lily/translator-group.cc b/lily/translator-group.cc index 2643670a0a..b91088d5a0 100644 --- a/lily/translator-group.cc +++ b/lily/translator-group.cc @@ -21,7 +21,7 @@ Translator_group::Translator_group (Translator_group const&s) Scheme_hash_table * tab = new Scheme_hash_table (*s.properties_dict ()); properties_scm_ = tab->self_scm (); - scm_unprotect_object (tab->self_scm ()); + scm_gc_unprotect_object (tab->self_scm ()); } Scheme_hash_table* @@ -43,7 +43,7 @@ Translator_group::Translator_group () Scheme_hash_table *tab = new Scheme_hash_table ; properties_scm_ = tab->self_scm (); - scm_unprotect_object (tab->self_scm ()); + scm_gc_unprotect_object (tab->self_scm ()); } void @@ -421,7 +421,7 @@ type_check_assignment (SCM val, SCM sym, SCM type_symbol) { SCM errport = scm_current_error_port (); ok = false; - SCM typefunc = scm_eval2 (ly_symbol2scm ("type-name"), SCM_EOL); + SCM typefunc = scm_primitive_eval (ly_symbol2scm ("type-name")); SCM type_name = gh_call1 (typefunc, type_p); scm_puts (_f ("Type check for `%s' failed; value `%s' must be of type `%s'", @@ -468,8 +468,8 @@ ly_set_trans_property (SCM context, SCM name, SCM val) void add_trans_scm_funcs () { - scm_make_gsubr ("ly-get-trans-property", 2, 0, 0, (Scheme_function_unknown)ly_get_trans_property); - scm_make_gsubr ("ly-set-trans-property", 3, 0, 0, (Scheme_function_unknown)ly_set_trans_property); + scm_c_define_gsubr ("ly-get-trans-property", 2, 0, 0, (Scheme_function_unknown)ly_get_trans_property); + scm_c_define_gsubr ("ly-set-trans-property", 3, 0, 0, (Scheme_function_unknown)ly_set_trans_property); } ADD_SCM_INIT_FUNC (trans_scm, add_trans_scm_funcs); diff --git a/ly/params-init.ly b/ly/params-init.ly index 64fe88deee..39574c1b40 100644 --- a/ly/params-init.ly +++ b/ly/params-init.ly @@ -22,6 +22,8 @@ staffspace = \staffheight / 4.0 stafflinethickness = \staffspace / 10.0 outputscale = \staffheight / 4.0 +blotdiameter = 0.4 / \outputscale + \translator { \NoteNamesContext } \translator { \ScoreContext } \translator { \ChoirStaffContext} diff --git a/mf/feta-params.mf b/mf/feta-params.mf index 702604002a..34c91ff0c2 100644 --- a/mf/feta-params.mf +++ b/mf/feta-params.mf @@ -7,10 +7,10 @@ staff_space#:=staffsize#/(stafflines-1); %font_x_height staff_space# ; % -% [D.K.Roush & J.S.Gourlay] say this should be 0.072 +% [D.K.Roush & J.S.Gourlay] say this should be 0.072 % We know better -% generally, the "blackness" of most chars depends on this. -% +% FIXME: generally, the "blackness" of most chars depends on this. +% these dimensions should be independent. stafflinethickness#:=0.1 staff_space#; stemthickness# := stafflinethickness#; @@ -35,8 +35,8 @@ overdone_heads = 0.0; % % this is not a meta variable: it is related to absolute sizes. % -% According to [Wanske], only outside corners should be round -% +% FIXME: According to [Wanske], only outside corners should be round +% I don't think we do this anywhere -- jcn numeric blot_diameter; blot_diameter# = .4pt#; if (blot_diameter# * hppp) < 1: diff --git a/ps/music-drawing-routines.ps b/ps/music-drawing-routines.ps index 0671b23e85..0b1ddcf9c3 100644 --- a/ps/music-drawing-routines.ps +++ b/ps/music-drawing-routines.ps @@ -2,6 +2,8 @@ % % Functions for direct and embedded PostScript +/blot-diameter { lilypondpaperblotdiameter } bind def + /euclidean_length { 1 copy mul exch 1 copy mul add sqrt @@ -15,26 +17,26 @@ %% FIXME: hardcoded currentdict /testing known { %% real thin lines for testing - /l 0.005 def + /blot 0.005 def }{ - /l 0.05 def + /blot blot-diameter def } ifelse 0 setlinecap - l setlinewidth + blot setlinewidth 1 setlinejoin - l 2 div sub /h exch def - l 2 div sub /d exch def + blot 2 div sub /h exch def + blot 2 div sub /d exch def %% UGH huh? %% Where does this correction come from? %% Why don't we need this in x direction? - h l 2 div sub /h exch def - d l 2 div sub /d exch def + h blot 2 div sub /h exch def + d blot 2 div sub /d exch def - l 2 div sub /w exch def - l 2 div sub /b exch def + blot 2 div sub /w exch def + blot 2 div sub /b exch def b neg d neg moveto b w add 0 rlineto @@ -57,20 +59,20 @@ %% FIXME: hardcoded currentdict /testing known { %% real thin lines for testing - /l 0.01 def + /blot 0.005 def }{ - /l 0.1 def + /blot blot-diameter def } ifelse - l 2 div setlinewidth + blot setlinewidth 0 setlinecap 1 setlinejoin - l sub /t exch def - l sub /w exch def + blot 2 mul sub /t exch def + blot 2 mul sub /w exch def w mul /h exch def - l 2 div t 2 div neg moveto + blot t 2 div neg moveto w h rlineto 0 t rlineto w neg h neg rlineto diff --git a/scm/ascii-script.scm b/scm/ascii-script.scm index ddbeacd7c1..b899092088 100644 --- a/scm/ascii-script.scm +++ b/scm/ascii-script.scm @@ -269,4 +269,4 @@ ) (define (scm-as-output) - (ly-eval (as-scm 'all-definitions))) + (primitive-eval (as-scm 'all-definitions))) diff --git a/scm/chord-name.scm b/scm/chord-name.scm index 454c70c1f3..52afa03421 100644 --- a/scm/chord-name.scm +++ b/scm/chord-name.scm @@ -343,7 +343,7 @@ bass-and-inversion steps))) (define (chord::restyle name style) - (ly-eval (string->symbol + (primitive-eval (string->symbol (string-append (symbol->string name) (symbol->string style))))) diff --git a/scm/drums.scm b/scm/drums.scm index 187844cd5d..683f0d29b4 100644 --- a/scm/drums.scm +++ b/scm/drums.scm @@ -1,7 +1,7 @@ ;;;; drum-"hack". See input/tricks/drums.ly and ly/drumpitch.ly ;;;; 2001/03/25 Rune Zedeler -;;;; changed eval to ly-eval for guile 1.4/1.4.1 compatibility --jcn +;;;; changed eval to primitive-eval for guile 1.4/1.4.1 compatibility --jcn (define (seq-music-list elts) (let* ( (ml (ly-make-music "Sequential_music")) ) @@ -100,7 +100,7 @@ (begin (display p) ;; UGH. FIXME. pitch->string ??? (ly-warn " unknown drumpitch.") - (cdar (ly-eval kit)) + (cdar (primitive-eval kit)) )) ((eq? p (caddr (car pitches))) ((name->paper kit) (caar pitches)) ) (else (p2p (cdr pitches) ) ) @@ -108,12 +108,12 @@ ) ) (define ((name->paper kit) n) - (let n2p ((pitches (ly-eval kit))) + (let n2p ((pitches (primitive-eval kit))) (cond ((eq? pitches '()) (begin (ly-warn (string-append "Kit `" (symbol->string kit) "' doesn't contain drum `" n "'\nSee lily/drumpitch.ly for supported drums.")) - (cdar (ly-eval kit)) + (cdar (primitive-eval kit)) )) ((eq? n (caar pitches)) (cdar pitches) ) (else (n2p (cdr pitches) ) ) diff --git a/scm/interface-description.scm b/scm/interface-description.scm index 2328a217cc..99cf6c7128 100644 --- a/scm/interface-description.scm +++ b/scm/interface-description.scm @@ -773,7 +773,7 @@ direction = Forced direction for all ties" )) -(ly-eval (cons +(primitive-eval (cons 'begin (map (lambda (x) (list 'define (car x) (list 'quote (cdr x)))) all-interfaces))) diff --git a/scm/lily.scm b/scm/lily.scm index a0bfc1dec2..b8f28858fe 100644 --- a/scm/lily.scm +++ b/scm/lily.scm @@ -54,7 +54,9 @@ ;;; Un-assorted stuff ;; URG guile-1.4/1.4.x compatibility -(define (ly-eval x) (eval2 x #f)) +(if (not (defined? 'primitive-eval)) + (define (primitive-eval form) + (eval2 form #f))) (define (sign x) (if (= x 0) diff --git a/scm/pdf.scm b/scm/pdf.scm index b5a3cb6352..50c674e88f 100644 --- a/scm/pdf.scm +++ b/scm/pdf.scm @@ -281,7 +281,7 @@ ) (define (scm-pdf-output) - (ly-eval (pdf-scm 'all-definitions))) + (primitive-eval (pdf-scm 'all-definitions))) ; Local Variables: ; scheme-program-name: "guile" diff --git a/scm/pdftex.scm b/scm/pdftex.scm index 01d16ec145..736cf9bcbf 100644 --- a/scm/pdftex.scm +++ b/scm/pdftex.scm @@ -245,4 +245,4 @@ ) (define (scm-pdftex-output) - (ly-eval (pdftex-scm 'all-definitions))) + (primitive-eval (pdftex-scm 'all-definitions))) diff --git a/scm/ps.scm b/scm/ps.scm index 8e4dc95ecf..9875dd3904 100644 --- a/scm/ps.scm +++ b/scm/ps.scm @@ -258,4 +258,4 @@ lilypondpaperoutputscale lilypondpaperoutputscale scale ) (define (scm-ps-output) - (ly-eval (ps-scm 'all-definitions))) + (primitive-eval (ps-scm 'all-definitions))) diff --git a/scm/tex.scm b/scm/tex.scm index fb5b8df7db..794dbc80b1 100644 --- a/scm/tex.scm +++ b/scm/tex.scm @@ -255,4 +255,4 @@ ) (define (scm-tex-output) - (ly-eval (tex-scm 'all-definitions))) + (primitive-eval (tex-scm 'all-definitions))) diff --git a/stepmake/aclocal.m4 b/stepmake/aclocal.m4 index a7d59a36f0..720f2db629 100644 --- a/stepmake/aclocal.m4 +++ b/stepmake/aclocal.m4 @@ -203,9 +203,15 @@ else {last =0}} then AC_STEPMAKE_WARN("Guile version "$need_guile_version" or newer is needed") fi + changequote(<<, >>)dnl + GUILE_MAJOR_VERSION=`expr $guile_version : '\([0-9]*\)'` + GUILE_MINOR_VERSION=`expr $guile_version : '[0-9]*\.\([0-9]*\)'` + changequote([, ])dnl GUILE_FLAGS AC_PATH_PROG(GUILE, guile, error) AC_SUBST(GUILE) + AC_DEFINE_UNQUOTED(GUILE_MAJOR_VERSION, $GUILE_MAJOR_VERSION) + AC_DEFINE_UNQUOTED(GUILE_MINOR_VERSION, $GUILE_MINOR_VERSION) ]) AC_DEFUN(AC_STEPMAKE_INIT, [