#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,
}
-const char Book::type_p_name_[] = "ly:book?";
+const char * const Book::type_p_name_ = "ly:book?";
/****************************************************************/
-const char Box::type_p_name_[] = "ly:box?";
+const char * const Box::type_p_name_ = "ly:box?";
+++ /dev/null
-/*
- 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;
{
}
-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
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
{
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);
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
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
#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 ()
{
return s;
}
-const char Duration::type_p_name_[] = "ly:duration?";
+const char * const Duration::type_p_name_ = "ly:duration?";
int
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
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
#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
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,
{
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_;
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:
: 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)
{
: 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)
{
: 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)
{
{
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)
{
{
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:
/*
{
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:
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;
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. */
{
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);
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);
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_;
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);
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;
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&);
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_;
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) { }
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);
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 (); }
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_;
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);
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);
{
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 */
{
public:
SCM mark_smob () const;
- static const char type_p_name_[];
+ static const char * const type_p_name_;
virtual ~Paper_book ();
private:
SCM systems_;
class Paper_outputter : public Smob<Paper_outputter>
{
public:
- static const char * const type_p_name_; // = 0
SCM mark_smob () const;
virtual ~Paper_outputter ();
private:
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_;
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);
struct Scale : public Smob<Scale>
{
- static const char * const type_p_name_; // = 0
virtual ~Scale ();
Scale (vector<Rational> const &);
Scale (Scale const &);
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;
{
public:
SCM mark_smob () const;
- static const char type_p_name_[];
+ static const char * const type_p_name_;
virtual ~Score ();
private:
SCM music_;
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_;
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_;
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.
// 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);
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
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 ()
{
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_;
{
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_;
{
public:
SCM mark_smob () const;
- static const char type_p_name_[];
+ static const char * const type_p_name_;
private:
Box dim_;
SCM expr_;
{
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);
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 ();
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 ();
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.
/* 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
}
-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
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
#include "listener.hh"
-const char Listener::type_p_name_[] = "ly:listener?";
+const char * const Listener::type_p_name_ = "ly:listener?";
}
-const char Moment::type_p_name_[] = "ly:moment?";
+const char * const Moment::type_p_name_ = "ly:moment?";
int
#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
/****************************************************************/
-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
{
}
-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
}
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),
{
}
-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
{
}
-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
#include "lily-imports.hh"
-const char * const Paper_outputter::type_p_name_ = 0;
-
Paper_outputter::Paper_outputter (SCM port, const string &format)
{
file_ = port;
notename_ = notename;
}
-const char Pitch::type_p_name_[] = "ly:pitch?";
+const char * const Pitch::type_p_name_ = "ly:pitch?";
SCM
Pitch::mark_smob () const
#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)
return SCM_UNSPECIFIED;
}
-const char * const Scale::type_p_name_ = 0;
-
int
Scale::step_count () const
{
#include <cassert>
-const char * const Scheme_hash_table::type_p_name_ = 0;
-
SCM
Scheme_hash_table::make_smob ()
{
{
}
-const char Score::type_p_name_[] = "ly:score?";
+const char * const Score::type_p_name_ = "ly:score?";
SCM
Score::mark_smob () 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);
/****************************************************************/
-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
/****************************************************************/
-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
return s->smobbed_copy ();
}
-const char Spring::type_p_name_[] = "ly:spring?";
+const char * const Spring::type_p_name_ = "ly:spring?";
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
#include "engraver.hh"
-const char * const Engraver_dispatch_list::type_p_name_ = 0;
-
void
Engraver_dispatch_list::apply (Grob_info gi)
{
}
-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
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
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:
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),
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.
}
};
-const char * const Unpure_pure_call::type_p_name_ = 0;
-
SCM
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),