From e76ba958da60033fce588a1c6012e719f335baf4 Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Fri, 13 Sep 2019 02:00:04 +1000 Subject: [PATCH] msvc considers 'long' a 32-bit type rather than 64-bit --- app/common/rational.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/app/common/rational.h b/app/common/rational.h index cdf5e61f4..93d04382b 100644 --- a/app/common/rational.h +++ b/app/common/rational.h @@ -15,7 +15,7 @@ extern "C" { using namespace std; -typedef long intType; +typedef int64_t intType; /* * Zero Handling * 0/0 = 0 @@ -33,7 +33,7 @@ public: if(numer == 0) denom = 0; } - + rational(const intType &numerator, const intType &denominator) :numer(numerator), denom(denominator) { @@ -51,7 +51,7 @@ public: else numer = intType(0); } - + rational(const rational &rhs) :numer(rhs.numer), denom(rhs.denom) { @@ -59,10 +59,10 @@ public: } rational(const AVRational& r); - + //destructor ~rational(); - + //Assignment Operators const rational& operator=(const rational &rhs); const rational& operator+=(const rational &rhs); @@ -75,7 +75,7 @@ public: rational operator-(const rational &rhs) const; rational operator/(const rational &rhs) const; rational operator*(const rational &rhs) const; - + //Relational and equality operators bool operator<(const rational &rhs) const; bool operator<=(const rational &rhs) const; @@ -83,7 +83,7 @@ public: bool operator>=(const rational &rhs) const; bool operator==(const rational &rhs) const; bool operator!=(const rational &rhs) const; - + //Unary operators const rational& operator++(); //prefix rational operator++(int); //postfix @@ -101,7 +101,7 @@ public: // Returns whether the rational is null or not bool isNull() const; - + //Function: print number to cout void print(ostream &out = cout) const; @@ -114,7 +114,7 @@ public: const intType& numerator() const; const intType& denominator() const; - + private: //number of active instances static int activeInstances; @@ -122,7 +122,7 @@ private: //numerator and denominator intType numer; intType denom; - + //Function: ensures denom >= 0 void fixSigns(); //Function: ensures lowest form