Use std::numeric_limits<> for typesafe INT_MAX/etc

This commit is contained in:
Gavin Andresen
2011-12-19 17:08:25 -05:00
parent bd846c0e56
commit 26ce92b352
13 changed files with 26 additions and 34 deletions

View File

@@ -223,7 +223,7 @@ bool CAddress::IsValid() const
if (memcmp(pchReserved, pchIPv4+3, sizeof(pchIPv4)-3) == 0)
return false;
return (ip != 0 && ip != INADDR_NONE && port != htons(USHRT_MAX));
return (ip != 0 && ip != INADDR_NONE && port != htons(std::numeric_limits<unsigned short>::max()));
}
unsigned char CAddress::GetByte(int n) const