diff options
author | David Kastrup <dak@gnu.org> | 2016-06-03 14:21:55 +0200 |
---|---|---|
committer | David Kastrup <dak@gnu.org> | 2016-06-09 09:38:55 +0200 |
commit | 67cd07e55d5ec908c246ae543e480d367b61d6b3 (patch) | |
tree | e71d203a60bd2fc77d18e060953cb9374d2e60c6 | |
parent | 536ecabb8301e3b0c242f2bb5fb1e0df3b194fa0 (diff) |
Issue 4878: Make type_p_name_ always char pointer
This avoids the pitfalls cured by issue 4783 without the
associated inconvenience when no predicate is desired.
80 files changed, 77 insertions, 121 deletions
diff --git a/lily/all-font-metrics.cc b/lily/all-font-metrics.cc index a560a25940..ab4f2a4ce4 100644 --- a/lily/all-font-metrics.cc +++ b/lily/all-font-metrics.cc @@ -27,8 +27,6 @@ #include "scm-hash.hh" #include "warn.hh" -const char * const All_font_metrics::type_p_name_ = 0; - Index_to_charcode_map const * All_font_metrics::get_index_to_charcode_map (const string &filename, int face_index, diff --git a/lily/book-scheme.cc b/lily/book-scheme.cc index cf35a7c1bd..af0cb62632 100644 --- a/lily/book-scheme.cc +++ b/lily/book-scheme.cc @@ -178,4 +178,4 @@ LY_DEFINE (ly_book_scores, "ly:book-scores", } -const char Book::type_p_name_[] = "ly:book?"; +const char * const Book::type_p_name_ = "ly:book?"; diff --git a/lily/box.cc b/lily/box.cc index 629b8010fa..6569493419 100644 --- a/lily/box.cc +++ b/lily/box.cc @@ -133,4 +133,4 @@ Box::print () /****************************************************************/ -const char Box::type_p_name_[] = "ly:box?"; +const char * const Box::type_p_name_ = "ly:box?"; diff --git a/lily/callback.cc b/lily/callback.cc deleted file mode 100644 index baab7b0614..0000000000 --- a/lily/callback.cc +++ /dev/null @@ -1,25 +0,0 @@ -/* - This file is part of LilyPond, the GNU music typesetter. - - Copyright (C) 2016 David Kastrup <dak@gnu.org> - - LilyPond is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - LilyPond is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with LilyPond. If not, see <http://www.gnu.org/licenses/>. -*/ - -#include "callback.hh" - -const char * const Callback_wrapper::type_p_name_ = 0; -const char * const Callback2_wrapper::type_p_name_ = 0; -const char * const Callback0_wrapper::type_p_name_ = 0; -const char * const Method_instance::type_p_name_ = 0; diff --git a/lily/context-def.cc b/lily/context-def.cc index 3258297b49..402bd80b6e 100644 --- a/lily/context-def.cc +++ b/lily/context-def.cc @@ -82,7 +82,7 @@ Context_def::~Context_def () { } -const char Context_def::type_p_name_[] = "ly:context-def?"; +const char * const Context_def::type_p_name_ = "ly:context-def?"; int Context_def::print_smob (SCM port, scm_print_state *) const diff --git a/lily/context-mod.cc b/lily/context-mod.cc index a533da2cbd..892d692bbf 100644 --- a/lily/context-mod.cc +++ b/lily/context-mod.cc @@ -34,7 +34,7 @@ Context_mod::Context_mod (SCM mod_list) mods_ = scm_reverse (mod_list); } -const char Context_mod::type_p_name_[] = "ly:context-mod?"; +const char * const Context_mod::type_p_name_ = "ly:context-mod?"; int Context_mod::print_smob (SCM port, scm_print_state *) const diff --git a/lily/context-property.cc b/lily/context-property.cc index e0acae1455..6e22b2f808 100644 --- a/lily/context-property.cc +++ b/lily/context-property.cc @@ -66,7 +66,7 @@ class Grob_properties : public Simple_smob<Grob_properties> { public: SCM mark_smob () const; - static const char type_p_name_[]; + static const char * const type_p_name_; private: friend class Grob_property_info; friend SCM ly_make_grob_properties (SCM); @@ -97,7 +97,7 @@ private: cooked_ (alist), cooked_from_ (alist), nested_ (0) { } }; -const char Grob_properties::type_p_name_[] = "ly:grob-properties?"; +const char * const Grob_properties::type_p_name_ = "ly:grob-properties?"; SCM Grob_properties::mark_smob () const diff --git a/lily/context.cc b/lily/context.cc index d96382e968..7de61c5796 100644 --- a/lily/context.cc +++ b/lily/context.cc @@ -779,7 +779,7 @@ Context::mark_smob () const return properties_scm_; } -const char Context::type_p_name_[] = "ly:context?"; +const char * const Context::type_p_name_ = "ly:context?"; Global_context * Context::get_global_context () const diff --git a/lily/dispatcher.cc b/lily/dispatcher.cc index 8f938d6f91..b1b076759f 100644 --- a/lily/dispatcher.cc +++ b/lily/dispatcher.cc @@ -23,7 +23,7 @@ #include "warn.hh" #include "lily-imports.hh" -const char Dispatcher::type_p_name_[] = "ly:dispatcher?"; +const char * const Dispatcher::type_p_name_ = "ly:dispatcher?"; Dispatcher::~Dispatcher () { diff --git a/lily/duration.cc b/lily/duration.cc index 0b10019540..0c6fa4dd5f 100644 --- a/lily/duration.cc +++ b/lily/duration.cc @@ -136,7 +136,7 @@ Duration::to_string () const return s; } -const char Duration::type_p_name_[] = "ly:duration?"; +const char * const Duration::type_p_name_ = "ly:duration?"; int diff --git a/lily/font-metric.cc b/lily/font-metric.cc index f2b6a0e147..c9daa95f3e 100644 --- a/lily/font-metric.cc +++ b/lily/font-metric.cc @@ -112,7 +112,7 @@ Font_metric::print_smob (SCM port, scm_print_state *) const return 1; } -const char Font_metric::type_p_name_[] = "ly:font-metric?"; +const char * const 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 ec0ee43e18..f5228dfd71 100644 --- a/lily/grob-array.cc +++ b/lily/grob-array.cc @@ -116,7 +116,7 @@ Grob_array::filter_map_assign (const Grob_array &src, filter_map (map_fun); } -const char Grob_array::type_p_name_[] = "ly:grob-array?"; +const char * const Grob_array::type_p_name_ = "ly:grob-array?"; SCM diff --git a/lily/grob-smob.cc b/lily/grob-smob.cc index 066b700a25..72949973b1 100644 --- a/lily/grob-smob.cc +++ b/lily/grob-smob.cc @@ -23,7 +23,7 @@ #include "warn.hh" -const char Grob::type_p_name_[] = "ly:grob?"; +const char * const Grob::type_p_name_ = "ly:grob?"; SCM Grob::mark_smob () const diff --git a/lily/include/all-font-metrics.hh b/lily/include/all-font-metrics.hh index f206a3b95d..a2d090a6df 100644 --- a/lily/include/all-font-metrics.hh +++ b/lily/include/all-font-metrics.hh @@ -48,7 +48,6 @@ class All_font_metrics : public Smob<All_font_metrics> All_font_metrics (All_font_metrics const &); public: - static const char * const type_p_name_; // = 0 SCM mark_smob () const; Index_to_charcode_map const *get_index_to_charcode_map (const string &filename, diff --git a/lily/include/book.hh b/lily/include/book.hh index 3ea6c2c550..0a71a6b9e4 100644 --- a/lily/include/book.hh +++ b/lily/include/book.hh @@ -30,7 +30,7 @@ class Book : public Smob<Book> { public: SCM mark_smob () const; - static const char type_p_name_[]; + static const char * const type_p_name_; virtual ~Book (); SCM header_; Output_def *paper_; diff --git a/lily/include/box.hh b/lily/include/box.hh index 7d5745d696..d4a8655a42 100644 --- a/lily/include/box.hh +++ b/lily/include/box.hh @@ -12,7 +12,7 @@ class Box : public Simple_smob<Box> { public: - static const char type_p_name_[]; + static const char * const type_p_name_; private: Interval interval_a_[NO_AXES]; public: diff --git a/lily/include/callback.hh b/lily/include/callback.hh index 963f4eb59c..671140673f 100644 --- a/lily/include/callback.hh +++ b/lily/include/callback.hh @@ -48,7 +48,6 @@ class Callback_wrapper : public Simple_smob<Callback_wrapper> : trampoline_ (trampoline) { } // Private constructor, use only in make_smob public: - static const char * const type_p_name_; // = 0 LY_DECLARE_SMOB_PROC (&Callback_wrapper::call, 2, 0, 0) SCM call (SCM target, SCM arg) { @@ -77,7 +76,6 @@ class Callback2_wrapper : public Simple_smob<Callback2_wrapper> : trampoline_ (trampoline) { } // Private constructor, use only in make_smob public: - static const char * const type_p_name_; // = 0 LY_DECLARE_SMOB_PROC (&Callback2_wrapper::call, 3, 0, 0) SCM call (SCM target, SCM arg1, SCM arg2) { @@ -102,7 +100,6 @@ class Callback0_wrapper : public Simple_smob<Callback0_wrapper> : trampoline_ (trampoline) { } // Private constructor, use only in make_smob public: - static const char * const type_p_name_; // = 0 LY_DECLARE_SMOB_PROC (&Callback0_wrapper::call, 1, 0, 0) SCM call (SCM target) { @@ -153,7 +150,6 @@ class Method_instance : public Simple_smob<Method_instance> { SCM method_, instance_; public: - static const char * const type_p_name_; // = 0 LY_DECLARE_SMOB_PROC (&Method_instance::call, 0, 0, 1) SCM call (SCM rest) { diff --git a/lily/include/context-def.hh b/lily/include/context-def.hh index c49fee1e30..b068e204c0 100644 --- a/lily/include/context-def.hh +++ b/lily/include/context-def.hh @@ -35,7 +35,7 @@ struct Context_def : public Smob<Context_def> { SCM mark_smob () const; int print_smob (SCM, scm_print_state *) const; - static const char type_p_name_[]; + static const char * const type_p_name_; virtual ~Context_def (); private: /* diff --git a/lily/include/context-mod.hh b/lily/include/context-mod.hh index c9f0caa8fb..81b1f34e36 100644 --- a/lily/include/context-mod.hh +++ b/lily/include/context-mod.hh @@ -38,7 +38,7 @@ struct Context_mod : public Simple_smob<Context_mod> { SCM mark_smob () const; int print_smob (SCM, scm_print_state *) const; - static const char type_p_name_[]; + static const char * const type_p_name_; private: SCM mods_; public: diff --git a/lily/include/context.hh b/lily/include/context.hh index 130a304f93..468f612061 100644 --- a/lily/include/context.hh +++ b/lily/include/context.hh @@ -33,7 +33,7 @@ class Context : public Smob<Context> public: SCM mark_smob () const; int print_smob (SCM, scm_print_state *) const; - static const char type_p_name_[]; + static const char * const type_p_name_; virtual ~Context (); private: Scheme_hash_table *properties_dict () const; diff --git a/lily/include/dispatcher.hh b/lily/include/dispatcher.hh index f0eb30ba6d..98a8626fd8 100644 --- a/lily/include/dispatcher.hh +++ b/lily/include/dispatcher.hh @@ -29,7 +29,7 @@ class Dispatcher : public Smob<Dispatcher> public: int print_smob (SCM, scm_print_state *) const; SCM mark_smob () const; - static const char type_p_name_[]; + static const char * const type_p_name_; virtual ~Dispatcher (); private: /* Hash table. Each event-class maps to a list of listeners. */ diff --git a/lily/include/duration.hh b/lily/include/duration.hh index 7a57cf53af..6233fc1b2d 100644 --- a/lily/include/duration.hh +++ b/lily/include/duration.hh @@ -29,7 +29,7 @@ struct Duration : public Simple_smob<Duration> { static SCM equal_p (SCM, SCM); int print_smob (SCM, scm_print_state *) const; - static const char type_p_name_[]; + static const char * const type_p_name_; Duration (); Duration (int, int); Duration (Rational, bool scale); diff --git a/lily/include/font-metric.hh b/lily/include/font-metric.hh index d74c8157ca..e385a1e7af 100644 --- a/lily/include/font-metric.hh +++ b/lily/include/font-metric.hh @@ -35,7 +35,7 @@ class Font_metric : public Smob<Font_metric> public: int print_smob (SCM, scm_print_state *) const; SCM mark_smob () const; - static const char type_p_name_[]; + static const char * const type_p_name_; virtual ~Font_metric (); private: DECLARE_CLASSNAME (Font_metric); diff --git a/lily/include/grob-array.hh b/lily/include/grob-array.hh index 1a755fe661..ca925b4291 100644 --- a/lily/include/grob-array.hh +++ b/lily/include/grob-array.hh @@ -29,7 +29,7 @@ class Grob_array : public Simple_smob<Grob_array> public: int print_smob (SCM, scm_print_state *) const; SCM mark_smob () const; - static const char type_p_name_[]; + static const char * const type_p_name_; private: vector<Grob *> grobs_; bool ordered_; diff --git a/lily/include/grob.hh b/lily/include/grob.hh index db51e02e73..a9408f09a2 100644 --- a/lily/include/grob.hh +++ b/lily/include/grob.hh @@ -32,7 +32,7 @@ class Grob : public Smob<Grob> public: int print_smob (SCM, scm_print_state *) const; SCM mark_smob () const; - static const char type_p_name_[]; + static const char * const type_p_name_; virtual ~Grob (); private: DECLARE_CLASSNAME (Grob); diff --git a/lily/include/input.hh b/lily/include/input.hh index b77db2d66f..aab0d117a6 100644 --- a/lily/include/input.hh +++ b/lily/include/input.hh @@ -32,7 +32,7 @@ class Input : public Simple_smob<Input> char const *end_; Source_file *source_file_; public: - static const char type_p_name_[]; + static const char * const type_p_name_; int print_smob (SCM, scm_print_state *) const; static SCM equal_p (SCM, SCM); SCM mark_smob () const; diff --git a/lily/include/lily-lexer.hh b/lily/include/lily-lexer.hh index 0e001ec187..626d24efa6 100644 --- a/lily/include/lily-lexer.hh +++ b/lily/include/lily-lexer.hh @@ -36,7 +36,7 @@ class Lily_lexer : public Smob<Lily_lexer>, public Includable_lexer public: int print_smob (SCM, scm_print_state *) const; SCM mark_smob () const; - static const char type_p_name_[]; + static const char * const type_p_name_; virtual ~Lily_lexer (); private: int lookup_keyword (const string&); diff --git a/lily/include/lily-parser.hh b/lily/include/lily-parser.hh index b08df7c7a4..e4ff2969b9 100644 --- a/lily/include/lily-parser.hh +++ b/lily/include/lily-parser.hh @@ -36,7 +36,7 @@ class Lily_parser : public Smob<Lily_parser> public: int print_smob (SCM, scm_print_state *) const; SCM mark_smob () const; - static const char type_p_name_[]; + static const char * const type_p_name_; virtual ~Lily_parser (); Lily_lexer *lexer_; Sources *sources_; diff --git a/lily/include/listener.hh b/lily/include/listener.hh index b9042ba301..a13fdc66e1 100644 --- a/lily/include/listener.hh +++ b/lily/include/listener.hh @@ -96,7 +96,7 @@ private: SCM callback_; SCM target_; public: - static const char type_p_name_[]; + static const char * const type_p_name_; Listener (SCM callback, SCM target) : callback_ (callback), target_ (target) { } diff --git a/lily/include/moment.hh b/lily/include/moment.hh index d84a992b40..c29032f99d 100644 --- a/lily/include/moment.hh +++ b/lily/include/moment.hh @@ -32,7 +32,7 @@ class Moment : public Simple_smob<Moment> public: static SCM equal_p (SCM, SCM); int print_smob (SCM, scm_print_state *) const; - static const char type_p_name_[]; + static const char * const type_p_name_; Moment (); Moment (int m); diff --git a/lily/include/music-function.hh b/lily/include/music-function.hh index f2c349a3e1..80239a61aa 100644 --- a/lily/include/music-function.hh +++ b/lily/include/music-function.hh @@ -27,7 +27,7 @@ class Music_function : public Smob2<Music_function> { public: - static const char type_p_name_[]; + static const char * const type_p_name_; int print_smob (SCM, scm_print_state *) const; SCM get_signature () const { return scm1 (); } SCM get_function () const { return scm2 (); } diff --git a/lily/include/music-iterator.hh b/lily/include/music-iterator.hh index 810d230aac..bb095df718 100644 --- a/lily/include/music-iterator.hh +++ b/lily/include/music-iterator.hh @@ -63,7 +63,7 @@ class Music_iterator : public Smob<Music_iterator> public: int print_smob (SCM, scm_print_state *) const; SCM mark_smob () const; - static const char type_p_name_[]; + static const char * const type_p_name_; virtual ~Music_iterator (); protected: Moment music_length_; diff --git a/lily/include/music-output.hh b/lily/include/music-output.hh index dc1111b78a..208c01a831 100644 --- a/lily/include/music-output.hh +++ b/lily/include/music-output.hh @@ -31,7 +31,7 @@ class Music_output : public Smob<Music_output> public: int print_smob (SCM, scm_print_state *) const; SCM mark_smob () const; - static const char type_p_name_[]; + static const char * const type_p_name_; virtual ~Music_output (); private: DECLARE_CLASSNAME (Music_output); diff --git a/lily/include/output-def.hh b/lily/include/output-def.hh index 5de672e67a..8c188f2707 100644 --- a/lily/include/output-def.hh +++ b/lily/include/output-def.hh @@ -51,7 +51,7 @@ class Output_def : public Smob<Output_def> public: int print_smob (SCM, scm_print_state *) const; SCM mark_smob () const; - static const char type_p_name_[]; + static const char * const type_p_name_; virtual ~Output_def (); VIRTUAL_COPY_CONSTRUCTOR (Output_def, Output_def); diff --git a/lily/include/page-marker.hh b/lily/include/page-marker.hh index 02233d30a6..33f3a38c06 100644 --- a/lily/include/page-marker.hh +++ b/lily/include/page-marker.hh @@ -27,7 +27,7 @@ class Page_marker : public Smob<Page_marker> { public: SCM mark_smob () const; - static const char type_p_name_[]; + static const char * const type_p_name_; virtual ~Page_marker (); private: SCM symbol_; /* either 'page-turn-permission or 'page-break-permission */ diff --git a/lily/include/paper-book.hh b/lily/include/paper-book.hh index b105cdb3de..9530c94b70 100644 --- a/lily/include/paper-book.hh +++ b/lily/include/paper-book.hh @@ -31,7 +31,7 @@ class Paper_book : public Smob<Paper_book> { public: SCM mark_smob () const; - static const char type_p_name_[]; + static const char * const type_p_name_; virtual ~Paper_book (); private: SCM systems_; diff --git a/lily/include/paper-outputter.hh b/lily/include/paper-outputter.hh index 8683b4c6d1..cd1a5e2c92 100644 --- a/lily/include/paper-outputter.hh +++ b/lily/include/paper-outputter.hh @@ -33,7 +33,6 @@ class Paper_outputter : public Smob<Paper_outputter> { public: - static const char * const type_p_name_; // = 0 SCM mark_smob () const; virtual ~Paper_outputter (); private: diff --git a/lily/include/pitch.hh b/lily/include/pitch.hh index daade82e81..dad2bc1246 100644 --- a/lily/include/pitch.hh +++ b/lily/include/pitch.hh @@ -38,7 +38,7 @@ public: static SCM equal_p (SCM, SCM); int print_smob (SCM, scm_print_state *) const; SCM mark_smob () const; - static const char type_p_name_[]; + static const char * const type_p_name_; private: int octave_; int notename_; diff --git a/lily/include/prob.hh b/lily/include/prob.hh index cb850555fb..a9a485b550 100644 --- a/lily/include/prob.hh +++ b/lily/include/prob.hh @@ -38,7 +38,7 @@ public: int print_smob (SCM, scm_print_state *) const; SCM mark_smob () const; static SCM equal_p (SCM, SCM); - static const char type_p_name_[]; + static const char * const type_p_name_; virtual ~Prob (); private: DECLARE_CLASSNAME (Prob); diff --git a/lily/include/scale.hh b/lily/include/scale.hh index 7c990e5034..19cd175c79 100644 --- a/lily/include/scale.hh +++ b/lily/include/scale.hh @@ -26,7 +26,6 @@ struct Scale : public Smob<Scale> { - static const char * const type_p_name_; // = 0 virtual ~Scale (); Scale (vector<Rational> const &); Scale (Scale const &); diff --git a/lily/include/scm-hash.hh b/lily/include/scm-hash.hh index 241f316c4e..3453904f71 100644 --- a/lily/include/scm-hash.hh +++ b/lily/include/scm-hash.hh @@ -46,7 +46,6 @@ class Scheme_hash_table : public Smob1<Scheme_hash_table> { public: - static const char * const type_p_name_; // = 0 int print_smob (SCM, scm_print_state *) const; bool try_retrieve (SCM key, SCM *val); bool contains (SCM key) const; diff --git a/lily/include/score.hh b/lily/include/score.hh index b3ece8960a..a5918242f1 100644 --- a/lily/include/score.hh +++ b/lily/include/score.hh @@ -31,7 +31,7 @@ class Score : public Smob<Score> { public: SCM mark_smob () const; - static const char type_p_name_[]; + static const char * const type_p_name_; virtual ~Score (); private: SCM music_; diff --git a/lily/include/skyline-pair.hh b/lily/include/skyline-pair.hh index 6d7cea0ac2..f7946c1851 100644 --- a/lily/include/skyline-pair.hh +++ b/lily/include/skyline-pair.hh @@ -25,7 +25,7 @@ class Skyline_pair : public Simple_smob<Skyline_pair> { public: - static const char type_p_name_[]; + static const char * const type_p_name_; private: Drul_array<Skyline> skylines_; diff --git a/lily/include/skyline.hh b/lily/include/skyline.hh index 21693420c8..43feb40761 100644 --- a/lily/include/skyline.hh +++ b/lily/include/skyline.hh @@ -51,7 +51,7 @@ struct Building class Skyline : public Simple_smob<Skyline> { public: - static const char type_p_name_[]; + static const char * const type_p_name_; private: list<Building> buildings_; Direction sky_; diff --git a/lily/include/smobs.hh b/lily/include/smobs.hh index 889d86a8ca..7ef46b23e4 100644 --- a/lily/include/smobs.hh +++ b/lily/include/smobs.hh @@ -120,7 +120,7 @@ debugging purposes. If the class does not define this function, the output will be #<Classname> when printing. - - a static const type_p_name_[] string set to something like + - a static const * const type_p_name_ string set to something like "ly:grob?". When provided, an accordingly named function for checking for the given smob type will be available in Scheme. @@ -177,6 +177,7 @@ private: // Most default functions are do-nothings. void init() will // recognize their address when not overriden and will then refrain // altogether from passing the the respective callbacks to GUILE. + SCM mark_smob (void) const; static SCM mark_trampoline (SCM); // Used for calling mark_smob static size_t free_smob (SCM obj); @@ -185,11 +186,10 @@ private: static int print_trampoline (SCM, SCM, scm_print_state *); static void smob_proc_init (scm_t_bits) { }; - // type_p_name_ has to be defined in the Super class, either with a - // static const char [] string or as a null pointer of type const - // char *. We used to provide a default here for convenience, but - // battling the various conflicting C++ standards was too much of a - // hassle. + // Define type_p_name_ in the Super class as a const char * const. + // Without such definition it defaults to 0, producing no predicate. + + static const char * const type_p_name_; // = 0 // LY_DECLARE_SMOB_PROC is used in the Super class definition for // making a smob callable like a function. Its first argument is a diff --git a/lily/include/smobs.tcc b/lily/include/smobs.tcc index b8dfc1f67f..818c0900a5 100644 --- a/lily/include/smobs.tcc +++ b/lily/include/smobs.tcc @@ -114,6 +114,9 @@ template <class Super> string Smob_base<Super>::smob_name_; template <class Super> +const char * const Smob_base<Super>::type_p_name_ = 0; + +template <class Super> void Smob_base<Super>::init () { smob_name_ = typeid (Super).name (); diff --git a/lily/include/source-file.hh b/lily/include/source-file.hh index 6686389289..fc5bf2f541 100644 --- a/lily/include/source-file.hh +++ b/lily/include/source-file.hh @@ -40,7 +40,7 @@ class Source_file : public Smob<Source_file> public: int print_smob (SCM, scm_print_state *) const; SCM mark_smob () const; - static const char type_p_name_[]; + static const char * const type_p_name_; virtual ~Source_file (); private: vector<char const *> newline_locations_; diff --git a/lily/include/spring.hh b/lily/include/spring.hh index fd01ca048c..d4ebee23cd 100644 --- a/lily/include/spring.hh +++ b/lily/include/spring.hh @@ -27,7 +27,7 @@ class Spring : public Simple_smob<Spring> { public: static SCM equal_p (SCM, SCM); - static const char type_p_name_[]; + static const char * const type_p_name_; private: Real distance_; Real min_distance_; diff --git a/lily/include/stencil.hh b/lily/include/stencil.hh index 6ccb9252bb..8af67c0f76 100644 --- a/lily/include/stencil.hh +++ b/lily/include/stencil.hh @@ -59,7 +59,7 @@ class Stencil : public Simple_smob<Stencil> { public: SCM mark_smob () const; - static const char type_p_name_[]; + static const char * const type_p_name_; private: Box dim_; SCM expr_; diff --git a/lily/include/translator-dispatch-list.hh b/lily/include/translator-dispatch-list.hh index eb74e74cd6..b6124572fc 100644 --- a/lily/include/translator-dispatch-list.hh +++ b/lily/include/translator-dispatch-list.hh @@ -30,7 +30,6 @@ class Engraver_dispatch_list : public Simple_smob<Engraver_dispatch_list> { vector<Method_instance> dispatch_entries_; public: - static const char * const type_p_name_; // = 0 void apply (Grob_info); SCM static create (SCM trans_list, SCM iface_list, Direction); diff --git a/lily/include/translator-group.hh b/lily/include/translator-group.hh index 4ba2fe6523..d4500ef2b4 100644 --- a/lily/include/translator-group.hh +++ b/lily/include/translator-group.hh @@ -29,7 +29,7 @@ class Translator_group : public Smob<Translator_group> public: SCM mark_smob () const; int print_smob (SCM, scm_print_state *) const; - static const char type_p_name_[]; + static const char * const type_p_name_; virtual ~Translator_group (); private: void precompute_method_bindings (); diff --git a/lily/include/translator.hh b/lily/include/translator.hh index fd93a3e42f..dd0659bf50 100644 --- a/lily/include/translator.hh +++ b/lily/include/translator.hh @@ -91,7 +91,7 @@ class Translator : public Smob<Translator> public: int print_smob (SCM, scm_print_state *) const; SCM mark_smob () const; - static const char type_p_name_[]; + static const char * const type_p_name_; virtual ~Translator (); private: void init (); diff --git a/lily/include/unpure-pure-container.hh b/lily/include/unpure-pure-container.hh index 92974fe8f0..7accff9a88 100644 --- a/lily/include/unpure-pure-container.hh +++ b/lily/include/unpure-pure-container.hh @@ -26,7 +26,7 @@ class Unpure_pure_container : public Smob2<Unpure_pure_container> { public: - static const char type_p_name_ []; + static const char * const type_p_name_; SCM unpure_part () const { return scm1 (); } // A container that has the same callback for both 'pure' and 'unpure' lookups // and which ignores the 'start' and 'end' columnns. diff --git a/lily/input-smob.cc b/lily/input-smob.cc index f9de264277..6f5fc18a54 100644 --- a/lily/input-smob.cc +++ b/lily/input-smob.cc @@ -25,7 +25,7 @@ /* Dummy input location for use if real one is missing. */ Input dummy_input_global; -const char Input::type_p_name_[] = "ly:input-location?"; +const char * const Input::type_p_name_ = "ly:input-location?"; SCM Input::mark_smob () const diff --git a/lily/lily-lexer.cc b/lily/lily-lexer.cc index 221d048cc0..6db0e653e5 100644 --- a/lily/lily-lexer.cc +++ b/lily/lily-lexer.cc @@ -369,7 +369,7 @@ Lily_lexer::add_lexed_char (int count) } -const char Lily_lexer::type_p_name_[] = "ly:lily-lexer?"; +const char * const Lily_lexer::type_p_name_ = "ly:lily-lexer?"; SCM Lily_lexer::mark_smob () const diff --git a/lily/lily-parser.cc b/lily/lily-parser.cc index 3188974284..d2499d4c41 100644 --- a/lily/lily-parser.cc +++ b/lily/lily-parser.cc @@ -200,7 +200,7 @@ Lily_parser::parser_error (Input const &i, const string &s) error_level_ = 1; } -const char Lily_parser::type_p_name_[] = "ly:lily-parser?"; +const char * const Lily_parser::type_p_name_ = "ly:lily-parser?"; /**************************************************************** OUTPUT-DEF diff --git a/lily/listener.cc b/lily/listener.cc index 2a8d28d8cb..836f8cdc6f 100644 --- a/lily/listener.cc +++ b/lily/listener.cc @@ -19,4 +19,4 @@ #include "listener.hh" -const char Listener::type_p_name_[] = "ly:listener?"; +const char * const Listener::type_p_name_ = "ly:listener?"; diff --git a/lily/moment.cc b/lily/moment.cc index 81ab30e3ae..20c1f58a0b 100644 --- a/lily/moment.cc +++ b/lily/moment.cc @@ -44,7 +44,7 @@ Moment::Moment (Rational m) } -const char Moment::type_p_name_[] = "ly:moment?"; +const char * const Moment::type_p_name_ = "ly:moment?"; int diff --git a/lily/music-function.cc b/lily/music-function.cc index 969d5ff7b5..c252291736 100644 --- a/lily/music-function.cc +++ b/lily/music-function.cc @@ -24,7 +24,7 @@ #include "fluid.hh" #include "lily-imports.hh" -const char Music_function::type_p_name_[] = "ly:music-function?"; +const char * const Music_function::type_p_name_ = "ly:music-function?"; /* 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 b89e92c28e..a7a06ff0d8 100644 --- a/lily/music-iterator.cc +++ b/lily/music-iterator.cc @@ -190,7 +190,7 @@ Music_iterator::get_music () const /****************************************************************/ -const char Music_iterator::type_p_name_[] = "ly:iterator?"; +const char * const Music_iterator::type_p_name_ = "ly:iterator?"; SCM Music_iterator::mark_smob () const diff --git a/lily/music-output.cc b/lily/music-output.cc index 7b89b853f6..9e8cc9ff9a 100644 --- a/lily/music-output.cc +++ b/lily/music-output.cc @@ -39,7 +39,7 @@ Music_output::derived_mark () const { } -const char Music_output::type_p_name_[] = "ly:music-output?"; +const char * const Music_output::type_p_name_ = "ly:music-output?"; SCM Music_output::mark_smob () const diff --git a/lily/output-def-scheme.cc b/lily/output-def-scheme.cc index 921f3dfcd5..65673c8a9e 100644 --- a/lily/output-def-scheme.cc +++ b/lily/output-def-scheme.cc @@ -132,7 +132,7 @@ LY_DEFINE (ly_output_find_context_def, "ly:output-find-context-def", } const char -Output_def::type_p_name_[] = "ly:output-def?"; +* const Output_def::type_p_name_ = "ly:output-def?"; LY_DEFINE (ly_paper_outputscale, "ly:paper-outputscale", 1, 0, 0, (SCM def), diff --git a/lily/page-marker.cc b/lily/page-marker.cc index 02b9c4ad19..af62bdc95e 100644 --- a/lily/page-marker.cc +++ b/lily/page-marker.cc @@ -40,7 +40,7 @@ Page_marker::~Page_marker () { } -const char Page_marker::type_p_name_[] = "ly:page-marker?"; +const char * const Page_marker::type_p_name_ = "ly:page-marker?"; SCM Page_marker::mark_smob () const diff --git a/lily/paper-book.cc b/lily/paper-book.cc index e23ef52777..3a672198b5 100644 --- a/lily/paper-book.cc +++ b/lily/paper-book.cc @@ -53,7 +53,7 @@ Paper_book::~Paper_book () { } -const char Paper_book::type_p_name_[] = "ly:paper-book?"; +const char * const Paper_book::type_p_name_ = "ly:paper-book?"; SCM Paper_book::mark_smob () const diff --git a/lily/paper-outputter.cc b/lily/paper-outputter.cc index 471a36a41a..a72ea59ccd 100644 --- a/lily/paper-outputter.cc +++ b/lily/paper-outputter.cc @@ -40,8 +40,6 @@ using namespace std; #include "lily-imports.hh" -const char * const Paper_outputter::type_p_name_ = 0; - Paper_outputter::Paper_outputter (SCM port, const string &format) { file_ = port; diff --git a/lily/pitch.cc b/lily/pitch.cc index e34562fecc..9e46bba70e 100644 --- a/lily/pitch.cc +++ b/lily/pitch.cc @@ -218,7 +218,7 @@ Pitch::down_to (int notename) notename_ = notename; } -const char Pitch::type_p_name_[] = "ly:pitch?"; +const char * const Pitch::type_p_name_ = "ly:pitch?"; SCM Pitch::mark_smob () const diff --git a/lily/prob.cc b/lily/prob.cc index 938f106861..d05a33e4f3 100644 --- a/lily/prob.cc +++ b/lily/prob.cc @@ -24,7 +24,7 @@ #include "profile.hh" -const char Prob::type_p_name_[] = "ly:prob?"; +const char * const Prob::type_p_name_ = "ly:prob?"; SCM Prob::equal_p (SCM sa, SCM sb) diff --git a/lily/scale.cc b/lily/scale.cc index d6f566b9ed..02c1dc5f8e 100644 --- a/lily/scale.cc +++ b/lily/scale.cc @@ -90,8 +90,6 @@ LY_DEFINE (ly_set_default_scale, "ly:set-default-scale", return SCM_UNSPECIFIED; } -const char * const Scale::type_p_name_ = 0; - int Scale::step_count () const { diff --git a/lily/scm-hash.cc b/lily/scm-hash.cc index 97af8f6cd5..0b1e0b4e25 100644 --- a/lily/scm-hash.cc +++ b/lily/scm-hash.cc @@ -21,8 +21,6 @@ #include <cassert> -const char * const Scheme_hash_table::type_p_name_ = 0; - SCM Scheme_hash_table::make_smob () { diff --git a/lily/score.cc b/lily/score.cc index da48e8f103..d10023dd85 100644 --- a/lily/score.cc +++ b/lily/score.cc @@ -59,7 +59,7 @@ Score::~Score () { } -const char Score::type_p_name_[] = "ly:score?"; +const char * const Score::type_p_name_ = "ly:score?"; SCM Score::mark_smob () const diff --git a/lily/skyline-pair.cc b/lily/skyline-pair.cc index b3c2b96df4..bab43494a6 100644 --- a/lily/skyline-pair.cc +++ b/lily/skyline-pair.cc @@ -120,7 +120,7 @@ Skyline_pair::operator [] (Direction d) const return skylines_[d]; } -const char Skyline_pair::type_p_name_[] = "ly:skyline-pair?"; +const char * const Skyline_pair::type_p_name_ = "ly:skyline-pair?"; MAKE_SCHEME_CALLBACK (Skyline_pair, skyline, 2); diff --git a/lily/skyline.cc b/lily/skyline.cc index f46b2f3e84..6ef2069c39 100644 --- a/lily/skyline.cc +++ b/lily/skyline.cc @@ -802,7 +802,7 @@ Skyline::clear () /****************************************************************/ -const char Skyline::type_p_name_[] = "ly:skyline?"; +const char * const Skyline::type_p_name_ = "ly:skyline?"; MAKE_SCHEME_CALLBACK_WITH_OPTARGS (Skyline, get_touching_point, 3, 1, "") SCM diff --git a/lily/source-file.cc b/lily/source-file.cc index 5a94927a7f..14fdf2beb3 100644 --- a/lily/source-file.cc +++ b/lily/source-file.cc @@ -362,7 +362,7 @@ Source_file::get_port () const /****************************************************************/ -const char Source_file::type_p_name_[] = "ly:source-file?"; +const char * const Source_file::type_p_name_ = "ly:source-file?"; SCM Source_file::mark_smob () const diff --git a/lily/spring-smob.cc b/lily/spring-smob.cc index 77b01bb158..a389df2efd 100644 --- a/lily/spring-smob.cc +++ b/lily/spring-smob.cc @@ -66,4 +66,4 @@ LY_DEFINE (ly_spring_set_inverse_stretch_strength_x, "ly:spring-set-inverse-stre return s->smobbed_copy (); } -const char Spring::type_p_name_[] = "ly:spring?"; +const char * const Spring::type_p_name_ = "ly:spring?"; diff --git a/lily/stencil.cc b/lily/stencil.cc index 3da1869541..0cf49296f0 100644 --- a/lily/stencil.cc +++ b/lily/stencil.cc @@ -44,7 +44,7 @@ Stencil::mark_smob () const return expr_; } -const char Stencil::type_p_name_[] = "ly:stencil?"; +const char * const Stencil::type_p_name_ = "ly:stencil?"; Interval Stencil::extent (Axis a) const diff --git a/lily/translator-dispatch-list.cc b/lily/translator-dispatch-list.cc index 40ca1b3a5d..eeee8d2483 100644 --- a/lily/translator-dispatch-list.cc +++ b/lily/translator-dispatch-list.cc @@ -21,8 +21,6 @@ #include "engraver.hh" -const char * const Engraver_dispatch_list::type_p_name_ = 0; - void Engraver_dispatch_list::apply (Grob_info gi) { diff --git a/lily/translator-group.cc b/lily/translator-group.cc index 972a487bf4..a9f1690f62 100644 --- a/lily/translator-group.cc +++ b/lily/translator-group.cc @@ -324,7 +324,7 @@ Translator_group::~Translator_group () } -const char Translator_group::type_p_name_[] = "ly:translator-group?"; +const char * const Translator_group::type_p_name_ = "ly:translator-group?"; int Translator_group::print_smob (SCM port, scm_print_state *) const diff --git a/lily/translator.cc b/lily/translator.cc index 5cd42703a1..bdc55f0f05 100644 --- a/lily/translator.cc +++ b/lily/translator.cc @@ -207,7 +207,7 @@ Translator::get_score_context () const return daddy_context_->get_score_context (); } -const char Translator::type_p_name_[] = "ly:translator?"; +const char * const Translator::type_p_name_ = "ly:translator?"; bool Translator::must_be_last () const diff --git a/lily/undead.cc b/lily/undead.cc index a328c66caf..4aed7a6023 100644 --- a/lily/undead.cc +++ b/lily/undead.cc @@ -24,7 +24,7 @@ class Undead : public Simple_smob<Undead> public: int print_smob (SCM, scm_print_state *) const; SCM mark_smob () const; - static const char type_p_name_[]; + static const char * const type_p_name_; private: SCM object_; public: @@ -51,7 +51,7 @@ Undead::print_smob (SCM port, scm_print_state *) const return 1; } -const char Undead::type_p_name_[] = "ly:undead?"; +const char * const Undead::type_p_name_ = "ly:undead?"; LY_DEFINE (ly_make_undead, "ly:make-undead", 1, 0, 0, (SCM object), diff --git a/lily/unpure-pure-container.cc b/lily/unpure-pure-container.cc index 7a7d6d48d1..143b2fd47d 100644 --- a/lily/unpure-pure-container.cc +++ b/lily/unpure-pure-container.cc @@ -25,7 +25,6 @@ class Unpure_pure_call : public Smob1<Unpure_pure_call> { public: - static const char * const type_p_name_; // = 0 // Smob procedures unfortunately can only take at most 3 SCM // arguments. Otherwise we could use a "3, 0, 1" call signature and // not require an argument count check of our own. @@ -38,8 +37,6 @@ public: } }; -const char * const Unpure_pure_call::type_p_name_ = 0; - SCM Unpure_pure_container::pure_part () const { @@ -48,7 +45,7 @@ Unpure_pure_container::pure_part () const : scm2 (); } -const char Unpure_pure_container::type_p_name_[] = "ly:unpure-pure-container?"; +const char * const Unpure_pure_container::type_p_name_ = "ly:unpure-pure-container?"; LY_DEFINE (ly_make_unpure_pure_container, "ly:make-unpure-pure-container", 1, 1, 0, (SCM unpure, SCM pure), |