diff options
author | Gavin Andresen <gavinandresen@gmail.com> | 2011-12-19 17:08:25 -0500 |
---|---|---|
committer | Gavin Andresen <gavinandresen@gmail.com> | 2011-12-19 19:10:34 -0500 |
commit | 26ce92b3526430d4a40b2faccef4facb966d6a0a (patch) | |
tree | e23a92f6152c3abcf8cf3c42bf5a5b50ecc5dc42 /src/net.cpp | |
parent | bd846c0e565ca0db276cb6b7eac7763bebe19b84 (diff) |
Use std::numeric_limits<> for typesafe INT_MAX/etc
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 7d2f18b2d0..9b8dbe11e8 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -249,8 +249,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(); } } @@ -1488,7 +1488,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. |