[Lldb-commits] [lldb] 118038e - [lldb] Use the NativeSock type instead of plain 'int'

Martin Storsjö via lldb-commits lldb-commits at lists.llvm.org
Tue Aug 30 00:08:54 PDT 2022


Author: Martin Storsjö
Date: 2022-08-30T10:07:44+03:00
New Revision: 118038e878cf7c169c74cdf31de019913775e881

URL: https://github.com/llvm/llvm-project/commit/118038e878cf7c169c74cdf31de019913775e881
DIFF: https://github.com/llvm/llvm-project/commit/118038e878cf7c169c74cdf31de019913775e881.diff

LOG: [lldb] Use the NativeSock type instead of plain 'int'

This fixes a warning when building for Windows:

    ../tools/lldb/source/Host/common/TCPSocket.cpp:297:16: warning: comparison of integers of different signs: 'int' and 'const NativeSocket' (aka 'const unsigned long long') [-Wsign-compare]
          if (sock != kInvalidSocketValue) {
              ~~~~ ^  ~~~~~~~~~~~~~~~~~~~

Differential Revision: https://reviews.llvm.org/D132841

Added: 
    

Modified: 
    lldb/source/Host/common/TCPSocket.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/Host/common/TCPSocket.cpp b/lldb/source/Host/common/TCPSocket.cpp
index 91465d2fe4976..82b00ac561f9a 100644
--- a/lldb/source/Host/common/TCPSocket.cpp
+++ b/lldb/source/Host/common/TCPSocket.cpp
@@ -261,8 +261,8 @@ Status TCPSocket::Accept(Socket *&conn_socket) {
     return error;
   }
 
-  int sock = kInvalidSocketValue;
-  int listen_sock = kInvalidSocketValue;
+  NativeSocket sock = kInvalidSocketValue;
+  NativeSocket listen_sock = kInvalidSocketValue;
   lldb_private::SocketAddress AcceptAddr;
   MainLoop accept_loop;
   std::vector<MainLoopBase::ReadHandleUP> handles;


        


More information about the lldb-commits mailing list