]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/duration.cc
Update guile interface.
[lilypond.git] / lily / duration.cc
index 642d7b250ceda79acb2626a7506ffdca698c548e..8020cd42d4a161e33de1bd597e9ff06ee50d4de2 100644 (file)
@@ -3,9 +3,8 @@
 
   source file of the LilyPond music typesetter
 
-  (c) 1997--2004 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"
@@ -48,7 +47,7 @@ Duration::get_length () const
 {
   Rational mom (1 << abs (durlog_));
 
-  if (durlog_> 0)
+  if (durlog_ > 0)
     mom = Rational (1) / mom;
 
   Rational delta = mom;
@@ -61,13 +60,13 @@ Duration::get_length () const
   return mom * factor_;
 }
 
-String
+string
 Duration::to_string () const
 {
-  String s;
+  string s;
 
-  if (durlog_ < 0  )
-    s = "log = "  + ::to_string (durlog_);
+  if (durlog_ < 0)
+    s = "log = " + ::to_string (durlog_);
   else
     s = ::to_string (1 << durlog_);
 
@@ -77,7 +76,6 @@ Duration::to_string () const
   return s;
 }
 
-
 IMPLEMENT_TYPE_P (Duration, "ly:duration?");
 
 SCM
@@ -90,20 +88,20 @@ IMPLEMENT_SIMPLE_SMOBS (Duration);
 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_display (ly_string2scm (r->to_string ()), port);
   scm_puts (" >", port);
 
   return 1;
 }
 
 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_
@@ -112,7 +110,6 @@ Duration::equal_p (SCM a , SCM b)
   return eq ? SCM_BOOL_T : SCM_BOOL_F;
 }
 
-
 int
 Duration::duration_log () const
 {