mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-02-11 09:42:17 +01:00
Use std::numeric_limits<> for typesafe INT_MAX/etc
(this fixes a Mac OS X gitian build error for 0.5.x)
This commit is contained in:
committed by
Luke Dashjr
parent
3703150d56
commit
0ce74bfaa5
@@ -944,7 +944,7 @@ struct tallyitem
|
||||
tallyitem()
|
||||
{
|
||||
nAmount = 0;
|
||||
nConf = INT_MAX;
|
||||
nConf = std::numeric_limits<int>::max();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -996,7 +996,7 @@ Value ListReceived(const Array& params, bool fByAccounts)
|
||||
continue;
|
||||
|
||||
int64 nAmount = 0;
|
||||
int nConf = INT_MAX;
|
||||
int nConf = std::numeric_limits<int>::max();
|
||||
if (it != mapTally.end())
|
||||
{
|
||||
nAmount = (*it).second.nAmount;
|
||||
@@ -1015,7 +1015,7 @@ Value ListReceived(const Array& params, bool fByAccounts)
|
||||
obj.push_back(Pair("address", address.ToString()));
|
||||
obj.push_back(Pair("account", strAccount));
|
||||
obj.push_back(Pair("amount", ValueFromAmount(nAmount)));
|
||||
obj.push_back(Pair("confirmations", (nConf == INT_MAX ? 0 : nConf)));
|
||||
obj.push_back(Pair("confirmations", (nConf == std::numeric_limits<int>::max() ? 0 : nConf)));
|
||||
ret.push_back(obj);
|
||||
}
|
||||
}
|
||||
@@ -1029,7 +1029,7 @@ Value ListReceived(const Array& params, bool fByAccounts)
|
||||
Object obj;
|
||||
obj.push_back(Pair("account", (*it).first));
|
||||
obj.push_back(Pair("amount", ValueFromAmount(nAmount)));
|
||||
obj.push_back(Pair("confirmations", (nConf == INT_MAX ? 0 : nConf)));
|
||||
obj.push_back(Pair("confirmations", (nConf == std::numeric_limits<int>::max() ? 0 : nConf)));
|
||||
ret.push_back(obj);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user