[Lldb-commits] [lldb] r372590 - [LLDB] Add a void* cast when passing object pointers to printf %p
Martin Storsjo via lldb-commits
lldb-commits at lists.llvm.org
Mon Sep 23 05:03:28 PDT 2019
Author: mstorsjo
Date: Mon Sep 23 05:03:28 2019
New Revision: 372590
URL: http://llvm.org/viewvc/llvm-project?rev=372590&view=rev
Log:
[LLDB] Add a void* cast when passing object pointers to printf %p
This fixes build warnings in MinGW mode.
Also remove leftover if (log) {} around the log macro.
Differential Revision: https://reviews.llvm.org/D67896
Modified:
lldb/trunk/source/Host/windows/ConnectionGenericFileWindows.cpp
Modified: lldb/trunk/source/Host/windows/ConnectionGenericFileWindows.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/windows/ConnectionGenericFileWindows.cpp?rev=372590&r1=372589&r2=372590&view=diff
==============================================================================
--- lldb/trunk/source/Host/windows/ConnectionGenericFileWindows.cpp (original)
+++ lldb/trunk/source/Host/windows/ConnectionGenericFileWindows.cpp Mon Sep 23 05:03:28 2019
@@ -245,13 +245,11 @@ finish:
IncrementFilePointer(return_info.GetBytes());
Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_CONNECTION));
- if (log) {
- LLDB_LOGF(log,
- "%p ConnectionGenericFile::Read() handle = %p, dst = %p, "
- "dst_len = %zu) => %zu, error = %s",
- this, m_file, dst, dst_len, return_info.GetBytes(),
- return_info.GetError().AsCString());
- }
+ LLDB_LOGF(log,
+ "%p ConnectionGenericFile::Read() handle = %p, dst = %p, "
+ "dst_len = %zu) => %zu, error = %s",
+ static_cast<void *>(this), m_file, dst, dst_len,
+ return_info.GetBytes(), return_info.GetError().AsCString());
return return_info.GetBytes();
}
@@ -296,13 +294,11 @@ finish:
IncrementFilePointer(return_info.GetBytes());
Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_CONNECTION));
- if (log) {
- LLDB_LOGF(log,
- "%p ConnectionGenericFile::Write() handle = %p, src = %p, "
- "src_len = %zu) => %zu, error = %s",
- this, m_file, src, src_len, return_info.GetBytes(),
- return_info.GetError().AsCString());
- }
+ LLDB_LOGF(log,
+ "%p ConnectionGenericFile::Write() handle = %p, src = %p, "
+ "src_len = %zu) => %zu, error = %s",
+ static_cast<void *>(this), m_file, src, src_len,
+ return_info.GetBytes(), return_info.GetError().AsCString());
return return_info.GetBytes();
}
More information about the lldb-commits
mailing list