]> git.donarmstrong.com Git - lilypond.git/commitdiff
Define our own U64_MAX maximum.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 19 Sep 2008 01:25:46 +0000 (22:25 -0300)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 19 Sep 2008 01:25:46 +0000 (22:25 -0300)
flower/include/flower-proto.hh
flower/include/rational.hh
flower/rational.cc

index 6aec04e5d065baabc725205468158ca215fee76a..794ab1ad20a32d6389e87c93620f70e22e186ea7 100644 (file)
@@ -38,6 +38,10 @@ typedef unsigned U32;
 typedef int I32;
 typedef unsigned long long U64;
 
+/* We should really use LLONG_MAX; unfortunately, this appears not to
+   be defined for the gub x-compiler.
+*/
+const U64 U64_MAX = (~0ULL);
 
 struct File_storage;
 struct Mapped_file_storage;
index 57bd23593b2475b265b320dcdde20d8e87edbd38..fdc3b68fabd2a8847c23f0aa436d067019d7d4b6 100644 (file)
@@ -57,6 +57,7 @@ public:
   Rational ();
   Rational (int);
   Rational (I64);
+  Rational (U64);
   explicit Rational (I64, I64);
   explicit Rational (double);
   Rational (Rational const &r) { copy (r);}
@@ -101,6 +102,6 @@ ostream &
 operator << (ostream &, Rational);
 #endif
 
-const Rational infinity_rat (LLONG_MAX);
+const Rational infinity_rat (U64_MAX);
 
 #endif // RATIONAL_HH
index 6046374630bf7e964de4a1c0070e6a44e49c54af..ff32704f85eb0bd7167ae1b83327fb8ea07bca7f 100644 (file)
@@ -76,6 +76,13 @@ Rational::Rational (I64 n)
   den_ = 1;
 }
 
+Rational::Rational (U64 n)
+{
+  sign_ = 1;
+  num_ = n;
+  den_ = 1;
+}
+
 Rational::Rational (int n)
 {
   sign_ = ::sign (n);