fixing remaining clang sign warnings (#1825)

fixing remaining clang sign warnings
This commit is contained in:
Alden Torres 2017-03-18 08:49:19 -04:00 committed by Arvid Norberg
parent 02ada49a3c
commit 1d1484d689
3 changed files with 5 additions and 6 deletions

View File

@ -255,7 +255,6 @@ rule warnings ( properties * )
result += <cflags>-Wvla ; result += <cflags>-Wvla ;
result += <cxxflags>-Wc++11-compat ; result += <cxxflags>-Wc++11-compat ;
result += <cflags>-Wno-format-zero-length ; result += <cflags>-Wno-format-zero-length ;
result += <cflags>-Wno-long-long ;
# enable these warnings again, once the other ones are dealt with # enable these warnings again, once the other ones are dealt with
result += <cflags>-Wno-unused-variable ; result += <cflags>-Wno-unused-variable ;

View File

@ -57,7 +57,7 @@ namespace libtorrent
basic_nl_endpoint() : basic_nl_endpoint(protocol_type(), 0, 0) {} basic_nl_endpoint() : basic_nl_endpoint(protocol_type(), 0, 0) {}
basic_nl_endpoint(protocol_type netlink_family, std::uint32_t group, ::pid_t pid = 0) basic_nl_endpoint(protocol_type netlink_family, std::uint32_t group, std::uint32_t pid = 0)
: m_proto(netlink_family) : m_proto(netlink_family)
{ {
std::memset(&m_sockaddr, 0, sizeof(sockaddr_nl)); std::memset(&m_sockaddr, 0, sizeof(sockaddr_nl));

View File

@ -160,7 +160,7 @@ namespace libtorrent { namespace
#if TORRENT_USE_NETLINK #if TORRENT_USE_NETLINK
int read_nl_sock(int sock, char *buf, int bufsize, int const seq, int const pid) int read_nl_sock(int sock, char *buf, int bufsize, std::uint32_t const seq, int const pid)
{ {
nlmsghdr* nl_hdr; nlmsghdr* nl_hdr;
@ -168,7 +168,7 @@ namespace libtorrent { namespace
do do
{ {
int read_len = int(recv(sock, buf, bufsize - msg_len, 0)); int read_len = int(recv(sock, buf, std::size_t(bufsize - msg_len), 0));
if (read_len < 0) return -1; if (read_len < 0) return -1;
nl_hdr = reinterpret_cast<nlmsghdr*>(buf); nl_hdr = reinterpret_cast<nlmsghdr*>(buf);
@ -191,7 +191,7 @@ namespace libtorrent { namespace
if ((nl_hdr->nlmsg_flags & NLM_F_MULTI) == 0) break; if ((nl_hdr->nlmsg_flags & NLM_F_MULTI) == 0) break;
} while((int(nl_hdr->nlmsg_seq) != seq) || (int(nl_hdr->nlmsg_pid) != pid)); } while((nl_hdr->nlmsg_seq != seq) || (int(nl_hdr->nlmsg_pid) != pid));
return msg_len; return msg_len;
} }
@ -1044,7 +1044,7 @@ namespace libtorrent
return std::vector<ip_route>(); return std::vector<ip_route>();
} }
int seq = 0; std::uint32_t seq = 0;
char msg[BUFSIZE] = {}; char msg[BUFSIZE] = {};
nlmsghdr* nl_msg = reinterpret_cast<nlmsghdr*>(msg); nlmsghdr* nl_msg = reinterpret_cast<nlmsghdr*>(msg);