]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/moment.cc
* lily/horizontal-bracket.cc (make_bracket): new function.
[lilypond.git] / lily / moment.cc
index a50ce3cbd1f0004c7a4a17bf6a4f095fd64290a8..d561aa7607b0509648bcc9335be5b6c3de3b666a 100644 (file)
@@ -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;