From: Martin Storsjo Date: Sat, 21 Sep 2019 19:10:15 +0000 (+0000) Subject: [LLDB] Cast -1 (as invalid socket) to the socket type before comparing X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5534a6750087ef4290c58238337b0dad29397f46;p=platform%2Fupstream%2Fllvm.git [LLDB] Cast -1 (as invalid socket) to the socket type before comparing This silences warnings about comparison of integers between unsigned long long (which is what the Windows SOCKET type is) and signed int when building in MinGW mode. Differential Revision: https://reviews.llvm.org/D67863 llvm-svn: 372486 --- diff --git a/lldb/source/Host/common/Socket.cpp b/lldb/source/Host/common/Socket.cpp index 525727e..2376885 100644 --- a/lldb/source/Host/common/Socket.cpp +++ b/lldb/source/Host/common/Socket.cpp @@ -476,11 +476,11 @@ NativeSocket Socket::AcceptSocket(NativeSocket sockfd, struct sockaddr *addr, if (!child_processes_inherit) { flags |= SOCK_CLOEXEC; } - NativeSocket fd = llvm::sys::RetryAfterSignal(-1, ::accept4, - sockfd, addr, addrlen, flags); + NativeSocket fd = llvm::sys::RetryAfterSignal( + static_cast(-1), ::accept4, sockfd, addr, addrlen, flags); #else - NativeSocket fd = llvm::sys::RetryAfterSignal(-1, ::accept, - sockfd, addr, addrlen); + NativeSocket fd = llvm::sys::RetryAfterSignal( + static_cast(-1), ::accept, sockfd, addr, addrlen); #endif if (fd == kInvalidSocketValue) SetLastError(error); diff --git a/lldb/tools/lldb-vscode/lldb-vscode.cpp b/lldb/tools/lldb-vscode/lldb-vscode.cpp index 2810da6..b6a3fc8 100644 --- a/lldb/tools/lldb-vscode/lldb-vscode.cpp +++ b/lldb/tools/lldb-vscode/lldb-vscode.cpp @@ -93,8 +93,9 @@ SOCKET AcceptConnection(int portno) { } else { listen(sockfd, 5); socklen_t clilen = sizeof(cli_addr); - newsockfd = llvm::sys::RetryAfterSignal(-1, accept, - sockfd, (struct sockaddr *)&cli_addr, &clilen); + newsockfd = + llvm::sys::RetryAfterSignal(static_cast(-1), accept, sockfd, + (struct sockaddr *)&cli_addr, &clilen); if (newsockfd < 0) if (g_vsc.log) *g_vsc.log << "error: accept (" << strerror(errno) << ")"