summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2018-05-15 17:22:59 +0200
committerLiang Qi <liang.qi@qt.io>2018-05-16 06:06:04 +0000
commit09cb23f342fd2eae7ca85a99fa0a10b7ab103443 (patch)
tree151b6e02c6c2a5ac4aec3bf1528d31b8196d113d
parent5349cb9d3ca52c2268aace7c7f4860b88af98d32 (diff)
Fix build for Android with android-clang
kernel/qnetworkinterface_linux.cpp:172:18: error: comparison of integers of different signs: '__u32' (aka 'unsigned int') and 'qsizetype' (aka 'int') [-Werror,-Wsign-compare] if (!NLMSG_OK(hdr, len)) ^~~~~~~~~~~~~~~~~~ kernel/qnetworkinterface_linux.cpp:197:26: error: comparison of integers of different signs: '__u32' (aka 'unsigned int') and 'qsizetype' (aka 'int') [-Werror,-Wsign-compare] } while (NLMSG_OK(hdr, len)); ^~~~~~~~~~~~~~~~~~ Change-Id: I3d0a4efc9fc42dd9b0726f2b62ff494220b8026e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: BogDan Vatra <bogdan@kdab.com>
-rw-r--r--src/network/kernel/qnetworkinterface_linux.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/network/kernel/qnetworkinterface_linux.cpp b/src/network/kernel/qnetworkinterface_linux.cpp
index 23ed2e0e15..b3b5e242b4 100644
--- a/src/network/kernel/qnetworkinterface_linux.cpp
+++ b/src/network/kernel/qnetworkinterface_linux.cpp
@@ -169,7 +169,7 @@ template <typename Lambda> struct ProcessNetlinkRequest
forever {
qsizetype len = recv(sock, buf, bufsize, 0);
hdr = reinterpret_cast<struct nlmsghdr *>(buf);
- if (!NLMSG_OK(hdr, len))
+ if (!NLMSG_OK(hdr, quint32(len)))
return;
auto arg = reinterpret_cast<FirstArgument>(NLMSG_DATA(hdr));
@@ -194,7 +194,7 @@ template <typename Lambda> struct ProcessNetlinkRequest
hdr = NLMSG_NEXT(hdr, len);
arg = reinterpret_cast<FirstArgument>(NLMSG_DATA(hdr));
payloadLen = NLMSG_PAYLOAD(hdr, 0);
- } while (NLMSG_OK(hdr, len));
+ } while (NLMSG_OK(hdr, quint32(len)));
if (len == 0)
continue; // get new datagram