From 09cb23f342fd2eae7ca85a99fa0a10b7ab103443 Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Tue, 15 May 2018 17:22:59 +0200 Subject: [PATCH] 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 Reviewed-by: BogDan Vatra --- src/network/kernel/qnetworkinterface_linux.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/network/kernel/qnetworkinterface_linux.cpp b/src/network/kernel/qnetworkinterface_linux.cpp index 23ed2e0e150..b3b5e242b46 100644 --- a/src/network/kernel/qnetworkinterface_linux.cpp +++ b/src/network/kernel/qnetworkinterface_linux.cpp @@ -169,7 +169,7 @@ template struct ProcessNetlinkRequest forever { qsizetype len = recv(sock, buf, bufsize, 0); hdr = reinterpret_cast(buf); - if (!NLMSG_OK(hdr, len)) + if (!NLMSG_OK(hdr, quint32(len))) return; auto arg = reinterpret_cast(NLMSG_DATA(hdr)); @@ -194,7 +194,7 @@ template struct ProcessNetlinkRequest hdr = NLMSG_NEXT(hdr, len); arg = reinterpret_cast(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