[Lldb-commits] [PATCH] D72161: [lldb][NFC] Use static_cast instead of reinterpret_cast where possible

Shafik Yaghmour via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Jan 3 11:21:39 PST 2020


shafik added inline comments.


================
Comment at: lldb/tools/debugserver/source/MacOSX/MachProcess.mm:1745
+                     "0x%8.8llx, length = %llu) => %p",
+                     (uint64_t)addr, (uint64_t)length, static_cast<void *>(bp));
     return bp;
----------------
`static_cast<uint64_t>(addr)` and `static_cast<uint64_t>(length)`


================
Comment at: lldb/tools/debugserver/source/MacOSX/MachProcess.mm:1777
+                     "0x%8.8llx, length = %llu) => %p",
+                     (uint64_t)addr, (uint64_t)length, static_cast<void *>(wp));
     return wp;
----------------
`static_cast<uint64_t>(addr)` and `static_cast<uint64_t>(length)`

You can use `-Wold-style-cast` to warm on C-style casts.


================
Comment at: lldb/tools/debugserver/source/MacOSX/MachProcess.mm:2306
   DNBLogThreadedIf(LOG_PROCESS, "MachProcess::%s (&%p[%llu]) ...", __FUNCTION__,
-                   reinterpret_cast<void *>(buf), (uint64_t)buf_size);
+                   static_cast<void *>(buf), (uint64_t)buf_size);
   PTHREAD_MUTEX_LOCKER(locker, m_stdio_mutex);
----------------
`static_cast<uint64_t>(buf_size)` 


================
Comment at: lldb/tools/debugserver/source/MacOSX/MachProcess.mm:2466
   DNBLogThreadedIf(LOG_PROCESS, "MachProcess::%s (&%p[%llu]) ...", __FUNCTION__,
-                   reinterpret_cast<void *>(buf), (uint64_t)buf_size);
+                   static_cast<void *>(buf), (uint64_t)buf_size);
   PTHREAD_MUTEX_LOCKER(locker, m_profile_data_mutex);
----------------
`static_cast<uint64_t>(buf_size)` 


Repository:
  rLLDB LLDB

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D72161/new/

https://reviews.llvm.org/D72161





More information about the lldb-commits mailing list