diff options
author | Peter Powell <petpow@saberuk.com> | 2017-11-17 00:02:03 +0000 |
---|---|---|
committer | Peter Powell <petpow@saberuk.com> | 2017-11-17 15:33:01 +0000 |
commit | 36040be2952186d56a6646ee7d972aaafdd4e31a (patch) | |
tree | 72be7108a94dd6bd0ea2842c53ba8890c44d12d8 /src/socket.cpp | |
parent | 3b51dfb1d611a874c3f1138d1c1ec1bb8984334c (diff) |
Fix a ton of -Wsign-conversion warnings.
Diffstat (limited to 'src/socket.cpp')
-rw-r--r-- | src/socket.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/socket.cpp b/src/socket.cpp index 91c7cdeca..6133d9ee4 100644 --- a/src/socket.cpp +++ b/src/socket.cpp @@ -178,7 +178,7 @@ std::string irc::sockets::sockaddrs::str() const return "<unknown>"; } -int irc::sockets::sockaddrs::sa_size() const +socklen_t irc::sockets::sockaddrs::sa_size() const { if (sa.sa_family == AF_INET) return sizeof(in4); @@ -198,7 +198,7 @@ bool irc::sockets::sockaddrs::operator==(const irc::sockets::sockaddrs& other) c return !memcmp(this, &other, sizeof(*this)); } -static void sa2cidr(irc::sockets::cidr_mask& cidr, const irc::sockets::sockaddrs& sa, int range) +static void sa2cidr(irc::sockets::cidr_mask& cidr, const irc::sockets::sockaddrs& sa, unsigned char range) { const unsigned char* base; unsigned char target_byte; @@ -239,7 +239,7 @@ static void sa2cidr(irc::sockets::cidr_mask& cidr, const irc::sockets::sockaddrs } } -irc::sockets::cidr_mask::cidr_mask(const irc::sockets::sockaddrs& sa, int range) +irc::sockets::cidr_mask::cidr_mask(const irc::sockets::sockaddrs& sa, unsigned char range) { sa2cidr(*this, sa, range); } @@ -267,7 +267,7 @@ std::string irc::sockets::cidr_mask::str() const irc::sockets::sockaddrs sa; sa.sa.sa_family = type; unsigned char* base; - int len; + size_t len; if (type == AF_INET) { base = (unsigned char*)&sa.in4.sin_addr; |