From: Jan Nieuwenhuizen Date: Sat, 14 Aug 1999 19:53:12 +0000 (+0200) Subject: patch::: 1.2.0.jcn1 X-Git-Tag: release/1.2.1~2 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=4bbc3761de1012c805f55bc957cb9c7c35ef3ddc;p=lilypond.git patch::: 1.2.0.jcn1 pl 0.jcn1 - gcc-2.95 nitpicks - added pointers to mailing lists in toplevel docs --- diff --git a/BUGS b/BUGS index 5fe9ab69ee..53ffd70c9e 100644 --- a/BUGS +++ b/BUGS @@ -1,6 +1,10 @@ This documents serious bugs +Send bug reports to bug-gnu-music@gnu.org. For help and questions use +help-gnu-music@gnu.org and gnu-music-discuss@gnu.org. Please consult +the faq before mailing your problems. + ******** [LinuxPPC-R5, egcs-1.1.2-12c] @@ -9,7 +13,7 @@ Serious egcs-1.1.2-12c (stock LinuxPPC R5) bug on ppc: *dest++ = *src++; -Bug report filed, fixed in egcs-1.1.2-12f. +Bug report filed, fixed in egcs-1.1.2-12f or gcc-2.95-0a. Although we've currently got a workaround in place, the compiler is buggy; you should upgrade: diff --git a/Documentation/topdocs/INSTALL.yo b/Documentation/topdocs/INSTALL.yo index 68b71af9b4..10b600bec1 100644 --- a/Documentation/topdocs/INSTALL.yo +++ b/Documentation/topdocs/INSTALL.yo @@ -305,6 +305,12 @@ label(w32) Separate instructions on building for W32 are avaible url(in the file README-W32.yo)(../../DOEXPAND(outdir)/README-W32.html). +sect(BUGS) + +Send bug reports to bug-gnu-music@gnu.org. For help and questions use +help-gnu-music@gnu.org and gnu-music-discuss@gnu.org. Please consult +the faq before mailing your problems. + sect(AUTHORS) nemail(Han-Wen Nienhuys)(hanwen@cs.uu.nl) diff --git a/Documentation/topdocs/README.yo b/Documentation/topdocs/README.yo index 7e94380736..c5633cae31 100644 --- a/Documentation/topdocs/README.yo +++ b/Documentation/topdocs/README.yo @@ -90,6 +90,13 @@ verb(rm `find /var/lib/texmf/fonts -name 'feta*'`) a script to do this for you is in file(buildscripts/clean-fonts.sh) +sect(BUGS) + +Send bug reports to bug-gnu-music@gnu.org. For help and questions use +help-gnu-music@gnu.org and gnu-music-discuss@gnu.org. Please consult +the faq before mailing your problems. + + sect(CDROM DISTRIBUTIONS) If you have received LilyPond on a cdrom, chances are that development diff --git a/NEWS b/NEWS index effe4a6120..aa8a93aea1 100644 --- a/NEWS +++ b/NEWS @@ -1,29 +1,3 @@ - -WHAT'S NEW? - -* Large cleanups, enhanced design and GUILE integration for smaller - memory footprint and more flexible code. - -* Direct output to PostScript (optional), PDFTeX or as GUILE script - (default output still to plain TeX). - -* Convertors for ABC and MUP formats. - -* Font: now available as scalable PostScript. New glyphs: time - signature, more note heads. - -* Enhanced input: semi-automatic beaming, (nested) tuplets, (nested) - repeats, chordnames, automatic Lyrics - durations. - -* Grace notes, volta brackets, multiple styles for note heads and - time signatures, breathing signs, lyric extenders, cross staff - beaming and slurring. - -* --safe option for the paranoid. - -* More elegant spacing. Text is spaced exactly. - -* Lots of bugfixes. - - +pl 0.jcn1 + - gcc-2.95 nitpicks + - added pointers to mailing lists in toplevel docs diff --git a/VERSION b/VERSION index b021b69902..181d5b07c3 100644 --- a/VERSION +++ b/VERSION @@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond MAJOR_VERSION=1 MINOR_VERSION=2 PATCH_LEVEL=0 -MY_PATCH_LEVEL=jbr1 +MY_PATCH_LEVEL=jcn1 # use the above to send patches: MY_PATCH_LEVEL is always empty for a # released version. diff --git a/flower/include/dictionary-iter.hh b/flower/include/dictionary-iter.hh index 2cf455ef8f..966211bdaa 100644 --- a/flower/include/dictionary-iter.hh +++ b/flower/include/dictionary-iter.hh @@ -15,7 +15,7 @@ template -class Dictionary_iter : public Hash_table_iter +class Dictionary_iter : public Hash_table_iter { public: Dictionary_iter (Dictionary const &d) diff --git a/flower/include/parray.hh b/flower/include/parray.hh index 94d2e319e3..3aabb2b06c 100644 --- a/flower/include/parray.hh +++ b/flower/include/parray.hh @@ -21,7 +21,7 @@ template class Link_array : private Array { - static default_compare (T *const& p1, T *const&p2) { + static int default_compare (T *const& p1, T *const&p2) { /* can't do p1 -p2, since T might be an incomplete type */ if (p1 < p2) return -1 ; diff --git a/flower/include/text-db.hh b/flower/include/text-db.hh index 6e90e38c47..83a8460fa6 100644 --- a/flower/include/text-db.hh +++ b/flower/include/text-db.hh @@ -14,7 +14,7 @@ public: Text_record() { } // needed because of other ctor /// report an error in this line. - message (String s) { + void message (String s) { cerr << '\n'<< filename << ": "<< line_no << s << "\n"; } String operator[](int j) { diff --git a/flower/include/text-stream.hh b/flower/include/text-stream.hh index 3bebb08505..d68c75a2b8 100644 --- a/flower/include/text-stream.hh +++ b/flower/include/text-stream.hh @@ -48,7 +48,7 @@ public: } char peek() { if (eof_b ()) - return -1; + return (char)-1; char c = get(); unget (c); return c; diff --git a/flower/include/virtual-methods.hh b/flower/include/virtual-methods.hh index 792c06f280..b00e741330 100644 --- a/flower/include/virtual-methods.hh +++ b/flower/include/virtual-methods.hh @@ -28,6 +28,28 @@ demangle_classname (const char*); }; */ -#define VIRTUAL_COPY_CONS(base) virtual base *clone () const { return new typeof(*this) (*this); } +// fix constness: gcc-2.95 is correct in defining +// typeof (*this) +// in a const member function to be const + +#if 0 +#define VIRTUAL_COPY_CONS(base) \ + virtual base *clone () const \ + { \ + return new typeof(*this) (*this); \ + } +#else +#define VIRTUAL_COPY_CONS(base) \ + virtual base* clone_const_helper () \ + { \ + return new typeof (*this) (*this); \ + } \ + virtual base* clone () const \ + { \ + base* urg = (base*)this; \ + return urg->clone_const_helper (); \ + } #endif + +#endif /* VIRTUAL_METHODS_HH */ diff --git a/flower/string.cc b/flower/string.cc index f0cfb0824d..48d7feaec2 100644 --- a/flower/string.cc +++ b/flower/string.cc @@ -285,7 +285,7 @@ String::index_any_i (String set) const char * found= (char*) memchr (me_l, set[i], n ); if (found) { - return found - me_l; + return found - (char const*)me_l; } } return -1; diff --git a/lily/axis-group-element.cc b/lily/axis-group-element.cc index 09f7ad4d27..2d303f3538 100644 --- a/lily/axis-group-element.cc +++ b/lily/axis-group-element.cc @@ -86,7 +86,8 @@ Interval Axis_group_element::extra_extent (Axis a )const { Interval g; - purge_extra (); // Yeah yeah, const correctness. + Axis_group_element* urg = (Axis_group_element*)this; + urg->purge_extra (); // Yeah yeah, const correctness. for (int i=0; i < extra_elems_.size (); i++) { Interval ge = extra_elems_[i]->extent (a); diff --git a/lily/bar-number-engraver.cc b/lily/bar-number-engraver.cc index 99eb26a26c..9db68461fb 100644 --- a/lily/bar-number-engraver.cc +++ b/lily/bar-number-engraver.cc @@ -18,7 +18,7 @@ Bar_number_engraver::Bar_number_engraver() axis_ = Y_AXIS; type_ = "barNumber"; visibility_lambda_ - = gh_eval_str ("postbreak_only_visibility"); + = ly_ch_C_eval_scm ("postbreak_only_visibility"); } void diff --git a/lily/bar-script-engraver.cc b/lily/bar-script-engraver.cc index c96b062124..b13e27500f 100644 --- a/lily/bar-script-engraver.cc +++ b/lily/bar-script-engraver.cc @@ -23,7 +23,7 @@ Bar_script_engraver::Bar_script_engraver () text_p_ =0; hang_on_clef_b_ = false; visibility_lambda_ - = gh_eval_str ("non_postbreak_visibility"); + = ly_ch_C_eval_scm ("non_postbreak_visibility"); } void diff --git a/lily/base-span-bar-engraver.cc b/lily/base-span-bar-engraver.cc index 617408c4a4..80dd64a99e 100644 --- a/lily/base-span-bar-engraver.cc +++ b/lily/base-span-bar-engraver.cc @@ -55,7 +55,7 @@ Base_span_bar_engraver::acknowledge_element (Score_element_info i) String visnam = String(name()) + "_visibility"; spanbar_p_->set_elt_property (visibility_lambda_scm_sym, - gh_eval_str (visnam.ch_C())); + ly_ch_C_eval_scm (visnam.ch_C())); if (use_priority_b_) { diff --git a/lily/beam.cc b/lily/beam.cc index b4d351d269..c063ddbd8e 100644 --- a/lily/beam.cc +++ b/lily/beam.cc @@ -199,7 +199,7 @@ Beam::get_default_dir () const */ Direction beam_dir; - Direction neutral_dir = (int)paper_l ()->get_var ("stem_default_neutral_direction"); + Direction neutral_dir = (Direction)(int)paper_l ()->get_var ("stem_default_neutral_direction"); Dir_algorithm a = (Dir_algorithm)rint(paper_l ()->get_var ("beam_dir_algorithm")); switch (a) diff --git a/lily/break-align-item.cc b/lily/break-align-item.cc index 1e65bbe23e..c3f9b05ca5 100644 --- a/lily/break-align-item.cc +++ b/lily/break-align-item.cc @@ -47,7 +47,7 @@ Break_align_item::do_pre_processing() SCM symbol_list = SCM_EOL; Array dists; - SCM current_origin = gh_str02scm (""); + SCM current_origin = ly_ch_C_to_scm (""); for (int i=0; i <= elems.size (); i++) { Score_element *next_elt = i < elems.size () @@ -61,11 +61,11 @@ Break_align_item::do_pre_processing() next_origin = next_elt->get_elt_property (origin_scm_sym); next_origin = (next_origin == SCM_BOOL_F) - ? gh_str02scm ("") + ? ly_ch_C_to_scm ("") : SCM_CDR (next_origin); } else - next_origin = gh_str02scm ("begin-of-note"); + next_origin = ly_ch_C_to_scm ("begin-of-note"); SCM extra_space = scm_eval (scm_listify (ly_symbol ("break-align-spacer"), @@ -173,7 +173,7 @@ Break_align_item::add_breakable_item (Item *it) warning bells about missing Y refpoints go off later on. */ hg->dim_cache_[Y_AXIS]->parent_l_ = dim_cache_[Y_AXIS]; - hg->set_elt_property (ly_symbol("origin"), gh_str02scm (it->name())); + hg->set_elt_property (ly_symbol ("origin"), ly_ch_C_to_scm (it->name ())); pscore_l_->typeset_element (hg); add_element_priority (hg, priority); diff --git a/lily/breathing-sign.cc b/lily/breathing-sign.cc index c9f3b1fd28..1fc36f8897 100644 --- a/lily/breathing-sign.cc +++ b/lily/breathing-sign.cc @@ -26,7 +26,7 @@ Breathing_sign::Breathing_sign () set_elt_property (breakable_scm_sym, SCM_BOOL_T); set_elt_property (break_priority_scm_sym, gh_int2scm (-4)); set_elt_property (visibility_lambda_scm_sym, - gh_eval_str ("non_postbreak_visibility")); + ly_ch_C_eval_scm ("non_postbreak_visibility")); } void diff --git a/lily/chord.cc b/lily/chord.cc index e3475f3aa2..b0b081e217 100644 --- a/lily/chord.cc +++ b/lily/chord.cc @@ -260,7 +260,7 @@ Chord::Chord (Musical_pitch tonic, Array* add_arr_p, Array* add_arr_p, Array* sub_arr_p) +Chord::find_additions_and_subtractions(Array* add_arr_p, Array* sub_arr_p) const { Musical_pitch tonic = pitch_arr_[0]; /* diff --git a/lily/clef-engraver.cc b/lily/clef-engraver.cc index 59cb9b791c..4c0960b99c 100644 --- a/lily/clef-engraver.cc +++ b/lily/clef-engraver.cc @@ -130,7 +130,7 @@ Clef_engraver::acknowledge_element (Score_element_info info) create_clef(); if(def) clef_p_->set_elt_property(visibility_lambda_scm_sym, - gh_eval_str ("postbreak_only_visibility")); + ly_ch_C_eval_scm ("postbreak_only_visibility")); } /* ugh; should make Clef_referenced baseclass */ @@ -194,7 +194,7 @@ Clef_engraver::create_clef() String clefstyle = get_property ("clefStyle", 0); if (clefstyle.length_i ()) c->set_elt_property (style_scm_sym, - gh_str02scm (clefstyle.ch_C())); + ly_ch_C_to_scm (clefstyle.ch_C())); announce_element (Score_element_info (c, clef_req_l_)); clef_p_ = c; diff --git a/lily/dimension-cache.cc b/lily/dimension-cache.cc index be69da1115..12d292efe6 100644 --- a/lily/dimension-cache.cc +++ b/lily/dimension-cache.cc @@ -100,18 +100,14 @@ Dimension_cache::relative_coordinate (Dimension_cache *d) const Dimension_cache * Dimension_cache::common_group (Dimension_cache const* s) const { - Link_array my_groups; - for (Dimension_cache const *c = this; - c ; c = c->parent_l_) - my_groups.push (c); - + Link_array my_groups; + for (Dimension_cache const *c = this; c ; c = c->parent_l_) + my_groups.push ((Dimension_cache*)c); Dimension_cache const *common=0; - for (Dimension_cache const * d = s; - !common && d; - d = d->parent_l_) - common = my_groups.find_l (d); + for (Dimension_cache const * d = s; !common && d; d = d->parent_l_) + common = (Dimension_cache const*)my_groups.find_l (d); return (Dimension_cache*)common; } diff --git a/lily/dynamic-engraver.cc b/lily/dynamic-engraver.cc index 121d55fdfb..0e3f291353 100644 --- a/lily/dynamic-engraver.cc +++ b/lily/dynamic-engraver.cc @@ -7,7 +7,6 @@ */ #include "debug.hh" #include "crescendo.hh" -#include "dynamic-engraver.hh" #include "musical-request.hh" #include "lookup.hh" #include "paper-def.hh" diff --git a/lily/graphical-axis-group.cc b/lily/graphical-axis-group.cc index f1321c55e4..6beccc6961 100644 --- a/lily/graphical-axis-group.cc +++ b/lily/graphical-axis-group.cc @@ -17,7 +17,16 @@ Graphical_axis_group at one time. */ Graphical_axis_group::Graphical_axis_group(Graphical_axis_group const&s) { +#if 0 + /* + gcc-2.95: huh? why can't i assign a const value to a var? + graphical-axis-group.cc:20: incompatible types in assignment of `const Axis[2]' to `Axis[2]' + */ axes_ = s.axes_; +#else + axes_[0] = s.axes_[0]; + axes_[1] = s.axes_[1]; +#endif ordered_b_ = s.ordered_b_; } diff --git a/lily/includable-lexer.cc b/lily/includable-lexer.cc index 2adb810cd9..524519623c 100644 --- a/lily/includable-lexer.cc +++ b/lily/includable-lexer.cc @@ -107,7 +107,7 @@ Includable_lexer::close_input () } char const* -Includable_lexer::here_ch_C () +Includable_lexer::here_ch_C () const { if (include_stack_.empty ()) return 0; diff --git a/lily/include/bar-align-engraver.hh b/lily/include/bar-align-engraver.hh index 7cf2db0cfe..e69de29bb2 100644 --- a/lily/include/bar-align-engraver.hh +++ b/lily/include/bar-align-engraver.hh @@ -1,13 +0,0 @@ -/* - bar-align-engraver.hh -- declare - - source file of the GNU LilyPond music typesetter - - (c) 1997--1999 Han-Wen Nienhuys -*/ - - -#ifndef BAR_ALIGN_GRAV_HH -#define BAR_ALIGN_GRAV_HH - -#endif // BAR_ALIGN_GRAV_HH diff --git a/lily/include/bar-script-engraver.hh b/lily/include/bar-script-engraver.hh index 6944762d2d..dec3c05ef6 100644 --- a/lily/include/bar-script-engraver.hh +++ b/lily/include/bar-script-engraver.hh @@ -18,6 +18,8 @@ */ class Bar_script_engraver : public Engraver { +public: + VIRTUAL_COPY_CONS(Translator); protected: Staff_side_item* staff_side_p_; Text_item* text_p_; diff --git a/lily/include/beam-swallow-trans.hh b/lily/include/beam-swallow-trans.hh index fb4fd96d59..e69de29bb2 100644 --- a/lily/include/beam-swallow-trans.hh +++ b/lily/include/beam-swallow-trans.hh @@ -1,15 +0,0 @@ -/* - beam-swallow-trans.hh -- declare - - source file of the GNU LilyPond music typesetter - - (c) 1997--1999 Han-Wen Nienhuys - - */ - -#ifndef BEAM_SWALLOW_TRANS_HH -#define BEAM_SWALLOW_TRANS_HH - - -#endif /* BEAM_SWALLOW_TRANS_HH */ - diff --git a/lily/include/chord.hh b/lily/include/chord.hh index a863e76572..9b38abbb41 100644 --- a/lily/include/chord.hh +++ b/lily/include/chord.hh @@ -27,7 +27,7 @@ public: int find_tonic_i () const; int find_pitch_i (Musical_pitch p) const; int find_notename_i (Musical_pitch p) const; - void find_additions_and_subtractions(Array* add_arr_p, Array* sub_arr_p); + void find_additions_and_subtractions(Array* add_arr_p, Array* sub_arr_p) const; Array pitch_arr_; }; diff --git a/lily/include/dynamic-engraver.hh b/lily/include/dynamic-engraver.hh index 989602690a..e69de29bb2 100644 --- a/lily/include/dynamic-engraver.hh +++ b/lily/include/dynamic-engraver.hh @@ -1,13 +0,0 @@ -/* - dynamic-engraver.hh -- declare Dynamic_engraver - - source file of the GNU LilyPond music typesetter - - (c) 1997--1999 Han-Wen Nienhuys -*/ - - -#ifndef DYNAMIC_GRAV_HH -#define DYNAMIC_GRAV_HH - -#endif // DYNAMIC_GRAV_HH diff --git a/lily/include/includable-lexer.hh b/lily/include/includable-lexer.hh index 7bff4284c1..5acf3cc6c5 100644 --- a/lily/include/includable-lexer.hh +++ b/lily/include/includable-lexer.hh @@ -46,7 +46,7 @@ public: void new_input (String name, String data, Sources*); void add_lexed_char (int); - char const * here_ch_C (); + char const * here_ch_C () const; }; diff --git a/lily/include/lily-guile.hh b/lily/include/lily-guile.hh index 33d8eda649..90773ac8d1 100644 --- a/lily/include/lily-guile.hh +++ b/lily/include/lily-guile.hh @@ -15,6 +15,8 @@ #include #include "direction.hh" +SCM ly_ch_C_to_scm (char const*c); +SCM ly_ch_C_eval_scm (char const*c); SCM ly_symbol (String name); String symbol_to_string (SCM); SCM ly_set_scm (String name , SCM val); diff --git a/lily/include/musical-request.hh b/lily/include/musical-request.hh index cf583c1b99..fc0e2f3a31 100644 --- a/lily/include/musical-request.hh +++ b/lily/include/musical-request.hh @@ -24,7 +24,7 @@ public: Duration duration_; virtual void do_print () const; - bool do_equal_b (Request*) const; + bool do_equal_b (Request const*) const; void compress (Moment); virtual Moment length_mom () const; static int compare (Rhythmic_req const&,Rhythmic_req const&); @@ -60,7 +60,7 @@ class Articulation_req : public Script_req public: String articulation_str_; protected: - virtual bool do_equal_b (Request*) const; + virtual bool do_equal_b (Request const*) const; virtual void do_print () const; VIRTUAL_COPY_CONS(Music); }; @@ -73,7 +73,7 @@ public: String style_str_; protected: VIRTUAL_COPY_CONS(Music); - virtual bool do_equal_b (Request*)const; + virtual bool do_equal_b (Request const*)const; virtual void do_print () const; }; @@ -88,7 +88,7 @@ struct Melodic_req :virtual Request protected: /// transpose. #delta# is relative to central c. virtual void transpose (Musical_pitch delta); - virtual bool do_equal_b (Request*) const; + virtual bool do_equal_b (Request const*) const; virtual void do_print () const; VIRTUAL_COPY_CONS(Music); }; @@ -110,7 +110,7 @@ public: Note_req(); protected: virtual void do_print () const; - bool do_equal_b (Request*) const; + bool do_equal_b (Request const*) const; VIRTUAL_COPY_CONS(Music); }; diff --git a/lily/include/request.hh b/lily/include/request.hh index 03d4b29504..d525daa83b 100644 --- a/lily/include/request.hh +++ b/lily/include/request.hh @@ -28,9 +28,9 @@ class Request : public Music { public: virtual ~Request(){} VIRTUAL_COPY_CONS(Music); - bool equal_b (Request*) const; + bool equal_b (Request const*) const; protected: - virtual bool do_equal_b (Request*) const; + virtual bool do_equal_b (Request const*) const; virtual void do_print() const; }; @@ -57,7 +57,7 @@ public: Span_req(); protected: - virtual bool do_equal_b (Request*) const; + virtual bool do_equal_b (Request const*) const; virtual void do_print() const; VIRTUAL_COPY_CONS(Music); }; diff --git a/lily/include/type-swallow-trans.hh b/lily/include/type-swallow-trans.hh index da857f6c29..e69de29bb2 100644 --- a/lily/include/type-swallow-trans.hh +++ b/lily/include/type-swallow-trans.hh @@ -1,38 +0,0 @@ -/* - type-swallow-engraver.hh -- declare Type_swallow_translator - - source file of the GNU LilyPond music typesetter - - (c) 1997--1999 Han-Wen Nienhuys -*/ - - -#ifndef TYPESWALLOW_GRAV_HH -#define TYPESWALLOW_GRAV_HH - -#include "translator.hh" - -/** eat a certain type of request. - (Duh, it's good for your skin) - */ -class Type_swallow_translator : public virtual Translator -{ -protected: - String swallow_str_; - bool do_try_music (Music*); -public: - VIRTUAL_COPY_CONS(Translator); -}; - -#define DECLARE_REQUEST_SWALLOWER(TYPE) \ -struct TYPE ## _swallow_translator : public Type_swallow_translator {\ - TYPE ## _swallow_translator() { \ - swallow_str_ = #TYPE;\ - }\ - \ - VIRTUAL_COPY_CONS(Translator);\ -};\ -ADD_THIS_TRANSLATOR(TYPE ## _swallow_translator);\ - -#endif // TYPESWALLOW_GRAV_HH - diff --git a/lily/include/type-swallow-translator.hh b/lily/include/type-swallow-translator.hh new file mode 100644 index 0000000000..da857f6c29 --- /dev/null +++ b/lily/include/type-swallow-translator.hh @@ -0,0 +1,38 @@ +/* + type-swallow-engraver.hh -- declare Type_swallow_translator + + source file of the GNU LilyPond music typesetter + + (c) 1997--1999 Han-Wen Nienhuys +*/ + + +#ifndef TYPESWALLOW_GRAV_HH +#define TYPESWALLOW_GRAV_HH + +#include "translator.hh" + +/** eat a certain type of request. + (Duh, it's good for your skin) + */ +class Type_swallow_translator : public virtual Translator +{ +protected: + String swallow_str_; + bool do_try_music (Music*); +public: + VIRTUAL_COPY_CONS(Translator); +}; + +#define DECLARE_REQUEST_SWALLOWER(TYPE) \ +struct TYPE ## _swallow_translator : public Type_swallow_translator {\ + TYPE ## _swallow_translator() { \ + swallow_str_ = #TYPE;\ + }\ + \ + VIRTUAL_COPY_CONS(Translator);\ +};\ +ADD_THIS_TRANSLATOR(TYPE ## _swallow_translator);\ + +#endif // TYPESWALLOW_GRAV_HH + diff --git a/lily/key-engraver.cc b/lily/key-engraver.cc index eff74dbb29..f8c32dac6a 100644 --- a/lily/key-engraver.cc +++ b/lily/key-engraver.cc @@ -92,7 +92,7 @@ Key_engraver::acknowledge_element (Score_element_info info) if (def) { item_p_->set_elt_property (visibility_lambda_scm_sym, - gh_eval_str ("postbreak_only_visibility")); + ly_ch_C_eval_scm ("postbreak_only_visibility")); } } diff --git a/lily/lily-guile.cc b/lily/lily-guile.cc index a177b2c88b..d771b86923 100644 --- a/lily/lily-guile.cc +++ b/lily/lily-guile.cc @@ -19,6 +19,20 @@ #include "file-path.hh" #include "debug.hh" +SCM +ly_ch_C_to_scm (char const*c) +{ + // this all really sucks, guile should take char const* arguments! + return gh_str02scm ((char*)c); +} + +SCM +ly_ch_C_eval_scm (char const*c) +{ + // this all really sucks, guile should take char const* arguments! + return gh_eval_str ((char*)c); +} + /* scm_m_quote doesn't use any env, but needs one for a good signature in GUILE. @@ -41,7 +55,7 @@ ly_quote_scm (SCM s) SCM ly_symbol (String name) { - return gh_car (scm_intern (name.ch_C(), name.length_i())); + return gh_car (scm_intern ((char*)name.ch_C(), name.length_i())); } String @@ -53,7 +67,7 @@ symbol_to_string (SCM s) SCM ly_set_scm (String name, SCM val) { - return scm_sysintern (name.ch_C(), val); + return scm_sysintern ((char*)name.ch_C(), val); } @@ -78,7 +92,7 @@ read_lily_scm_file (String fn) Simple_file_storage f(s); - gh_eval_str ((char *) f.ch_C()); + ly_ch_C_eval_scm ((char *) f.ch_C()); *mlog << ']' << flush; } @@ -100,7 +114,7 @@ ly_gulp_file (SCM name) Simple_file_storage f(s); - return gh_str02scm (f.ch_C()); + return ly_ch_C_to_scm (f.ch_C()); } void @@ -152,8 +166,8 @@ ly_warning (SCM str) void init_functions () { - scm_make_gsubr ("ly-warn", 1, 0, 0, ly_warning); - scm_make_gsubr ("ly-gulp-file", 1,0, 0, ly_gulp_file); + scm_make_gsubr ("ly-warn", 1, 0, 0, (SCM(*)(...))ly_warning); + scm_make_gsubr ("ly-gulp-file", 1,0, 0, (SCM(*)(...))ly_gulp_file); } extern void init_symbols (); diff --git a/lily/lookup.cc b/lily/lookup.cc index d82c1f55ba..3c05d65b28 100644 --- a/lily/lookup.cc +++ b/lily/lookup.cc @@ -393,7 +393,7 @@ Lookup::text (String style, String text, Paper_def *paper_l) const /* UGH. */ - SCM l = gh_eval_str (("(style-to-cmr \"" + style + "\")").ch_C()); + SCM l = ly_ch_C_eval_scm (("(style-to-cmr \"" + style + "\")").ch_C()); if (l != SCM_BOOL_F) { style = ly_scm2string (SCM_CDR(l)) +to_str ((int)font_h); @@ -422,7 +422,7 @@ Lookup::text (String style, String text, Paper_def *paper_l) const brace_count ++; else if (text[i] == '}') brace_count --; - Character_metric *c = afm_l->get_char ((unsigned char)text[i],false); + Character_metric *c = (Character_metric*)afm_l->get_char ((unsigned char)text[i],false); w += c->dimensions()[X_AXIS].length (); ydims.unite (c->dimensions()[Y_AXIS]); @@ -449,7 +449,7 @@ Lookup::text (String style, String text, Paper_def *paper_l) const Atom at (gh_list (text_scm_sym, - gh_str02scm (text.ch_C()), + ly_ch_C_to_scm (text.ch_C()), SCM_UNDEFINED)); at.font_ = ly_symbol (style); at.magn_ = gh_int2scm (font_mag); diff --git a/lily/main.cc b/lily/main.cc index ffb26cede2..e48887a977 100644 --- a/lily/main.cc +++ b/lily/main.cc @@ -254,7 +254,7 @@ setup_paths () void -main_prog (int argc, char **argv) +main_prog (int, char**) { /* need to do this first. Engravers use lily.scm contents. @@ -388,7 +388,7 @@ main (int argc, char **argv) #ifdef WINNT gh_enter (argc, argv, main_prog); #else - gh_enter (argc, argv, (void(*)())main_prog); + gh_enter (argc, argv, (void(*)(...))main_prog); #endif return 0; // unreachable diff --git a/lily/mark-engraver.cc b/lily/mark-engraver.cc index 345c4f8e42..1c4b966a4f 100644 --- a/lily/mark-engraver.cc +++ b/lily/mark-engraver.cc @@ -18,7 +18,7 @@ Mark_engraver::Mark_engraver () mark_req_l_ = 0; axis_ = Y_AXIS; type_ = "mark"; - visibility_lambda_ = gh_eval_str ("mark-visibility"); + visibility_lambda_ = ly_ch_C_eval_scm ("mark-visibility"); } void diff --git a/lily/multi-measure-rest-engraver.cc b/lily/multi-measure-rest-engraver.cc index 00fd9118c1..51ff446542 100644 --- a/lily/multi-measure-rest-engraver.cc +++ b/lily/multi-measure-rest-engraver.cc @@ -75,7 +75,7 @@ Multi_measure_rest_engraver::do_process_requests () mmrest_p_ = new Multi_measure_rest; if(dynamic_cast (multi_measure_req_l_)) mmrest_p_->set_elt_property (alt_symbol_scm_sym, - gh_str02scm("scripts-repeatsign")); + ly_ch_C_to_scm ("scripts-repeatsign")); announce_element (Score_element_info (mmrest_p_, multi_measure_req_l_)); start_measure_i_ = time->bars_i_; } diff --git a/lily/musical-request.cc b/lily/musical-request.cc index fd47b95585..c5f9de2d56 100644 --- a/lily/musical-request.cc +++ b/lily/musical-request.cc @@ -47,9 +47,9 @@ Melodic_req::transpose (Musical_pitch delta) bool -Melodic_req::do_equal_b (Request*r) const +Melodic_req::do_equal_b (Request const* r) const { - Melodic_req* m= dynamic_cast (r); + Melodic_req const* m= dynamic_cast (r); return m&& !compare (*m, *this); } @@ -75,9 +75,9 @@ Rhythmic_req::compare (Rhythmic_req const &r1, Rhythmic_req const &r2) } bool -Rhythmic_req::do_equal_b (Request*r) const +Rhythmic_req::do_equal_b (Request const* r) const { - Rhythmic_req* rh = dynamic_cast (r); + Rhythmic_req const* rh = dynamic_cast (r); return rh && !compare (*this, *rh); } @@ -114,9 +114,9 @@ Lyric_req::do_print () const bool -Note_req::do_equal_b (Request*r) const +Note_req::do_equal_b (Request const* r) const { - Note_req *n = dynamic_cast (r); + Note_req const* n = dynamic_cast (r); return n&& Rhythmic_req::do_equal_b (n) && Melodic_req::do_equal_b (n); } @@ -148,9 +148,9 @@ Note_req::do_print () const bool -Span_req::do_equal_b (Request*r) const +Span_req::do_equal_b (Request const*r) const { - Span_req * s = dynamic_cast (r); + Span_req const* s = dynamic_cast (r); return s && span_dir_ == s->span_dir_; } @@ -180,9 +180,9 @@ Text_script_req::do_print () const } bool -Text_script_req::do_equal_b (Request *r) const +Text_script_req::do_equal_b (Request const* r) const { - Text_script_req * t = dynamic_cast(r); + Text_script_req const* t = dynamic_cast (r); return t && t->text_str_ == text_str_ && t->style_str_ == style_str_; } @@ -193,9 +193,9 @@ Articulation_req::do_print () const } bool -Articulation_req::do_equal_b (Request*r) const +Articulation_req::do_equal_b (Request const* r) const { - Articulation_req * a = dynamic_cast(r); + Articulation_req const* a = dynamic_cast (r); return a && articulation_str_ == a->articulation_str_; } diff --git a/lily/my-lily-lexer.cc b/lily/my-lily-lexer.cc index 91d2c5ce2d..2bf4d1120c 100644 --- a/lily/my-lily-lexer.cc +++ b/lily/my-lily-lexer.cc @@ -238,6 +238,6 @@ My_lily_lexer::escaped_char(char c) const Input My_lily_lexer::here_input () const { - Source_file * f_l= source_file_l(); - return Input (f_l, here_ch_C()); + Source_file * f_l= source_file_l (); + return Input (f_l, (char*)here_ch_C ()); } diff --git a/lily/note-column.cc b/lily/note-column.cc index a0fde290c0..bf32b3ad07 100644 --- a/lily/note-column.cc +++ b/lily/note-column.cc @@ -63,7 +63,7 @@ Note_column::dir () const if (stem_l_) return stem_l_->dir_; else if (head_l_arr_.size ()) - return sign (head_positions_interval().center ()); + return (Direction)sign (head_positions_interval().center ()); programming_error ("Note column without heads and stem!"); return CENTER; diff --git a/lily/note-head.cc b/lily/note-head.cc index 8afe7358ce..64134c9f2c 100644 --- a/lily/note-head.cc +++ b/lily/note-head.cc @@ -78,7 +78,7 @@ Note_head::do_brew_molecule_p() const if (streepjes_i) { - Direction dir = sign (position_i_); + Direction dir = (Direction)sign (position_i_); Interval hd = out->dim_[X_AXIS]; Real hw = hd.length ()/4; diff --git a/lily/note-heads-engraver.cc b/lily/note-heads-engraver.cc index 55282d2334..f3c290916b 100644 --- a/lily/note-heads-engraver.cc +++ b/lily/note-heads-engraver.cc @@ -58,7 +58,7 @@ Note_heads_engraver::do_process_requests() Scalar dir = get_property ("verticalDirection",0); if (dir.isdir_b()) { - d->resolve_dir_ = int (dir); + d->resolve_dir_ = (Direction)(int)dir; } announce_element (Score_element_info (d,0)); @@ -70,7 +70,7 @@ Note_heads_engraver::do_process_requests() note_p->set_elt_property (transparent_scm_sym, SCM_BOOL_T); else note_p->set_elt_property (style_scm_sym, - gh_str02scm (noteheadstyle.ch_C())); + ly_ch_C_to_scm (noteheadstyle.ch_C())); Score_element_info itinf (note_p,note_req_l); diff --git a/lily/paper-outputter.cc b/lily/paper-outputter.cc index 564314efd1..07fe0330b9 100644 --- a/lily/paper-outputter.cc +++ b/lily/paper-outputter.cc @@ -57,10 +57,10 @@ Paper_outputter::output_header () if (safe_global_b) { ly_set_scm ("security-paranoia", SCM_BOOL_T); - // gh_eval_str ("(set! security-paranoia #t)"); + // ly_ch_C_eval_scm ("(set! security-paranoia #t)"); } String s = String ("(eval (") + output_global_ch + "-scm 'all-definitions))"; - gh_eval_str (s.ch_C ()); + ly_ch_C_eval_scm (s.ch_C ()); String creator; if (no_timestamps_global_b) @@ -80,8 +80,8 @@ Paper_outputter::output_header () } SCM args_scm = - gh_list (gh_str02scm (creator.ch_l ()), - gh_str02scm (generate.ch_l ()), SCM_UNDEFINED); + gh_list (ly_ch_C_to_scm (creator.ch_l ()), + ly_ch_C_to_scm (generate.ch_l ()), SCM_UNDEFINED); #ifndef NPRINT DOUT << "output_header\n"; @@ -140,7 +140,7 @@ Paper_outputter::output_molecule (Molecule const*m, Offset o, char const *nm) if (i->font_) { output_scheme (gh_list (ly_symbol ("select-font"), - gh_str02scm (symbol_to_string (i->font_).ch_C()), + ly_ch_C_to_scm (symbol_to_string (i->font_).ch_C()), SCM (i->magn_), SCM_UNDEFINED)); } @@ -241,7 +241,7 @@ Paper_outputter::output_font_def (int i, String str) { SCM scm = gh_list (ly_symbol ("font-def"), gh_int2scm (i), - gh_str02scm (str.ch_l ()), + ly_ch_C_to_scm (str.ch_l ()), SCM_UNDEFINED); output_scheme (scm); @@ -252,8 +252,8 @@ Paper_outputter::output_Real_def (String k, Real v) { SCM scm = gh_list (ly_symbol ("lily-def"), - gh_str02scm (k.ch_l ()), - gh_str02scm (to_str(v).ch_l ()), + ly_ch_C_to_scm (k.ch_l ()), + ly_ch_C_to_scm (to_str(v).ch_l ()), SCM_UNDEFINED); output_scheme (scm); @@ -265,20 +265,20 @@ Paper_outputter::output_String_def (String k, String v) { SCM scm = gh_list (ly_symbol ("lily-def"), - gh_str02scm (k.ch_l ()), - gh_str02scm (v.ch_l ()), + ly_ch_C_to_scm (k.ch_l ()), + ly_ch_C_to_scm (v.ch_l ()), SCM_UNDEFINED); output_scheme (scm); - gh_define (k.ch_l (), gh_str02scm (v.ch_l ())); + gh_define (k.ch_l (), ly_ch_C_to_scm (v.ch_l ())); } void Paper_outputter::output_int_def (String k, int v) { SCM scm = gh_list (ly_symbol ("lily-def"), - gh_str02scm (k.ch_l ()), - gh_str02scm (to_str (v).ch_l ()), + ly_ch_C_to_scm (k.ch_l ()), + ly_ch_C_to_scm (to_str (v).ch_l ()), SCM_UNDEFINED); output_scheme (scm); diff --git a/lily/parser.yy b/lily/parser.yy index 682365234a..62bda87e06 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -427,6 +427,9 @@ translator_spec_block: translator_spec_body: TRANS_IDENTIFIER { $$ = $1->access_content_Translator (true); + Translator_group * tg = dynamic_cast ($$); + if (!tg) + THIS->parser_error (_("Need a translator group for a context")); $$-> set_spot (THIS->here_input ()); } | TYPE STRING semicolon { @@ -456,8 +459,10 @@ translator_spec_body: delete $4; /* ugh*/ - Translator_group * tr = dynamic_cast($$); - tr->set_property (*$2, str); + Translator_group* tg = dynamic_cast ($$); + if (!tg) + THIS->parser_error (_("Need a translator group for a context")); + tg->set_property (*$2, str); } | translator_spec_body NAME STRING semicolon { $$->type_str_ = *$3; diff --git a/lily/request.cc b/lily/request.cc index 7c833def05..67d1e548e2 100644 --- a/lily/request.cc +++ b/lily/request.cc @@ -15,13 +15,13 @@ Request::do_print() const } bool -Request::equal_b (Request *r) const +Request::equal_b (Request const* r) const { return r->do_equal_b (this) || this->do_equal_b (r) ; } bool -Request::do_equal_b (Request*) const +Request::do_equal_b (Request const*) const { return true; } diff --git a/lily/rest-engraver.cc b/lily/rest-engraver.cc index a8f601e9ee..b3f5e4494d 100644 --- a/lily/rest-engraver.cc +++ b/lily/rest-engraver.cc @@ -60,7 +60,7 @@ Rest_engraver::do_process_requests () String reststyle = get_property ("restStyle", 0); if (reststyle.length_i ()) rest_p_->set_elt_property (style_scm_sym, - gh_str02scm (reststyle.ch_C())); + ly_ch_C_to_scm (reststyle.ch_C())); } announce_element (Score_element_info (rest_p_, rest_req_l_)); } diff --git a/lily/score-element.cc b/lily/score-element.cc index fdeba32ff3..128b380d04 100644 --- a/lily/score-element.cc +++ b/lily/score-element.cc @@ -161,13 +161,13 @@ Score_element::lookup_l () const { if (!lookup_l_) { - Score_element * me = (Score_element*)this; - SCM sz = me->remove_elt_property (fontsize_scm_sym); + Score_element * urg = (Score_element*)this; + SCM sz = urg->remove_elt_property (fontsize_scm_sym); int i = (sz != SCM_BOOL_F) ? gh_scm2int (SCM_CDR (sz)) : 0; - me->lookup_l_ = pscore_l_->paper_l_->lookup_l (i); + urg->lookup_l_ = (Lookup*)pscore_l_->paper_l_->lookup_l (i); } return lookup_l_; } diff --git a/lily/script-engraver.cc b/lily/script-engraver.cc index 66fcda0166..4cc2917b60 100644 --- a/lily/script-engraver.cc +++ b/lily/script-engraver.cc @@ -42,7 +42,7 @@ Script_engraver::do_process_requests() Articulation_req* l=script_req_l_arr_[i]; - SCM list = gh_eval_str (("(articulation-to-scriptdef \"" + l->articulation_str_ + "\")").ch_C()); + SCM list = ly_ch_C_eval_scm (("(articulation-to-scriptdef \"" + l->articulation_str_ + "\")").ch_C()); if (list == SCM_BOOL_F) { @@ -67,13 +67,13 @@ Script_engraver::do_process_requests() SCM priority = SCM_CAR(list); if (relative_stem_dir) - ss->relative_dir_ = relative_stem_dir; + ss->relative_dir_ = (Direction)relative_stem_dir; else - ss->dir_ = force_dir; + ss->dir_ = (Direction)force_dir; Scalar dir_prop (get_property ("articulationScriptVerticalDirection", 0)); if (dir_prop.isnum_b () && (int) dir_prop != CENTER) - ss->dir_ = (int) dir_prop; + ss->dir_ = (Direction)(int)dir_prop; if (l->dir_) ss->dir_ = l->dir_; diff --git a/lily/staff-margin-engraver.cc b/lily/staff-margin-engraver.cc index 6d083e01ee..c637ff4623 100644 --- a/lily/staff-margin-engraver.cc +++ b/lily/staff-margin-engraver.cc @@ -18,8 +18,7 @@ Staff_margin_engraver::Staff_margin_engraver () { axis_ = X_AXIS; type_ = "margin"; - visibility_lambda_ - = gh_eval_str ("postbreak_only_visibility"); + visibility_lambda_ = ly_ch_C_eval_scm ("postbreak_only_visibility"); } diff --git a/lily/stem-engraver.cc b/lily/stem-engraver.cc index 296422cfea..1ec79bf230 100644 --- a/lily/stem-engraver.cc +++ b/lily/stem-engraver.cc @@ -104,7 +104,7 @@ Stem_engraver::do_pre_move_processing() stem_p_->set_elt_property (dir_forced_scm_sym, SCM_BOOL_T); } - Translator_group const *which; + Translator_group* which; prop = get_property ("stemLeftBeamCount", &which); if (prop.isnum_b ()) { @@ -127,7 +127,7 @@ Stem_engraver::do_pre_move_processing() prop = get_property ("stemStyle", 0); if (prop.to_bool ()) { - stem_p_->set_elt_property (style_scm_sym, gh_str02scm (prop.ch_C())); + stem_p_->set_elt_property (style_scm_sym, ly_ch_C_to_scm (prop.ch_C())); } typeset_element(stem_p_); diff --git a/lily/stem-staff-side.cc b/lily/stem-staff-side.cc index 9af9d40bb6..d582047f57 100644 --- a/lily/stem-staff-side.cc +++ b/lily/stem-staff-side.cc @@ -41,7 +41,7 @@ Stem_staff_side_item::set_stem (Stem*s) Direction Stem_staff_side_item::get_default_direction () const { - return relative_dir_ * stem_l_->dir_; + return (Direction)(relative_dir_ * stem_l_->dir_); } void diff --git a/lily/tie.cc b/lily/tie.cc index 1bd0d1cdee..9df607babf 100644 --- a/lily/tie.cc +++ b/lily/tie.cc @@ -44,7 +44,7 @@ Tie::get_default_dir () const If dir is not determined: inverse of stem: down (see stem::get_default_dir ()) */ - Direction neutral_dir = (int)paper_l ()->get_var ("stem_default_neutral_direction"); + Direction neutral_dir = (Direction)(int)paper_l ()->get_var ("stem_default_neutral_direction"); return (m == 0) ? other_dir (neutral_dir) : (m < 0) ? DOWN : UP; } diff --git a/lily/type-swallow-trans.cc b/lily/type-swallow-trans.cc index b3d192cdfe..e69de29bb2 100644 --- a/lily/type-swallow-trans.cc +++ b/lily/type-swallow-trans.cc @@ -1,23 +0,0 @@ -/* - type-swallow-trans.cc -- implement Type_swallow_translator - - source file of the GNU LilyPond music typesetter - - (c) 1997--1999 Han-Wen Nienhuys -*/ - -#include "type-swallow-trans.hh" -#include "musical-request.hh" - - -bool -Type_swallow_translator::do_try_music (Music*r) -{ - if (classname (r) == swallow_str_) - return true; - return false; -} - - - -DECLARE_REQUEST_SWALLOWER(Skip_req); diff --git a/lily/type-swallow-translator.cc b/lily/type-swallow-translator.cc new file mode 100644 index 0000000000..8c33c86f56 --- /dev/null +++ b/lily/type-swallow-translator.cc @@ -0,0 +1,23 @@ +/* + type-swallow-translator.cc -- implement Type_swallow_translator + + source file of the GNU LilyPond music typesetter + + (c) 1997--1999 Han-Wen Nienhuys +*/ + +#include "type-swallow-translator.hh" +#include "musical-request.hh" + + +bool +Type_swallow_translator::do_try_music (Music*r) +{ + if (classname (r) == swallow_str_) + return true; + return false; +} + + + +DECLARE_REQUEST_SWALLOWER(Skip_req); diff --git a/lily/vertical-align-engraver.cc b/lily/vertical-align-engraver.cc index d02875c1d0..9614f5b359 100644 --- a/lily/vertical-align-engraver.cc +++ b/lily/vertical-align-engraver.cc @@ -47,7 +47,7 @@ Vertical_align_engraver::do_removal_processing() dist = get_property ("alignmentReference",0); if (dist.length_i () && dist.isnum_b ()) { - valign_p_->align_dir_ = int (dist); + valign_p_->align_dir_ = (Direction)(int)dist; } valign_p_->set_bounds(RIGHT,get_staff_info().command_pcol_l ()); typeset_element (valign_p_); @@ -58,7 +58,9 @@ Vertical_align_engraver::do_removal_processing() bool Vertical_align_engraver::qualifies_b (Score_element_info i) const { +#if 0 Translator * t = i.origin_trans_l_arr_[0]; +#endif int sz = i.origin_trans_l_arr_.size() ; #if 0 diff --git a/lily/volta-spanner.cc b/lily/volta-spanner.cc index a92e590714..bcc2424106 100644 --- a/lily/volta-spanner.cc +++ b/lily/volta-spanner.cc @@ -36,9 +36,9 @@ Volta_spanner::do_brew_molecule_p () const bool no_vertical_start = false; bool no_vertical_end = last_b_; Spanner *orig_span = dynamic_cast (original_l_); - if (orig_span && orig_span->broken_into_l_arr_[0] != this) + if (orig_span && (orig_span->broken_into_l_arr_[0] != (Spanner*)this)) no_vertical_start = true; - if (orig_span && orig_span->broken_into_l_arr_.top () != this) + if (orig_span && (orig_span->broken_into_l_arr_.top () != (Spanner*)this)) no_vertical_end = true; if (bar_arr_.top ()->type_str_.length_i () > 1) no_vertical_end = false;