Changeset View
Changeset View
Standalone View
Standalone View
src/netaddress.cpp
Show First 20 Lines • Show All 507 Lines • ▼ Show 20 Lines | bool CService::SetSockAddr(const struct sockaddr *paddr) { | ||||
} | } | ||||
} | } | ||||
unsigned short CService::GetPort() const { | unsigned short CService::GetPort() const { | ||||
return port; | return port; | ||||
} | } | ||||
bool operator==(const CService &a, const CService &b) { | bool operator==(const CService &a, const CService &b) { | ||||
return (CNetAddr)a == (CNetAddr)b && a.port == b.port; | return static_cast<CNetAddr>(a) == static_cast<CNetAddr>(b) && | ||||
a.port == b.port; | |||||
} | } | ||||
bool operator<(const CService &a, const CService &b) { | bool operator<(const CService &a, const CService &b) { | ||||
return static_cast<CNetAddr>(a) < static_cast<CNetAddr>(b) || | return static_cast<CNetAddr>(a) < static_cast<CNetAddr>(b) || | ||||
(static_cast<CNetAddr>(a) == static_cast<CNetAddr>(b) && | (static_cast<CNetAddr>(a) == static_cast<CNetAddr>(b) && | ||||
a.port < b.port); | a.port < b.port); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 211 Lines • Show Last 20 Lines |