mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-21 07:39:08 +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
ca39829ecb
commit
5cd2a640a5
@@ -875,7 +875,7 @@ struct tallyitem
|
||||
tallyitem()
|
||||
{
|
||||
nAmount = 0;
|
||||
nConf = INT_MAX;
|
||||
nConf = std::numeric_limits<int>::max();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -927,7 +927,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;
|
||||
@@ -947,7 +947,7 @@ Value ListReceived(const Array& params, bool fByAccounts)
|
||||
obj.push_back(Pair("account", strAccount));
|
||||
obj.push_back(Pair("label", strAccount)); // deprecated
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -962,7 +962,7 @@ Value ListReceived(const Array& params, bool fByAccounts)
|
||||
obj.push_back(Pair("account", (*it).first));
|
||||
obj.push_back(Pair("label", (*it).first)); // deprecated
|
||||
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