[Lldb-commits] [lldb] [NFC][lldb][windows] Replace C-style casts with static_cast / reinterpret_cast (PR #199039)

David Spickett via lldb-commits lldb-commits at lists.llvm.org
Thu May 21 08:30:06 PDT 2026


================
@@ -128,12 +128,14 @@ class PseudoConsole {
   void SetStopping(bool value) { m_stopping = value; };
 
 protected:
-  HANDLE m_conpty_handle = ((HANDLE)(long long)-1);
-  HANDLE m_conpty_output = ((HANDLE)(long long)-1);
-  HANDLE m_conpty_input = ((HANDLE)(long long)-1);
+  HANDLE m_conpty_handle = reinterpret_cast<HANDLE>(static_cast<intptr_t>(-1));
+  HANDLE m_conpty_output = reinterpret_cast<HANDLE>(static_cast<intptr_t>(-1));
+  HANDLE m_conpty_input = reinterpret_cast<HANDLE>(static_cast<intptr_t>(-1));
   // Pipe mode: child-side handles passed to CreateProcessW, closed after launch
-  HANDLE m_pipe_child_stdin = ((HANDLE)(long long)-1);
-  HANDLE m_pipe_child_stdout = ((HANDLE)(long long)-1);
+  HANDLE m_pipe_child_stdin =
+      reinterpret_cast<HANDLE>(static_cast<intptr_t>(-1));
+  HANDLE m_pipe_child_stdout =
+      reinterpret_cast<HANDLE>(static_cast<intptr_t>(-1));
----------------
DavidSpickett wrote:

long long does too but I don't feel like remembering exactly how :)

https://github.com/llvm/llvm-project/pull/199039


More information about the lldb-commits mailing list