From: Han-Wen Nienhuys Date: Fri, 19 Sep 2008 01:25:46 +0000 (-0300) Subject: Define our own U64_MAX maximum. X-Git-Tag: release/2.11.59-1~2 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=49daa856795e435ad1d22fa29c040b19851d692e;p=lilypond.git Define our own U64_MAX maximum. --- diff --git a/flower/include/flower-proto.hh b/flower/include/flower-proto.hh index 6aec04e5d0..794ab1ad20 100644 --- a/flower/include/flower-proto.hh +++ b/flower/include/flower-proto.hh @@ -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; diff --git a/flower/include/rational.hh b/flower/include/rational.hh index 57bd23593b..fdc3b68fab 100644 --- a/flower/include/rational.hh +++ b/flower/include/rational.hh @@ -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 diff --git a/flower/rational.cc b/flower/rational.cc index 6046374630..ff32704f85 100644 --- a/flower/rational.cc +++ b/flower/rational.cc @@ -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);