/*
This file is part of LilyPond, the GNU music typesetter.
- Copyright (C) 2006--2014 Joe Neeman <joeneeman@gmail.com>
+ Copyright (C) 2006--2015 Joe Neeman <joeneeman@gmail.com>
LilyPond is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
/****************************************************************/
-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
LY_ASSERT_SMOB (Skyline, other_skyline_scm, 1);
Real horizon_padding = 0;
- if (horizon_padding_scm != SCM_UNDEFINED)
+ if (!SCM_UNBNDP (horizon_padding_scm))
{
LY_ASSERT_TYPE (scm_is_number, horizon_padding_scm, 3);
horizon_padding = scm_to_double (horizon_padding_scm);
}
- Skyline *skyline = Skyline::unsmob (skyline_scm);
- Skyline *other_skyline = Skyline::unsmob (other_skyline_scm);
+ Skyline *skyline = unsmob<Skyline> (skyline_scm);
+ Skyline *other_skyline = unsmob<Skyline> (other_skyline_scm);
return scm_from_double (skyline->touching_point (*other_skyline, horizon_padding));
}
LY_ASSERT_SMOB (Skyline, other_skyline_scm, 1);
Real horizon_padding = 0;
- if (horizon_padding_scm != SCM_UNDEFINED)
+ if (!SCM_UNBNDP (horizon_padding_scm))
{
LY_ASSERT_TYPE (scm_is_number, horizon_padding_scm, 3);
horizon_padding = scm_to_double (horizon_padding_scm);
}
- Skyline *skyline = Skyline::unsmob (skyline_scm);
- Skyline *other_skyline = Skyline::unsmob (other_skyline_scm);
+ Skyline *skyline = unsmob<Skyline> (skyline_scm);
+ Skyline *other_skyline = unsmob<Skyline> (other_skyline_scm);
return scm_from_double (skyline->distance (*other_skyline, horizon_padding));
}
SCM
Skyline::get_max_height (SCM skyline_scm)
{
- return scm_from_double (Skyline::unsmob (skyline_scm)->max_height ());
+ return scm_from_double (unsmob<Skyline> (skyline_scm)->max_height ());
}
MAKE_SCHEME_CALLBACK (Skyline, get_max_height_position, 1)
SCM
Skyline::get_max_height_position (SCM skyline_scm)
{
- return scm_from_double (Skyline::unsmob (skyline_scm)->max_height_position ());
+ return scm_from_double (unsmob<Skyline> (skyline_scm)->max_height_position ());
}
MAKE_SCHEME_CALLBACK (Skyline, get_height, 2)
Skyline::get_height (SCM skyline_scm, SCM x_scm)
{
Real x = robust_scm2double (x_scm, 0.0);
- return scm_from_double (Skyline::unsmob (skyline_scm)->height (x));
+ return scm_from_double (unsmob<Skyline> (skyline_scm)->height (x));
}
LY_DEFINE (ly_skyline_empty_p, "ly:skyline-empty?",
1, 0, 0, (SCM sky),
"Return whether @var{sky} is empty.")
{
- Skyline *s = Skyline::unsmob (sky);
+ Skyline *s = unsmob<Skyline> (sky);
LY_ASSERT_SMOB (Skyline, sky, 1);
return scm_from_bool (s->is_empty ());
}