source file of the LilyPond music typesetter
- (c) 1997--2005 Jan Nieuwenhuizen <janneke@gnu.org>
- Han-Wen Nienhuys <hanwen@cs.uu.nl>
-
+ (c) 1997--2006 Jan Nieuwenhuizen <janneke@gnu.org>
+ Han-Wen Nienhuys <hanwen@xs4all.nl>
*/
#include "duration.hh"
{
Rational mom (1 << abs (durlog_));
- if (durlog_> 0)
+ if (durlog_ > 0)
mom = Rational (1) / mom;
Rational delta = mom;
{
String s;
- if (durlog_ < 0 )
- s = "log = " + ::to_string (durlog_);
+ if (durlog_ < 0)
+ s = "log = " + ::to_string (durlog_);
else
s = ::to_string (1 << durlog_);
return s;
}
-
IMPLEMENT_TYPE_P (Duration, "ly:duration?");
SCM
int
Duration::print_smob (SCM s, SCM port, scm_print_state *)
{
- Duration *r = (Duration *) SCM_CELL_WORD_1 (s);
+ Duration *r = (Duration *) SCM_CELL_WORD_1 (s);
scm_puts ("#<Duration ", port);
scm_display (scm_makfrom0str (r->to_string ().to_str0 ()), port);
}
SCM
-Duration::equal_p (SCM a , SCM b)
+Duration::equal_p (SCM a, SCM b)
{
- Duration *p = (Duration *) SCM_CELL_WORD_1 (a);
- Duration *q = (Duration *) SCM_CELL_WORD_1 (b);
+ Duration *p = (Duration *) SCM_CELL_WORD_1 (a);
+ Duration *q = (Duration *) SCM_CELL_WORD_1 (b);
bool eq = p->dots_ == q->dots_
&& p->durlog_ == q->durlog_
return eq ? SCM_BOOL_T : SCM_BOOL_F;
}
-
int
Duration::duration_log () const
{