From 36040be2952186d56a6646ee7d972aaafdd4e31a Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Fri, 17 Nov 2017 00:02:03 +0000 Subject: Fix a ton of -Wsign-conversion warnings. --- src/socket.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/socket.cpp') 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 ""; } -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; -- cgit v1.2.3