From ccd41e55f1cd1a2a99bd357076638954f419429a Mon Sep 17 00:00:00 2001 From: Jason Molenda Date: Thu, 4 Oct 2012 22:47:07 +0000 Subject: Ran the sources through the compiler with -Wshadow warnings enabled after we'd found a few bugs that were caused by shadowed local variables; the most important issue this turned up was a common mistake of trying to obtain a mutex lock for the scope of a code block by doing Mutex::Locker(m_map_mutex); This doesn't assign the lock object to a local variable; it is a temporary that has its dtor called immediately. Instead, Mutex::Locker locker(m_map_mutex); does what is intended. For some reason -Wshadow happened to highlight these as shadowed variables. I also fixed a few obivous and easy shadowed variable issues across the code base but there are a couple dozen more that should be fixed when someone has a free minute. llvm-svn: 165269 --- lldb/source/Core/Communication.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lldb/source/Core/Communication.cpp') diff --git a/lldb/source/Core/Communication.cpp b/lldb/source/Core/Communication.cpp index 64cc2f97ebd..0c7a8901f6f 100644 --- a/lldb/source/Core/Communication.cpp +++ b/lldb/source/Core/Communication.cpp @@ -208,7 +208,7 @@ Communication::Write (const void *src, size_t src_len, ConnectionStatus &status, { lldb::ConnectionSP connection_sp (m_connection_sp); - Mutex::Locker (m_write_mutex); + Mutex::Locker locker(m_write_mutex); lldb_private::LogIfAnyCategoriesSet (LIBLLDB_LOG_COMMUNICATION, "%p Communication::Write (src = %p, src_len = %llu) connection = %p", this, -- cgit v1.2.3