diff options
author | Gavin Andresen <gavinandresen@gmail.com> | 2011-12-19 17:08:25 -0500 |
---|---|---|
committer | Luke Dashjr <luke-jr+git@utopios.org> | 2012-06-14 19:52:31 +0000 |
commit | 5cd2a640a5ef867c376582810b1dd4b6fa43df5e (patch) | |
tree | 9963e1702c8d5657f28b8edb6390a93383fb20ac /src/main.h | |
parent | ca39829ecb90e392b9722292739585124ba0d7c1 (diff) | |
download | bitcoin-5cd2a640a5ef867c376582810b1dd4b6fa43df5e.tar.xz |
Use std::numeric_limits<> for typesafe INT_MAX/etc
(this fixes a Mac OS X gitian build error for 0.5.x)
Diffstat (limited to 'src/main.h')
-rw-r--r-- | src/main.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/main.h b/src/main.h index 930f5187d9..7aa660dba7 100644 --- a/src/main.h +++ b/src/main.h @@ -253,17 +253,17 @@ public: CTxIn() { - nSequence = UINT_MAX; + nSequence = std::numeric_limits<unsigned int>::max(); } - explicit CTxIn(COutPoint prevoutIn, CScript scriptSigIn=CScript(), unsigned int nSequenceIn=UINT_MAX) + explicit CTxIn(COutPoint prevoutIn, CScript scriptSigIn=CScript(), unsigned int nSequenceIn=std::numeric_limits<unsigned int>::max()) { prevout = prevoutIn; scriptSig = scriptSigIn; nSequence = nSequenceIn; } - CTxIn(uint256 hashPrevTx, unsigned int nOut, CScript scriptSigIn=CScript(), unsigned int nSequenceIn=UINT_MAX) + CTxIn(uint256 hashPrevTx, unsigned int nOut, CScript scriptSigIn=CScript(), unsigned int nSequenceIn=std::numeric_limits<unsigned int>::max()) { prevout = COutPoint(hashPrevTx, nOut); scriptSig = scriptSigIn; @@ -279,7 +279,7 @@ public: bool IsFinal() const { - return (nSequence == UINT_MAX); + return (nSequence == std::numeric_limits<unsigned int>::max()); } friend bool operator==(const CTxIn& a, const CTxIn& b) @@ -303,7 +303,7 @@ public: str += strprintf(", coinbase %s", HexStr(scriptSig).c_str()); else str += strprintf(", scriptSig=%s", scriptSig.ToString().substr(0,24).c_str()); - if (nSequence != UINT_MAX) + if (nSequence != std::numeric_limits<unsigned int>::max()) str += strprintf(", nSequence=%u", nSequence); str += ")"; return str; @@ -460,7 +460,7 @@ public: return false; bool fNewer = false; - unsigned int nLowest = UINT_MAX; + unsigned int nLowest = std::numeric_limits<unsigned int>::max(); for (unsigned int i = 0; i < vin.size(); i++) { if (vin[i].nSequence != old.vin[i].nSequence) |