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 20:38:25 +0000 |
commit | 0ce74bfaa5f34351e5b23e19ee90e7367bd50245 (patch) | |
tree | a4445dd77cc0964fca7aa1514aaf324f278350fb /src/net.cpp | |
parent | 3703150d56ff6ee557ab330e55637c9c23835902 (diff) | |
download | bitcoin-0ce74bfaa5f34351e5b23e19ee90e7367bd50245.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/net.cpp')
-rw-r--r-- | src/net.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/net.cpp b/src/net.cpp index 8384251095..0c98b8ee3e 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -251,8 +251,8 @@ bool Lookup(const char *pszName, vector<CAddress>& vaddr, int nServices, int nMa else pszColon[0] = 0; port = portParsed; - if (port < 0 || port > USHRT_MAX) - port = USHRT_MAX; + if (port < 0 || port > std::numeric_limits<unsigned short>::max()) + port = std::numeric_limits<unsigned short>::max(); } } @@ -1540,7 +1540,7 @@ void ThreadOpenConnections2(void* parg) // Choose an address to connect to based on most recently seen // CAddress addrConnect; - int64 nBest = INT64_MIN; + int64 nBest = std::numeric_limits<int64>::min(); // Only connect to one address per a.b.?.? range. // Do this here so we don't have to critsect vNodes inside mapAddresses critsect. |