From 1d1484d689fd3ccf4a93a633b042f58084bab86e Mon Sep 17 00:00:00 2001 From: Alden Torres Date: Sat, 18 Mar 2017 08:49:19 -0400 Subject: [PATCH] fixing remaining clang sign warnings (#1825) fixing remaining clang sign warnings --- Jamfile | 1 - include/libtorrent/netlink.hpp | 2 +- src/enum_net.cpp | 8 ++++---- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Jamfile b/Jamfile index f26f4961d..6fd871a53 100644 --- a/Jamfile +++ b/Jamfile @@ -255,7 +255,6 @@ rule warnings ( properties * ) result += -Wvla ; result += -Wc++11-compat ; result += -Wno-format-zero-length ; - result += -Wno-long-long ; # enable these warnings again, once the other ones are dealt with result += -Wno-unused-variable ; diff --git a/include/libtorrent/netlink.hpp b/include/libtorrent/netlink.hpp index ba4a6a73f..7950fcaaa 100644 --- a/include/libtorrent/netlink.hpp +++ b/include/libtorrent/netlink.hpp @@ -57,7 +57,7 @@ namespace libtorrent 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) { std::memset(&m_sockaddr, 0, sizeof(sockaddr_nl)); diff --git a/src/enum_net.cpp b/src/enum_net.cpp index 1b5ee50a3..01a6c5ea9 100644 --- a/src/enum_net.cpp +++ b/src/enum_net.cpp @@ -160,7 +160,7 @@ namespace libtorrent { namespace #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; @@ -168,7 +168,7 @@ namespace libtorrent { namespace 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; nl_hdr = reinterpret_cast(buf); @@ -191,7 +191,7 @@ namespace libtorrent { namespace 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; } @@ -1044,7 +1044,7 @@ namespace libtorrent return std::vector(); } - int seq = 0; + std::uint32_t seq = 0; char msg[BUFSIZE] = {}; nlmsghdr* nl_msg = reinterpret_cast(msg);