From 886093b9ffe6b0f1a4a9d7d02ec12242c85b3caa Mon Sep 17 00:00:00 2001 From: David Kastrup Date: Wed, 27 Aug 2014 21:12:55 +0200 Subject: [PATCH] Issue 4082/3: Run scripts/auxiliar/smob-convert.sh --- lily/book-scheme.cc | 3 +-- lily/book.cc | 3 --- lily/box.cc | 18 +----------------- lily/context-def.cc | 5 +---- lily/context-mod.cc | 6 +----- lily/context-property.cc | 13 +++++++------ lily/context.cc | 5 +---- lily/dispatcher.cc | 5 +---- lily/duration.cc | 9 +-------- lily/font-metric.cc | 5 +---- lily/grob-array.cc | 5 +---- lily/grob-smob.cc | 5 +---- lily/grob.cc | 1 - lily/include/book.hh | 8 +++++--- lily/include/box.hh | 6 ++++-- lily/include/context-def.hh | 8 +++++--- lily/include/context-mod.hh | 7 ++++--- lily/include/context.hh | 9 +++++++-- lily/include/dispatcher.hh | 10 +++++++--- lily/include/duration.hh | 9 ++++----- lily/include/font-metric.hh | 9 +++++++-- lily/include/grob-array.hh | 9 ++++++--- lily/include/grob.hh | 8 ++++++-- lily/include/lily-lexer.hh | 9 ++++++--- lily/include/lily-parser.hh | 8 +++++--- lily/include/listener.hh | 9 +++++++-- lily/include/moment.hh | 7 ++++--- lily/include/music-iterator.hh | 8 ++++++-- lily/include/music-output.hh | 9 +++++++-- lily/include/output-def.hh | 8 ++++---- lily/include/page-marker.hh | 10 +++++++--- lily/include/paper-book.hh | 10 +++++++--- lily/include/paper-outputter.hh | 10 ++++++---- lily/include/pitch.hh | 8 ++++++-- lily/include/prob.hh | 10 ++++++++-- lily/include/scale.hh | 6 ++---- lily/include/scheme-listener.hh | 8 ++++---- lily/include/scm-hash.hh | 7 ++++--- lily/include/score.hh | 10 +++++++--- lily/include/simple-spacer.hh | 4 +--- lily/include/skyline-pair.hh | 6 ++++-- lily/include/skyline.hh | 8 +++++--- lily/include/source-file.hh | 11 +++++++---- lily/include/spring.hh | 8 +++++--- lily/include/stencil.hh | 8 ++++++-- lily/include/translator-dispatch-list.hh | 3 +-- lily/include/translator-group.hh | 9 ++++++--- lily/include/translator.hh | 9 +++++++-- lily/input-smob.cc | 2 -- lily/lily-lexer.cc | 5 +---- lily/lily-parser.cc | 5 +---- lily/listener.cc | 4 +--- lily/moment.cc | 10 +--------- lily/music-function.cc | 10 +++++----- lily/music-iterator.cc | 5 +---- lily/music-output.cc | 5 +---- lily/music.cc | 1 - lily/output-def.cc | 5 ----- lily/page-marker.cc | 5 +---- lily/paper-book.cc | 5 +---- lily/paper-outputter.cc | 3 --- lily/pitch.cc | 4 +--- lily/prob.cc | 5 +---- lily/scale.cc | 17 ----------------- lily/scheme-listener.cc | 2 -- lily/scm-hash.cc | 4 ---- lily/score.cc | 5 +---- lily/simple-spacer.cc | 19 ------------------- lily/skyline-pair.cc | 10 +--------- lily/skyline.cc | 5 +---- lily/source-file.cc | 6 +----- lily/spring-smob.cc | 15 +-------------- lily/stencil.cc | 5 +---- lily/stream-event.cc | 1 - lily/translator-dispatch-list.cc | 19 ------------------- lily/translator-group.cc | 5 +---- lily/translator.cc | 5 +---- lily/undead.cc | 13 +++++++------ 78 files changed, 234 insertions(+), 340 deletions(-) diff --git a/lily/book-scheme.cc b/lily/book-scheme.cc index 719f1e6b22..e7bae34f7c 100644 --- a/lily/book-scheme.cc +++ b/lily/book-scheme.cc @@ -178,6 +178,5 @@ LY_DEFINE (ly_book_scores, "ly:book-scores", return b->scores_; } -#include "ly-smobs.icc" -IMPLEMENT_TYPE_P (Book, "ly:book?"); +const char Book::type_p_name_[] = "ly:book?"; diff --git a/lily/book.cc b/lily/book.cc index a13a3ca51d..876a93876e 100644 --- a/lily/book.cc +++ b/lily/book.cc @@ -33,7 +33,6 @@ using namespace std; #include "paper-score.hh" #include "page-marker.hh" -#include "ly-smobs.icc" Book::Book () { @@ -105,8 +104,6 @@ Book::~Book () { } -IMPLEMENT_SMOBS (Book); -IMPLEMENT_DEFAULT_EQUAL_P (Book); SCM Book::mark_smob (SCM s) diff --git a/lily/box.cc b/lily/box.cc index 68d53b39f6..700eec3a6c 100644 --- a/lily/box.cc +++ b/lily/box.cc @@ -132,21 +132,5 @@ Box::print () /****************************************************************/ -#include "ly-smobs.icc" -IMPLEMENT_SIMPLE_SMOBS (Box); -IMPLEMENT_TYPE_P (Box, "ly:box?"); -IMPLEMENT_DEFAULT_EQUAL_P (Box); - -SCM -Box::mark_smob (SCM /* x */) -{ - return SCM_EOL; -} - -int -Box::print_smob (SCM /* x */, SCM p, scm_print_state *) -{ - scm_puts ("#", p); - return 1; -} +const char Box::type_p_name_[] = "ly:box?"; diff --git a/lily/context-def.cc b/lily/context-def.cc index 4df8e5e159..3ebc45d2a2 100644 --- a/lily/context-def.cc +++ b/lily/context-def.cc @@ -81,10 +81,7 @@ Context_def::~Context_def () { } -#include "ly-smobs.icc" -IMPLEMENT_SMOBS (Context_def); -IMPLEMENT_DEFAULT_EQUAL_P (Context_def); -IMPLEMENT_TYPE_P (Context_def, "ly:context-def?"); +const char Context_def::type_p_name_[] = "ly:context-def?"; int Context_def::print_smob (SCM smob, SCM port, scm_print_state *) diff --git a/lily/context-mod.cc b/lily/context-mod.cc index 2d35e05f83..398735900c 100644 --- a/lily/context-mod.cc +++ b/lily/context-mod.cc @@ -34,10 +34,7 @@ Context_mod::Context_mod (SCM mod_list) mods_ = scm_reverse (mod_list); } -#include "ly-smobs.icc" -IMPLEMENT_SIMPLE_SMOBS (Context_mod); -IMPLEMENT_DEFAULT_EQUAL_P (Context_mod); -IMPLEMENT_TYPE_P (Context_mod, "ly:context-mod?"); +const char Context_mod::type_p_name_[] = "ly:context-mod?"; int Context_mod::print_smob (SCM smob, SCM port, scm_print_state *) @@ -78,4 +75,3 @@ Context_mod::get_mods () const { return scm_reverse (mods_); } - diff --git a/lily/context-property.cc b/lily/context-property.cc index d7584d1381..07d512d6e3 100644 --- a/lily/context-property.cc +++ b/lily/context-property.cc @@ -63,8 +63,13 @@ typecheck_grob (SCM symbol, SCM value) || type_check_assignment (symbol, value, ly_symbol2scm ("backend-type?")); } -class Grob_properties +class Grob_properties : public Simple_smob { +public: + static int print_smob (SCM, SCM, scm_print_state *); + static SCM mark_smob (SCM); + static const char type_p_name_[]; +private: friend class Grob_property_info; friend SCM ly_make_grob_properties (SCM); // alist_ may contain unexpanded nested overrides @@ -88,13 +93,9 @@ class Grob_properties // order to trigger an initial update. But this should never // happen, so we initialize straight with alist. cooked_ (alist), cooked_from_ (alist), nested_ (0) { } - DECLARE_SIMPLE_SMOBS (Grob_properties); }; -#include "ly-smobs.icc" -IMPLEMENT_SIMPLE_SMOBS (Grob_properties); -IMPLEMENT_DEFAULT_EQUAL_P (Grob_properties); -IMPLEMENT_TYPE_P (Grob_properties, "ly:grob-properties?"); +const char Grob_properties::type_p_name_[] = "ly:grob-properties?"; SCM Grob_properties::mark_smob (SCM smob) diff --git a/lily/context.cc b/lily/context.cc index 718ef31122..5aacffc4eb 100644 --- a/lily/context.cc +++ b/lily/context.cc @@ -23,7 +23,6 @@ #include "dispatcher.hh" #include "global-context.hh" #include "international.hh" -#include "ly-smobs.icc" #include "main.hh" #include "output-def.hh" #include "profile.hh" @@ -715,9 +714,7 @@ Context::mark_smob (SCM sm) return me->properties_scm_; } -IMPLEMENT_SMOBS (Context); -IMPLEMENT_DEFAULT_EQUAL_P (Context); -IMPLEMENT_TYPE_P (Context, "ly:context?"); +const char Context::type_p_name_[] = "ly:context?"; Global_context * Context::get_global_context () const diff --git a/lily/dispatcher.cc b/lily/dispatcher.cc index 5f0e38007e..2e53730791 100644 --- a/lily/dispatcher.cc +++ b/lily/dispatcher.cc @@ -20,12 +20,9 @@ #include "dispatcher.hh" #include "input.hh" #include "international.hh" -#include "ly-smobs.icc" #include "warn.hh" -IMPLEMENT_SMOBS (Dispatcher); -IMPLEMENT_TYPE_P (Dispatcher, "ly:dispatcher?"); -IMPLEMENT_DEFAULT_EQUAL_P (Dispatcher); +const char Dispatcher::type_p_name_[] = "ly:dispatcher?"; Dispatcher::~Dispatcher () { diff --git a/lily/duration.cc b/lily/duration.cc index 894748f915..afc615cdb0 100644 --- a/lily/duration.cc +++ b/lily/duration.cc @@ -23,7 +23,6 @@ #include "misc.hh" #include "lily-proto.hh" -#include "ly-smobs.icc" int Duration::compare (Duration const &left, Duration const &right) @@ -137,15 +136,9 @@ Duration::to_string () const return s; } -IMPLEMENT_TYPE_P (Duration, "ly:duration?"); +const char Duration::type_p_name_[] = "ly:duration?"; -SCM -Duration::mark_smob (SCM) -{ - return SCM_EOL; -} -IMPLEMENT_SIMPLE_SMOBS (Duration); int Duration::print_smob (SCM s, SCM port, scm_print_state *) { diff --git a/lily/font-metric.cc b/lily/font-metric.cc index f12fc4ed2c..ab0f8f47e3 100644 --- a/lily/font-metric.cc +++ b/lily/font-metric.cc @@ -29,7 +29,6 @@ using namespace std; #include "stencil.hh" #include "warn.hh" -#include "ly-smobs.icc" Real Font_metric::design_size () const @@ -114,9 +113,7 @@ Font_metric::print_smob (SCM s, SCM port, scm_print_state *) return 1; } -IMPLEMENT_SMOBS (Font_metric); -IMPLEMENT_DEFAULT_EQUAL_P (Font_metric); -IMPLEMENT_TYPE_P (Font_metric, "ly:font-metric?"); +const char Font_metric::type_p_name_[] = "ly:font-metric?"; SCM Font_metric::font_file_name () const diff --git a/lily/grob-array.cc b/lily/grob-array.cc index 78ee5eff00..593ce6a568 100644 --- a/lily/grob-array.cc +++ b/lily/grob-array.cc @@ -21,7 +21,6 @@ #include "item.hh" #include "spanner.hh" -#include "ly-smobs.icc" Item * Grob_array::item (vsize i) @@ -113,10 +112,8 @@ Grob_array::set_array (vector const &src) grobs_ = src; } -IMPLEMENT_SIMPLE_SMOBS (Grob_array); -IMPLEMENT_TYPE_P (Grob_array, "ly:grob-array?"); +const char Grob_array::type_p_name_[] = "ly:grob-array?"; -IMPLEMENT_DEFAULT_EQUAL_P (Grob_array); SCM grob_list_to_grob_array (SCM lst) diff --git a/lily/grob-smob.cc b/lily/grob-smob.cc index a201c80043..eaec5420c2 100644 --- a/lily/grob-smob.cc +++ b/lily/grob-smob.cc @@ -22,11 +22,8 @@ #include "paper-score.hh" #include "warn.hh" -#include "ly-smobs.icc" -IMPLEMENT_SMOBS (Grob); -IMPLEMENT_DEFAULT_EQUAL_P (Grob); -IMPLEMENT_TYPE_P (Grob, "ly:grob?"); +const char Grob::type_p_name_[] = "ly:grob?"; SCM Grob::mark_smob (SCM ses) diff --git a/lily/grob.cc b/lily/grob.cc index c45dd09b27..eeb219e244 100644 --- a/lily/grob.cc +++ b/lily/grob.cc @@ -39,7 +39,6 @@ #include "unpure-pure-container.hh" #include "warn.hh" -#include "ly-smobs.icc" Grob * Grob::clone () const diff --git a/lily/include/book.hh b/lily/include/book.hh index 7527cf5062..eb0a105f86 100644 --- a/lily/include/book.hh +++ b/lily/include/book.hh @@ -26,11 +26,13 @@ #include "virtual-methods.hh" #include "smobs.hh" -class Book +class Book : public Smob { - DECLARE_SMOBS (Book); - public: + static int print_smob (SCM, SCM, scm_print_state *); + static SCM mark_smob (SCM); + static const char type_p_name_[]; + virtual ~Book (); SCM header_; Output_def *paper_; SCM scores_; diff --git a/lily/include/box.hh b/lily/include/box.hh index 685fbcff75..7d5745d696 100644 --- a/lily/include/box.hh +++ b/lily/include/box.hh @@ -9,10 +9,12 @@ #include "offset.hh" #include "smobs.hh" -class Box +class Box : public Simple_smob { +public: + static const char type_p_name_[]; +private: Interval interval_a_[NO_AXES]; - DECLARE_SIMPLE_SMOBS (Box); public: Interval &x () {return interval_a_[X_AXIS]; } Interval &y () { return interval_a_[Y_AXIS]; } diff --git a/lily/include/context-def.hh b/lily/include/context-def.hh index ecf1cb0c42..258d07ba92 100644 --- a/lily/include/context-def.hh +++ b/lily/include/context-def.hh @@ -31,8 +31,12 @@ The definition of an interpretation context as given in the input. The lists are stored in order of definition. */ -struct Context_def +struct Context_def : public Smob { + static SCM mark_smob (SCM); + static int print_smob (SCM, SCM, scm_print_state *); + static const char type_p_name_[]; + virtual ~Context_def (); private: /* these lists store the definition, in opposite order of entry @@ -76,11 +80,9 @@ public: void apply_default_property_operations (Context *); private: - DECLARE_SMOBS (Context_def); Context_def (); Context_def (Context_def const &); }; #endif /* CONTEXT_DEF_HH */ - diff --git a/lily/include/context-mod.hh b/lily/include/context-mod.hh index 44ba8d2ebc..424f06a8ec 100644 --- a/lily/include/context-mod.hh +++ b/lily/include/context-mod.hh @@ -34,8 +34,11 @@ Modifications for an interpretation context as given in the input. */ -struct Context_mod +struct Context_mod : public Simple_smob { + static SCM mark_smob (SCM); + static int print_smob (SCM, SCM, scm_print_state *); + static const char type_p_name_[]; private: SCM mods_; public: @@ -47,9 +50,7 @@ public: Context_mod (); Context_mod (Context_mod const &); Context_mod (SCM mod_list); - DECLARE_SIMPLE_SMOBS (Context_mod); }; #endif /* CONTEXT_MOD_HH */ - diff --git a/lily/include/context.hh b/lily/include/context.hh index c8bea9fad9..ab406c9041 100644 --- a/lily/include/context.hh +++ b/lily/include/context.hh @@ -28,12 +28,17 @@ #include "std-vector.hh" #include "virtual-methods.hh" -class Context +class Context : public Smob { +public: + static SCM mark_smob (SCM); + static int print_smob (SCM, SCM, scm_print_state *); + static const char type_p_name_[]; + virtual ~Context (); +private: Scheme_hash_table *properties_dict () const; Context (Context const &src); - DECLARE_SMOBS (Context); DECLARE_CLASSNAME (Context); void terminate (); diff --git a/lily/include/dispatcher.hh b/lily/include/dispatcher.hh index 1d3583bb67..2be14d9177 100644 --- a/lily/include/dispatcher.hh +++ b/lily/include/dispatcher.hh @@ -23,8 +23,14 @@ #include "listener.hh" #include "stream-event.hh" -class Dispatcher +class Dispatcher : public Smob { +public: + static int print_smob (SCM, SCM, scm_print_state *); + static SCM mark_smob (SCM); + static const char type_p_name_[]; + virtual ~Dispatcher (); +private: /* Hash table. Each event-class maps to a list of listeners. */ SCM listeners_; /* alist of dispatchers that we listen to. Each entry is a @@ -45,8 +51,6 @@ public: void remove_listener (Listener, SCM event_class); void register_as_listener (Dispatcher *dist); void unregister_as_listener (Dispatcher *dist); -protected: - DECLARE_SMOBS (Dispatcher); }; diff --git a/lily/include/duration.hh b/lily/include/duration.hh index 959ed09e1b..1eed866409 100644 --- a/lily/include/duration.hh +++ b/lily/include/duration.hh @@ -25,10 +25,11 @@ /** A musical duration. */ -struct Duration +struct Duration : public Simple_smob { -public: - + static SCM equal_p (SCM, SCM); + static int print_smob (SCM, SCM, scm_print_state *); + static const char type_p_name_[]; Duration (); Duration (int, int); Duration (Rational, bool scale); @@ -43,7 +44,6 @@ public: static int compare (Duration const &, Duration const &); DECLARE_SCHEME_CALLBACK (less_p, (SCM a, SCM b)); - DECLARE_SIMPLE_SMOBS (Duration); private: /// Logarithm of the base duration. @@ -58,4 +58,3 @@ INSTANTIATE_COMPARE (Duration, Duration::compare); extern SCM Duration_type_p_proc; #endif // DURATION_HH - diff --git a/lily/include/font-metric.hh b/lily/include/font-metric.hh index 720f33b837..0eb2e0808b 100644 --- a/lily/include/font-metric.hh +++ b/lily/include/font-metric.hh @@ -30,8 +30,14 @@ typedef std::map Index_to_charcode_map; -class Font_metric +class Font_metric : public Smob { +public: + static int print_smob (SCM, SCM, scm_print_state *); + static SCM mark_smob (SCM); + static const char type_p_name_[]; + virtual ~Font_metric (); +private: DECLARE_CLASSNAME (Font_metric); public: @@ -54,7 +60,6 @@ public: virtual Stencil find_by_name (string) const; virtual SCM sub_fonts () const; virtual SCM font_file_name () const; - DECLARE_SMOBS (Font_metric); private: /* No copying, no implicit copy constructor. */ diff --git a/lily/include/grob-array.hh b/lily/include/grob-array.hh index 33d458cea8..feeda8a36a 100644 --- a/lily/include/grob-array.hh +++ b/lily/include/grob-array.hh @@ -24,12 +24,16 @@ #include "smobs.hh" #include "std-vector.hh" -class Grob_array +class Grob_array : public Simple_smob { +public: + static int print_smob (SCM, SCM, scm_print_state *); + static SCM mark_smob (SCM); + static const char type_p_name_[]; +private: vector grobs_; bool ordered_; - DECLARE_SIMPLE_SMOBS (Grob_array); Grob_array (); public: @@ -55,4 +59,3 @@ SCM grob_list_to_grob_array (SCM lst); SCM grob_array_to_list (Grob_array *array); #endif /* GROB_ARRAY_HH */ - diff --git a/lily/include/grob.hh b/lily/include/grob.hh index 2aec0fa909..ae2a9a20a1 100644 --- a/lily/include/grob.hh +++ b/lily/include/grob.hh @@ -27,10 +27,14 @@ #include -class Grob +class Grob : public Smob { +public: + static int print_smob (SCM, SCM, scm_print_state *); + static SCM mark_smob (SCM); + static const char type_p_name_[]; + virtual ~Grob (); private: - DECLARE_SMOBS (Grob); DECLARE_CLASSNAME (Grob); void init (); diff --git a/lily/include/lily-lexer.hh b/lily/include/lily-lexer.hh index 10dbc48389..050e01f525 100644 --- a/lily/include/lily-lexer.hh +++ b/lily/include/lily-lexer.hh @@ -31,10 +31,13 @@ bool busy_parsing (); void kill_lexer (); void set_lexer (); -class Lily_lexer : public Includable_lexer +class Lily_lexer : public Smob, public Includable_lexer { - DECLARE_SMOBS (Lily_lexer); - +public: + static int print_smob (SCM, SCM, scm_print_state *); + static SCM mark_smob (SCM); + static const char type_p_name_[]; + virtual ~Lily_lexer (); private: int lookup_keyword (const string&); int scan_bare_word (const string&); diff --git a/lily/include/lily-parser.hh b/lily/include/lily-parser.hh index 305d439ee2..2ea3b0c6dc 100644 --- a/lily/include/lily-parser.hh +++ b/lily/include/lily-parser.hh @@ -29,11 +29,13 @@ TODO: interface is too complicated */ -class Lily_parser +class Lily_parser : public Smob { - DECLARE_SMOBS (Lily_parser); - public: + static int print_smob (SCM, SCM, scm_print_state *); + static SCM mark_smob (SCM); + static const char type_p_name_[]; + virtual ~Lily_parser (); Lily_lexer *lexer_; Sources *sources_; Duration default_duration_; diff --git a/lily/include/listener.hh b/lily/include/listener.hh index 51ad5db821..38b11b2d34 100644 --- a/lily/include/listener.hh +++ b/lily/include/listener.hh @@ -70,8 +70,14 @@ typedef struct bool (*equal_callback) (void *, void *); } Listener_function_table; -class Listener +class Listener : public Simple_smob { +public: + static SCM equal_p (SCM, SCM); + static int print_smob (SCM, SCM, scm_print_state *); + static SCM mark_smob (SCM); + static const char type_p_name_[]; +private: void *target_; Listener_function_table *type_; public: @@ -87,7 +93,6 @@ public: && (*type_->equal_callback) ((void *) target_, (void *) other.target_); } - DECLARE_SIMPLE_SMOBS (Listener); }; #define IMPLEMENT_LISTENER(cl, method) \ diff --git a/lily/include/moment.hh b/lily/include/moment.hh index 2f53c9e258..da3542f964 100644 --- a/lily/include/moment.hh +++ b/lily/include/moment.hh @@ -27,10 +27,12 @@ Musical timing (Main-timing, grace-timing) with glue for Guilification; */ -class Moment +class Moment : public Simple_smob { - DECLARE_SIMPLE_SMOBS (Moment); public: + static SCM equal_p (SCM, SCM); + static int print_smob (SCM, SCM, scm_print_state *); + static const char type_p_name_[]; Moment (); Moment (int m); @@ -80,4 +82,3 @@ ostream &operator << (ostream &, Moment const &); bool moment_less (SCM a, SCM b); #endif /* MOMENT_HH */ - diff --git a/lily/include/music-iterator.hh b/lily/include/music-iterator.hh index 436318bd38..cf7d640626 100644 --- a/lily/include/music-iterator.hh +++ b/lily/include/music-iterator.hh @@ -58,14 +58,18 @@ merge pending_moment and process? */ -class Music_iterator +class Music_iterator : public Smob { +public: + static int print_smob (SCM, SCM, scm_print_state *); + static SCM mark_smob (SCM); + static const char type_p_name_[]; + virtual ~Music_iterator (); protected: Moment music_length_; Moment start_mom_; DECLARE_CLASSNAME (Music_iterator); - DECLARE_SMOBS (Music_iterator); Music_iterator (Music_iterator const &); public: diff --git a/lily/include/music-output.hh b/lily/include/music-output.hh index 73d2ac94c6..685b764160 100644 --- a/lily/include/music-output.hh +++ b/lily/include/music-output.hh @@ -26,9 +26,14 @@ #include "smobs.hh" #include "virtual-methods.hh" -class Music_output +class Music_output : public Smob { - DECLARE_SMOBS (Music_output); +public: + static int print_smob (SCM, SCM, scm_print_state *); + static SCM mark_smob (SCM); + static const char type_p_name_[]; + virtual ~Music_output (); +private: DECLARE_CLASSNAME (Music_output); protected: Music_output (); diff --git a/lily/include/output-def.hh b/lily/include/output-def.hh index e0091e3654..1e572e6e30 100644 --- a/lily/include/output-def.hh +++ b/lily/include/output-def.hh @@ -46,14 +46,14 @@ one coming from score at markup level) */ -class Output_def +class Output_def : public Smob { - public: + static int print_smob (SCM, SCM, scm_print_state *); + static SCM mark_smob (SCM); + virtual ~Output_def (); VIRTUAL_COPY_CONSTRUCTOR (Output_def, Output_def); - DECLARE_SMOBS (Output_def); -public: SCM scope_; Output_def *parent_; diff --git a/lily/include/page-marker.hh b/lily/include/page-marker.hh index 8f344d41af..53c29d4f32 100644 --- a/lily/include/page-marker.hh +++ b/lily/include/page-marker.hh @@ -23,10 +23,14 @@ #include "smobs.hh" #include "virtual-methods.hh" -class Page_marker +class Page_marker : public Smob { - DECLARE_SMOBS (Page_marker); - +public: + static int print_smob (SCM, SCM, scm_print_state *); + static SCM mark_smob (SCM); + static const char type_p_name_[]; + virtual ~Page_marker (); +private: SCM symbol_; /* either 'page-turn-permission or 'page-break-permission */ SCM permission_; /* 'force, 'allow, or '() */ SCM label_; /* bookmarking label (a symbol) */ diff --git a/lily/include/paper-book.hh b/lily/include/paper-book.hh index 42dc8c0065..beca941da7 100644 --- a/lily/include/paper-book.hh +++ b/lily/include/paper-book.hh @@ -27,10 +27,14 @@ exports them to the output backend, either as systems or as completely formatted pages. */ -class Paper_book +class Paper_book : public Smob { - DECLARE_SMOBS (Paper_book); - +public: + static int print_smob (SCM, SCM, scm_print_state *); + static SCM mark_smob (SCM); + static const char type_p_name_[]; + virtual ~Paper_book (); +private: SCM systems_; SCM pages_; SCM performances_; diff --git a/lily/include/paper-outputter.hh b/lily/include/paper-outputter.hh index b7dd8399bf..a156c382d9 100644 --- a/lily/include/paper-outputter.hh +++ b/lily/include/paper-outputter.hh @@ -30,15 +30,17 @@ Glue between the backend (grobs, systems, pages) and the output file. proxy for Scheme backends. */ -class Paper_outputter +class Paper_outputter : public Smob { +public: + static int print_smob (SCM, SCM, scm_print_state *); + static SCM mark_smob (SCM); + virtual ~Paper_outputter (); +private: SCM output_module_; string file_name_; SCM file_; -public: - DECLARE_SMOBS (Paper_outputter); - public: Paper_outputter (SCM port, const string &format); diff --git a/lily/include/pitch.hh b/lily/include/pitch.hh index 91c5274557..e21f629b57 100644 --- a/lily/include/pitch.hh +++ b/lily/include/pitch.hh @@ -32,8 +32,13 @@ Pitch is lexicographically ordered by (octave, notename, alteration). */ -class Pitch +class Pitch : public Simple_smob { +public: + static SCM equal_p (SCM, SCM); + static int print_smob (SCM, SCM, scm_print_state *); + static SCM mark_smob (SCM); + static const char type_p_name_[]; private: int octave_; int notename_; @@ -70,7 +75,6 @@ public: string to_string () const; DECLARE_SCHEME_CALLBACK (less_p, (SCM a, SCM b)); - DECLARE_SIMPLE_SMOBS (Pitch); }; enum diff --git a/lily/include/prob.hh b/lily/include/prob.hh index 6fd7c49081..eb19c8d79a 100644 --- a/lily/include/prob.hh +++ b/lily/include/prob.hh @@ -31,9 +31,15 @@ Property_object. Page-breaking handles Property_object objects. */ -class Prob +class Prob : public Smob { - DECLARE_SMOBS (Prob); +public: + static int print_smob (SCM, SCM, scm_print_state *); + static SCM mark_smob (SCM); + static SCM equal_p (SCM, SCM); + static const char type_p_name_[]; + virtual ~Prob (); +private: DECLARE_CLASSNAME (Prob); void init_vars (); diff --git a/lily/include/scale.hh b/lily/include/scale.hh index daaf0bb2dc..d3d132810b 100644 --- a/lily/include/scale.hh +++ b/lily/include/scale.hh @@ -24,9 +24,9 @@ #include "rational.hh" #include "std-vector.hh" -struct Scale +struct Scale : public Smob { -public: + virtual ~Scale (); Scale (vector const &); Scale (Scale const &); @@ -35,7 +35,6 @@ public: int step_count () const; int normalize_step (int step) const; - DECLARE_SMOBS (Scale); private: vector step_tones_; @@ -44,4 +43,3 @@ private: extern Scale *default_global_scale; #endif /* SCALE_HH */ - diff --git a/lily/include/scheme-listener.hh b/lily/include/scheme-listener.hh index 56ede65e7d..b8e42ee911 100644 --- a/lily/include/scheme-listener.hh +++ b/lily/include/scheme-listener.hh @@ -21,19 +21,19 @@ #define SCHEME_LISTENER_HH #include "listener.hh" -#include "ly-smobs.icc" /* Scheme_listener is only used internally by scheme-listener-scheme.cc */ -class Scheme_listener +class Scheme_listener : public Smob { public: + static int print_smob (SCM, SCM, scm_print_state *); + static SCM mark_smob (SCM); + virtual ~Scheme_listener (); Scheme_listener (SCM callback); DECLARE_LISTENER (call); -protected: - DECLARE_SMOBS (Scheme_listener); private: SCM callback_; }; diff --git a/lily/include/scm-hash.hh b/lily/include/scm-hash.hh index 1182c503f9..1a15aff359 100644 --- a/lily/include/scm-hash.hh +++ b/lily/include/scm-hash.hh @@ -43,9 +43,12 @@ scm_gc_unprotect_object (tab->self_scm_); */ -class Scheme_hash_table +class Scheme_hash_table : public Smob { public: + static int print_smob (SCM, SCM, scm_print_state *); + static SCM mark_smob (SCM); + virtual ~Scheme_hash_table (); bool try_retrieve (SCM key, SCM *val); bool contains (SCM key) const; void set (SCM k, SCM v); @@ -59,8 +62,6 @@ public: private: SCM hash_tab_; void copy (Scheme_hash_table const &src); - DECLARE_SMOBS (Scheme_hash_table); }; #endif /* SCM_HASH_HH */ - diff --git a/lily/include/score.hh b/lily/include/score.hh index 8cc40c84cb..15e32ab173 100644 --- a/lily/include/score.hh +++ b/lily/include/score.hh @@ -27,10 +27,14 @@ #include "smobs.hh" #include "virtual-methods.hh" -class Score +class Score : public Smob { - DECLARE_SMOBS (Score); - +public: + static int print_smob (SCM, SCM, scm_print_state *); + static SCM mark_smob (SCM); + static const char type_p_name_[]; + virtual ~Score (); +private: SCM music_; SCM input_location_; SCM header_; diff --git a/lily/include/simple-spacer.hh b/lily/include/simple-spacer.hh index 71b1045aca..32bf205e86 100644 --- a/lily/include/simple-spacer.hh +++ b/lily/include/simple-spacer.hh @@ -25,7 +25,7 @@ #include "spring.hh" #include "smobs.hh" -class Simple_spacer +class Simple_spacer : public Simple_smob { public: Simple_spacer (); @@ -43,7 +43,6 @@ public: Real force_penalty (bool ragged) const; bool fits () const; - DECLARE_SIMPLE_SMOBS (Simple_spacer); private: Real expand_line (); @@ -69,4 +68,3 @@ Column_x_positions get_line_configuration (vector const &columns, bool ragged); #endif /* SIMPLE_SPACER_HH */ - diff --git a/lily/include/skyline-pair.hh b/lily/include/skyline-pair.hh index 0d37f794f4..26f2542e0a 100644 --- a/lily/include/skyline-pair.hh +++ b/lily/include/skyline-pair.hh @@ -22,12 +22,14 @@ #include "skyline.hh" -class Skyline_pair +class Skyline_pair : public Simple_smob { +public: + static int print_smob (SCM, SCM, scm_print_state *); + static const char type_p_name_[]; private: Drul_array skylines_; - DECLARE_SIMPLE_SMOBS (Skyline_pair); public: Skyline_pair (); Skyline_pair (vector const &boxes, Axis a); diff --git a/lily/include/skyline.hh b/lily/include/skyline.hh index bdb8be7813..c3309700e6 100644 --- a/lily/include/skyline.hh +++ b/lily/include/skyline.hh @@ -49,8 +49,12 @@ struct Building Real shift_to_intersect (Real x, Real y) const; }; -class Skyline +class Skyline : public Simple_smob { +public: + static int print_smob (SCM, SCM, scm_print_state *); + static SCM mark_smob (SCM); + static const char type_p_name_[]; private: list buildings_; Direction sky_; @@ -62,7 +66,6 @@ private: Real internal_distance (Skyline const &, Real *touch_point) const; void normalize (); - DECLARE_SIMPLE_SMOBS (Skyline); public: Skyline (); @@ -107,4 +110,3 @@ public: extern bool debug_skylines; #endif /* SKYLINE_HH */ - diff --git a/lily/include/source-file.hh b/lily/include/source-file.hh index 26bf6dbdb4..7647ce3830 100644 --- a/lily/include/source-file.hh +++ b/lily/include/source-file.hh @@ -35,8 +35,14 @@ using namespace std; get_line (), get_word () here. */ -class Source_file +class Source_file : public Smob { +public: + static int print_smob (SCM, SCM, scm_print_state *); + static SCM mark_smob (SCM); + static const char type_p_name_[]; + virtual ~Source_file (); +private: vector newline_locations_; istream *istream_; vector characters_; @@ -46,7 +52,6 @@ class Source_file void init_port (); void init (); - DECLARE_SMOBS (Source_file); public: Source_file (const string &fn); Source_file (const string&, const string&); @@ -61,7 +66,6 @@ public: string name_string () const; string file_line_column_string (char const *str0) const; -public: Slice line_slice (char const *pos_str0) const; string line_string (char const *pos_str0) const; void get_counts (char const *pos_str0, int *, int *, int *, int *) const; @@ -76,4 +80,3 @@ protected: vector gulp_file (const string &fn, int desired); #endif /* SOURCE_FILE_HH */ - diff --git a/lily/include/spring.hh b/lily/include/spring.hh index 1f6aa3b70c..ce3dbfd93b 100644 --- a/lily/include/spring.hh +++ b/lily/include/spring.hh @@ -23,8 +23,12 @@ #include "lily-proto.hh" #include "smobs.hh" -class Spring +class Spring : public Simple_smob { +public: + static SCM equal_p (SCM, SCM); + static const char type_p_name_[]; +private: Real distance_; Real min_distance_; @@ -35,7 +39,6 @@ class Spring void update_blocking_force (); - DECLARE_SIMPLE_SMOBS (Spring); public: Spring (); Spring (Real distance, Real min_distance); @@ -65,4 +68,3 @@ public: Spring merge_springs (vector const &springs); #endif /* SPRING_HH */ - diff --git a/lily/include/stencil.hh b/lily/include/stencil.hh index cc8d750c1f..e91cfa9759 100644 --- a/lily/include/stencil.hh +++ b/lily/include/stencil.hh @@ -55,12 +55,16 @@ using namespace std; DIMENSIONS = (Interval (0, 0), Interval (0, 0) */ -class Stencil +class Stencil : public Simple_smob { +public: + static SCM mark_smob (SCM); + static int print_smob (SCM, SCM, scm_print_state *); + static const char type_p_name_[]; +private: Box dim_; SCM expr_; - DECLARE_SIMPLE_SMOBS (Stencil); public: Stencil (Box, SCM s); Stencil (); diff --git a/lily/include/translator-dispatch-list.hh b/lily/include/translator-dispatch-list.hh index bdb9e57ef3..38a67e5fed 100644 --- a/lily/include/translator-dispatch-list.hh +++ b/lily/include/translator-dispatch-list.hh @@ -30,7 +30,7 @@ struct Engraver_dispatch_entry Engraver_void_function_engraver_grob_info function_; }; -class Engraver_dispatch_list +class Engraver_dispatch_list : public Simple_smob { vector dispatch_entries_; public: @@ -38,7 +38,6 @@ public: SCM static create (SCM trans_list, SCM iface_list, Direction); - DECLARE_SIMPLE_SMOBS (Engraver_dispatch_list); }; #endif /* TRANSLATOR_DISPATCH_LIST_HH */ diff --git a/lily/include/translator-group.hh b/lily/include/translator-group.hh index 0774930bf7..17352269d9 100644 --- a/lily/include/translator-group.hh +++ b/lily/include/translator-group.hh @@ -47,8 +47,13 @@ struct Translator_method_binding } }; -class Translator_group +class Translator_group : public Smob { +public: + static SCM mark_smob (SCM); + static int print_smob (SCM, SCM, scm_print_state *); + static const char type_p_name_[]; + virtual ~Translator_group (); private: void precompute_method_bindings (); vector @@ -63,9 +68,7 @@ private: public: VIRTUAL_COPY_CONSTRUCTOR (Translator_group, Translator_group); - DECLARE_SMOBS (Translator_group); -public: virtual void connect_to_context (Context *c); virtual void disconnect_from_context (); virtual SCM get_simple_trans_list (); diff --git a/lily/include/translator.hh b/lily/include/translator.hh index 0f8202e6be..31cbe0590d 100644 --- a/lily/include/translator.hh +++ b/lily/include/translator.hh @@ -117,8 +117,14 @@ enum Translator_precompute_index /* Translate music into grobs. */ -class Translator +class Translator : public Smob { +public: + static int print_smob (SCM, SCM, scm_print_state *); + static SCM mark_smob (SCM); + static const char type_p_name_[]; + virtual ~Translator (); +private: void init (); public: @@ -148,7 +154,6 @@ public: Global_context *get_global_context () const; TRANSLATOR_DECLARATIONS (Translator); - DECLARE_SMOBS (Translator); protected: // should be private. Context *daddy_context_; diff --git a/lily/input-smob.cc b/lily/input-smob.cc index 07748ad48f..420177e2d7 100644 --- a/lily/input-smob.cc +++ b/lily/input-smob.cc @@ -21,7 +21,6 @@ #include "source-file.hh" #include "std-string.hh" -#include "ly-smobs.icc" /* Dummy input location for use if real one is missing. */ Input dummy_input_global; @@ -99,4 +98,3 @@ Input::unsmob (SCM s) } ADD_SCM_INIT_FUNC (input, start_input_smobs); - diff --git a/lily/lily-lexer.cc b/lily/lily-lexer.cc index 857aa6463f..921dd2ad7a 100644 --- a/lily/lily-lexer.cc +++ b/lily/lily-lexer.cc @@ -364,11 +364,8 @@ Lily_lexer::add_lexed_char (int count) char_count_stack_.back () += count; } -#include "ly-smobs.icc" -IMPLEMENT_SMOBS (Lily_lexer); -IMPLEMENT_TYPE_P (Lily_lexer, "ly:lily-lexer?"); -IMPLEMENT_DEFAULT_EQUAL_P (Lily_lexer); +const char Lily_lexer::type_p_name_[] = "ly:lily-lexer?"; SCM Lily_lexer::mark_smob (SCM s) diff --git a/lily/lily-parser.cc b/lily/lily-parser.cc index 1cdd8d0429..b9100e1236 100644 --- a/lily/lily-parser.cc +++ b/lily/lily-parser.cc @@ -37,7 +37,6 @@ #include "warn.hh" #include "program-option.hh" -#include "ly-smobs.icc" Lily_parser::Lily_parser (Sources *sources) { @@ -211,9 +210,7 @@ Lily_parser::parser_error (Input const &i, const string &s) error_level_ = 1; } -IMPLEMENT_SMOBS (Lily_parser); -IMPLEMENT_TYPE_P (Lily_parser, "ly:lily-parser?"); -IMPLEMENT_DEFAULT_EQUAL_P (Lily_parser); +const char Lily_parser::type_p_name_[] = "ly:lily-parser?"; /**************************************************************** OUTPUT-DEF diff --git a/lily/listener.cc b/lily/listener.cc index cb966adc9a..7dc4cc370c 100644 --- a/lily/listener.cc +++ b/lily/listener.cc @@ -18,7 +18,6 @@ */ #include "listener.hh" -#include "ly-smobs.icc" #include "warn.hh" Listener::Listener () @@ -69,5 +68,4 @@ Listener::equal_p (SCM a, SCM b) return (*l1 == *l2) ? SCM_BOOL_T : SCM_BOOL_F; } -IMPLEMENT_SIMPLE_SMOBS (Listener); -IMPLEMENT_TYPE_P (Listener, "ly:listener?"); +const char Listener::type_p_name_[] = "ly:listener?"; diff --git a/lily/moment.cc b/lily/moment.cc index adcecff767..b1cf64969f 100644 --- a/lily/moment.cc +++ b/lily/moment.cc @@ -43,16 +43,9 @@ Moment::Moment (Rational m) grace_part_ = Rational (0); } -#include "ly-smobs.icc" -IMPLEMENT_SIMPLE_SMOBS (Moment); -IMPLEMENT_TYPE_P (Moment, "ly:moment?"); +const char Moment::type_p_name_[] = "ly:moment?"; -SCM -Moment::mark_smob (SCM) -{ - return SCM_EOL; -} int Moment::print_smob (SCM s, SCM port, scm_print_state *) @@ -207,4 +200,3 @@ moment_less (SCM a, SCM b) { return *Moment::unsmob (a) < *Moment::unsmob (b); } - diff --git a/lily/music-function.cc b/lily/music-function.cc index 65fedab7dd..d519f86283 100644 --- a/lily/music-function.cc +++ b/lily/music-function.cc @@ -20,11 +20,13 @@ #include "music-function.hh" #include "music.hh" -#include "ly-smobs.icc" -class Musicfunction +class Musicfunction : public Simple_smob { - DECLARE_SIMPLE_SMOBS (Musicfunction); +public: + static SCM mark_smob (SCM); + static int print_smob (SCM, SCM, scm_print_state *); +private: SCM signature_; SCM function_; public: @@ -34,8 +36,6 @@ public: SCM get_signature () { return signature_; } }; -IMPLEMENT_SIMPLE_SMOBS (Musicfunction); -IMPLEMENT_DEFAULT_EQUAL_P (Musicfunction); /* Print a textual represenation of the smob to a given port. */ int diff --git a/lily/music-iterator.cc b/lily/music-iterator.cc index 009583d8e3..3647d4dc46 100644 --- a/lily/music-iterator.cc +++ b/lily/music-iterator.cc @@ -30,7 +30,6 @@ using namespace std; #include "music-wrapper-iterator.hh" #include "simple-music-iterator.hh" -#include "ly-smobs.icc" Music_iterator::Music_iterator () { @@ -193,9 +192,7 @@ Music_iterator::get_music () const /****************************************************************/ -IMPLEMENT_TYPE_P (Music_iterator, "ly:iterator?"); -IMPLEMENT_SMOBS (Music_iterator); -IMPLEMENT_DEFAULT_EQUAL_P (Music_iterator); +const char Music_iterator::type_p_name_[] = "ly:iterator?"; SCM Music_iterator::mark_smob (SCM smob) diff --git a/lily/music-output.cc b/lily/music-output.cc index 438cddaaa9..d0c08a1188 100644 --- a/lily/music-output.cc +++ b/lily/music-output.cc @@ -19,7 +19,6 @@ #include "music-output.hh" -#include "ly-smobs.icc" Music_output::Music_output () { @@ -40,9 +39,7 @@ Music_output::derived_mark () const { } -IMPLEMENT_SMOBS (Music_output); -IMPLEMENT_DEFAULT_EQUAL_P (Music_output); -IMPLEMENT_TYPE_P (Music_output, "ly:music-output?"); +const char Music_output::type_p_name_[] = "ly:music-output?"; SCM Music_output::mark_smob (SCM s) diff --git a/lily/music.cc b/lily/music.cc index 31bda8a263..831e9f3805 100644 --- a/lily/music.cc +++ b/lily/music.cc @@ -24,7 +24,6 @@ #include "duration.hh" #include "input.hh" #include "international.hh" -#include "ly-smobs.icc" #include "main.hh" #include "music-sequence.hh" #include "score.hh" diff --git a/lily/output-def.cc b/lily/output-def.cc index 9c93dc6881..ca0f7ad88a 100644 --- a/lily/output-def.cc +++ b/lily/output-def.cc @@ -29,7 +29,6 @@ #include "scm-hash.hh" #include "warn.hh" -#include "ly-smobs.icc" #include "program-option.hh" @@ -61,8 +60,6 @@ Output_def::~Output_def () { } -IMPLEMENT_SMOBS (Output_def); -IMPLEMENT_DEFAULT_EQUAL_P (Output_def); SCM Output_def::mark_smob (SCM m) @@ -259,5 +256,3 @@ line_dimensions_int (Output_def *def, int n) : def->get_dimension (ly_symbol2scm ("indent")); return Interval (ind, lw); } - - diff --git a/lily/page-marker.cc b/lily/page-marker.cc index aa66ee31ea..ba5342ab2b 100644 --- a/lily/page-marker.cc +++ b/lily/page-marker.cc @@ -18,7 +18,6 @@ */ #include "page-marker.hh" -#include "ly-smobs.icc" Page_marker::Page_marker () { @@ -40,9 +39,7 @@ Page_marker::~Page_marker () { } -IMPLEMENT_SMOBS (Page_marker); -IMPLEMENT_DEFAULT_EQUAL_P (Page_marker); -IMPLEMENT_TYPE_P (Page_marker, "ly:page-marker?"); +const char Page_marker::type_p_name_[] = "ly:page-marker?"; SCM Page_marker::mark_smob (SCM smob) diff --git a/lily/paper-book.cc b/lily/paper-book.cc index fba89c2c83..3a6d4b1074 100644 --- a/lily/paper-book.cc +++ b/lily/paper-book.cc @@ -31,7 +31,6 @@ #include "program-option.hh" #include "page-marker.hh" -#include "ly-smobs.icc" Paper_book::Paper_book () { @@ -52,9 +51,7 @@ Paper_book::~Paper_book () { } -IMPLEMENT_DEFAULT_EQUAL_P (Paper_book); -IMPLEMENT_SMOBS (Paper_book); -IMPLEMENT_TYPE_P (Paper_book, "ly:paper-book?"); +const char Paper_book::type_p_name_[] = "ly:paper-book?"; SCM Paper_book::mark_smob (SCM smob) diff --git a/lily/paper-outputter.cc b/lily/paper-outputter.cc index 6dff324243..712c9c9bab 100644 --- a/lily/paper-outputter.cc +++ b/lily/paper-outputter.cc @@ -38,7 +38,6 @@ using namespace std; #include "string-convert.hh" #include "warn.hh" -#include "ly-smobs.icc" Paper_outputter::Paper_outputter (SCM port, const string &format) { @@ -61,8 +60,6 @@ Paper_outputter::~Paper_outputter () { } -IMPLEMENT_SMOBS (Paper_outputter); -IMPLEMENT_DEFAULT_EQUAL_P (Paper_outputter); SCM Paper_outputter::mark_smob (SCM x) diff --git a/lily/pitch.cc b/lily/pitch.cc index a030f1281c..8fd4d67171 100644 --- a/lily/pitch.cc +++ b/lily/pitch.cc @@ -24,7 +24,6 @@ #include "string-convert.hh" #include "warn.hh" -#include "ly-smobs.icc" #include Pitch::Pitch (int o, int n, Rational a) @@ -219,7 +218,7 @@ Pitch::down_to (int notename) notename_ = notename; } -IMPLEMENT_TYPE_P (Pitch, "ly:pitch?"); +const char Pitch::type_p_name_[] = "ly:pitch?"; SCM Pitch::mark_smob (SCM x) { @@ -227,7 +226,6 @@ Pitch::mark_smob (SCM x) return p->scale_->self_scm (); } -IMPLEMENT_SIMPLE_SMOBS (Pitch); int Pitch::print_smob (SCM s, SCM port, scm_print_state *) { diff --git a/lily/prob.cc b/lily/prob.cc index b5619fae66..bb679512d3 100644 --- a/lily/prob.cc +++ b/lily/prob.cc @@ -23,10 +23,8 @@ #include "input.hh" #include "profile.hh" -#include "ly-smobs.icc" -IMPLEMENT_SMOBS (Prob); -IMPLEMENT_TYPE_P (Prob, "ly:prob?"); +const char Prob::type_p_name_[] = "ly:prob?"; SCM Prob::equal_p (SCM sa, SCM sb) @@ -198,4 +196,3 @@ Prob::name () const else return this->class_name (); } - diff --git a/lily/scale.cc b/lily/scale.cc index 3dff7b4b33..8bdf02bdf0 100644 --- a/lily/scale.cc +++ b/lily/scale.cc @@ -21,7 +21,6 @@ #include "scale.hh" -#include "ly-smobs.icc" /* todo: put string <-> pitch here too. @@ -134,20 +133,7 @@ Scale::normalize_step (int step) const return ret; } -int -Scale::print_smob (SCM /* x */, - SCM port, - scm_print_state *) -{ - scm_puts ("#", port); - return 1; -} -SCM -Scale::mark_smob (SCM) -{ - return SCM_UNSPECIFIED; -} Scale::Scale (vector const &tones) { @@ -165,6 +151,3 @@ Scale::Scale (Scale const &src) Scale::~Scale () { } - -IMPLEMENT_SMOBS (Scale); -IMPLEMENT_DEFAULT_EQUAL_P (Scale); diff --git a/lily/scheme-listener.cc b/lily/scheme-listener.cc index 2388d4a88a..2807cc4ad1 100644 --- a/lily/scheme-listener.cc +++ b/lily/scheme-listener.cc @@ -26,8 +26,6 @@ Scheme_listener::call (SCM ev) scm_call_1 (callback_, ev); } -IMPLEMENT_SMOBS (Scheme_listener); -IMPLEMENT_DEFAULT_EQUAL_P (Scheme_listener); Scheme_listener::Scheme_listener (SCM c) { diff --git a/lily/scm-hash.cc b/lily/scm-hash.cc index 83e937bc58..173dd49ccc 100644 --- a/lily/scm-hash.cc +++ b/lily/scm-hash.cc @@ -23,7 +23,6 @@ #include using namespace std; -#include "ly-smobs.icc" /* Return: number of objects. @@ -147,6 +146,3 @@ Scheme_hash_table::to_alist () const return scm_internal_hash_fold ((scm_t_hash_fold_fn) &collect_handles, NULL, SCM_EOL, hash_tab_); } - -IMPLEMENT_SMOBS (Scheme_hash_table); -IMPLEMENT_DEFAULT_EQUAL_P (Scheme_hash_table); diff --git a/lily/score.cc b/lily/score.cc index 81477a118a..b531695469 100644 --- a/lily/score.cc +++ b/lily/score.cc @@ -36,7 +36,6 @@ using namespace std; #include "paper-score.hh" #include "warn.hh" -#include "ly-smobs.icc" Input * Score::origin () const @@ -60,9 +59,7 @@ Score::~Score () { } -IMPLEMENT_SMOBS (Score); -IMPLEMENT_DEFAULT_EQUAL_P (Score); -IMPLEMENT_TYPE_P (Score, "ly:score?"); +const char Score::type_p_name_[] = "ly:score?"; SCM Score::mark_smob (SCM s) diff --git a/lily/simple-spacer.cc b/lily/simple-spacer.cc index e21cbbf0ef..1f2f5aaa6d 100644 --- a/lily/simple-spacer.cc +++ b/lily/simple-spacer.cc @@ -534,22 +534,3 @@ get_line_configuration (vector const &columns, return ret; } - -#include "ly-smobs.icc" - -IMPLEMENT_SIMPLE_SMOBS (Simple_spacer); -IMPLEMENT_DEFAULT_EQUAL_P (Simple_spacer); - -SCM -Simple_spacer::mark_smob (SCM /* x */) -{ - return SCM_EOL; -} - -int -Simple_spacer::print_smob (SCM /* x */, SCM p, scm_print_state *) -{ - scm_puts ("#", p); - return 1; -} - diff --git a/lily/skyline-pair.cc b/lily/skyline-pair.cc index d6bd5fb6fe..f95a5e7b74 100644 --- a/lily/skyline-pair.cc +++ b/lily/skyline-pair.cc @@ -21,7 +21,6 @@ #include "skyline-pair.hh" #include "international.hh" -#include "ly-smobs.icc" Skyline_pair::Skyline_pair () : skylines_ (Skyline (DOWN), Skyline (UP)) @@ -128,15 +127,8 @@ Skyline_pair::operator [] (Direction d) const return skylines_[d]; } -IMPLEMENT_SIMPLE_SMOBS (Skyline_pair); -IMPLEMENT_TYPE_P (Skyline_pair, "ly:skyline-pair?"); -IMPLEMENT_DEFAULT_EQUAL_P (Skyline_pair); +const char Skyline_pair::type_p_name_[] = "ly:skyline-pair?"; -SCM -Skyline_pair::mark_smob (SCM) -{ - return SCM_EOL; -} int Skyline_pair::print_smob (SCM s, SCM port, scm_print_state *) diff --git a/lily/skyline.cc b/lily/skyline.cc index 33d2823d47..6d6b58ca10 100644 --- a/lily/skyline.cc +++ b/lily/skyline.cc @@ -22,7 +22,6 @@ #include #include -#include "ly-smobs.icc" /* A skyline is a sequence of non-overlapping buildings: something like this: @@ -862,9 +861,7 @@ Skyline::clear () /****************************************************************/ -IMPLEMENT_SIMPLE_SMOBS (Skyline); -IMPLEMENT_TYPE_P (Skyline, "ly:skyline?"); -IMPLEMENT_DEFAULT_EQUAL_P (Skyline); +const char Skyline::type_p_name_[] = "ly:skyline?"; SCM Skyline::mark_smob (SCM s) diff --git a/lily/source-file.cc b/lily/source-file.cc index d80704ae76..34f8c8b9c5 100644 --- a/lily/source-file.cc +++ b/lily/source-file.cc @@ -358,11 +358,8 @@ Source_file::get_port () const /****************************************************************/ -#include "ly-smobs.icc" -IMPLEMENT_SMOBS (Source_file); -IMPLEMENT_DEFAULT_EQUAL_P (Source_file); -IMPLEMENT_TYPE_P (Source_file, "ly:source-file?"); +const char Source_file::type_p_name_[] = "ly:source-file?"; SCM Source_file::mark_smob (SCM smob) @@ -384,4 +381,3 @@ Source_file::print_smob (SCM smob, SCM port, scm_print_state *) scm_puts (" >", port); return 1; } - diff --git a/lily/spring-smob.cc b/lily/spring-smob.cc index 5caa8e5062..dd5b22be1c 100644 --- a/lily/spring-smob.cc +++ b/lily/spring-smob.cc @@ -19,22 +19,9 @@ #include "spring.hh" #include "warn.hh" -#include "ly-smobs.icc" -IMPLEMENT_SIMPLE_SMOBS (Spring); -SCM -Spring::mark_smob (SCM) -{ - return SCM_UNSPECIFIED; -} -int -Spring::print_smob (SCM, SCM p, scm_print_state *) -{ - scm_puts ("#", p); - return 1; -} SCM Spring::equal_p (SCM a, SCM b) @@ -79,4 +66,4 @@ LY_DEFINE (ly_spring_set_inverse_stretch_strength_x, "ly:spring-set-inverse-stre return s->smobbed_copy (); } -IMPLEMENT_TYPE_P (Spring, "ly:spring?"); +const char Spring::type_p_name_[] = "ly:spring?"; diff --git a/lily/stencil.cc b/lily/stencil.cc index 51f051d597..20c81bedfd 100644 --- a/lily/stencil.cc +++ b/lily/stencil.cc @@ -25,7 +25,6 @@ #include "string-convert.hh" #include "warn.hh" -#include "ly-smobs.icc" Stencil::Stencil () { @@ -54,9 +53,7 @@ Stencil::mark_smob (SCM smob) return s->expr_; } -IMPLEMENT_SIMPLE_SMOBS (Stencil); -IMPLEMENT_TYPE_P (Stencil, "ly:stencil?"); -IMPLEMENT_DEFAULT_EQUAL_P (Stencil); +const char Stencil::type_p_name_[] = "ly:stencil?"; Interval Stencil::extent (Axis a) const diff --git a/lily/stream-event.cc b/lily/stream-event.cc index f8c9f8fc8b..3af222c1c7 100644 --- a/lily/stream-event.cc +++ b/lily/stream-event.cc @@ -19,7 +19,6 @@ #include "stream-event.hh" -#include "ly-smobs.icc" #include "context.hh" #include "input.hh" #include "music.hh" diff --git a/lily/translator-dispatch-list.cc b/lily/translator-dispatch-list.cc index 873f707de5..4faac71167 100644 --- a/lily/translator-dispatch-list.cc +++ b/lily/translator-dispatch-list.cc @@ -20,7 +20,6 @@ #include "translator-dispatch-list.hh" #include "engraver.hh" -#include "ly-smobs.icc" void Engraver_dispatch_list::apply (Grob_info gi) @@ -72,21 +71,3 @@ Engraver_dispatch_list::create (SCM trans_list, return found ? retval : SCM_EOL; } - -SCM -Engraver_dispatch_list::mark_smob (SCM) -{ - return SCM_BOOL_F; -} - -int -Engraver_dispatch_list::print_smob (SCM /* x */, - SCM p, - scm_print_state *) -{ - scm_puts ("#", p); - return 1; -} - -IMPLEMENT_SIMPLE_SMOBS (Engraver_dispatch_list); -IMPLEMENT_DEFAULT_EQUAL_P (Engraver_dispatch_list); diff --git a/lily/translator-group.cc b/lily/translator-group.cc index 3f7e129602..23aae462e5 100644 --- a/lily/translator-group.cc +++ b/lily/translator-group.cc @@ -343,11 +343,8 @@ Translator_group::~Translator_group () { } -#include "ly-smobs.icc" -IMPLEMENT_SMOBS (Translator_group); -IMPLEMENT_DEFAULT_EQUAL_P (Translator_group); -IMPLEMENT_TYPE_P (Translator_group, "ly:translator-group?"); +const char Translator_group::type_p_name_[] = "ly:translator-group?"; int Translator_group::print_smob (SCM s, SCM port, scm_print_state *) diff --git a/lily/translator.cc b/lily/translator.cc index 5f4a39bb0e..e48b8956cf 100644 --- a/lily/translator.cc +++ b/lily/translator.cc @@ -27,7 +27,6 @@ #include "warn.hh" #include "translator.icc" -#include "ly-smobs.icc" Translator::~Translator () { @@ -219,9 +218,7 @@ Translator::get_score_context () const return daddy_context_->get_score_context (); } -IMPLEMENT_SMOBS (Translator); -IMPLEMENT_DEFAULT_EQUAL_P (Translator); -IMPLEMENT_TYPE_P (Translator, "ly:translator?"); +const char Translator::type_p_name_[] = "ly:translator?"; bool Translator::must_be_last () const diff --git a/lily/undead.cc b/lily/undead.cc index a43d46d21c..33d5ed5455 100644 --- a/lily/undead.cc +++ b/lily/undead.cc @@ -18,11 +18,14 @@ */ #include "smobs.hh" -#include "ly-smobs.icc" -class Undead +class Undead : public Simple_smob { - DECLARE_SIMPLE_SMOBS (Undead); +public: + static int print_smob (SCM, SCM, scm_print_state *); + static SCM mark_smob (SCM); + static const char type_p_name_[]; +private: SCM object_; public: SCM object () { return object_; } @@ -50,9 +53,7 @@ Undead::print_smob (SCM undead, return 1; } -IMPLEMENT_SIMPLE_SMOBS (Undead); -IMPLEMENT_DEFAULT_EQUAL_P (Undead); -IMPLEMENT_TYPE_P (Undead, "ly:undead?"); +const char Undead::type_p_name_[] = "ly:undead?"; LY_DEFINE (ly_make_undead, "ly:make-undead", 1, 0, 0, (SCM object), -- 2.39.2