]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/moment.cc
* The grand 2005-2006 replace.
[lilypond.git] / lily / moment.cc
index a50ce3cbd1f0004c7a4a17bf6a4f095fd64290a8..5897f9163d01bbf70eed8ef046f715597bb26e2a 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 1999--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c) 1999--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
 
 #include "moment.hh"
@@ -33,6 +33,7 @@ Moment::Moment (Rational m)
 }
 
 #include "ly-smobs.icc"
+
 IMPLEMENT_SIMPLE_SMOBS (Moment);
 IMPLEMENT_TYPE_P (Moment, "ly:moment?");
 
@@ -96,6 +97,7 @@ Moment::operator += (Moment const &src)
   main_part_ += src.main_part_;
   grace_part_ += src.grace_part_;
 }
+
 void
 Moment::operator -= (Moment const &src)
 {
@@ -103,9 +105,7 @@ Moment::operator -= (Moment const &src)
   grace_part_ -= src.grace_part_;
 }
 
-/*
-  only take the main part of SRC for multiplication.
-*/
+/* Only take the main part of SRC for multiplication.  */
 void
 Moment::operator *= (Moment const &src)
 {
@@ -113,9 +113,7 @@ Moment::operator *= (Moment const &src)
   grace_part_ *= src.main_part_;
 }
 
-/*
-  only take the main part of SRC for multiplication.
-*/
+/* Only take the main part of SRC for division.  */
 void
 Moment::operator /= (Moment const &src)
 {
@@ -123,6 +121,14 @@ Moment::operator /= (Moment const &src)
   grace_part_ /= src.main_part_;
 }
 
+/* Only take the main part of SRC for division.  */
+void
+Moment::operator %= (Moment const &src)
+{
+  main_part_ %= src.main_part_;
+  grace_part_ %= src.main_part_;
+}
+
 int
 Moment::den () const
 {
@@ -152,9 +158,7 @@ Moment::to_string () const
 {
   String s = main_part_.to_string ();
   if (grace_part_)
-    {
-      s += "G" + grace_part_.to_string ();
-    }
+    s += "G" + grace_part_.to_string ();
   return s;
 }
 
@@ -168,8 +172,8 @@ Moment::operator - () const
 }
 
 #ifdef STREAM_SUPPORT
-std::ostream &
-operator << (std::ostream &os, Moment const &m)
+ostream &
+operator << (ostream &os, Moment const &m)
 {
   os << m.to_string ();
   return os;