Fix various -Wshadow warnings

This commit is contained in:
Tillmann Karras
2020-08-01 00:17:23 +01:00
parent a161e58591
commit d2b06f4786
10 changed files with 33 additions and 32 deletions

View File

@@ -172,14 +172,13 @@ Common::Debug::Threads PPCDebugInterface::GetThreads() const
constexpr u32 ACTIVE_QUEUE_HEAD_ADDR = 0x800000dc;
if (!PowerPC::HostIsRAMAddress(ACTIVE_QUEUE_HEAD_ADDR))
return threads;
u32 addr = PowerPC::HostRead_U32(ACTIVE_QUEUE_HEAD_ADDR);
if (!PowerPC::HostIsRAMAddress(addr))
const u32 active_queue_head = PowerPC::HostRead_U32(ACTIVE_QUEUE_HEAD_ADDR);
if (!PowerPC::HostIsRAMAddress(active_queue_head))
return threads;
auto active_thread = std::make_unique<Common::Debug::OSThreadView>(addr);
auto active_thread = std::make_unique<Common::Debug::OSThreadView>(active_queue_head);
if (!active_thread->IsValid())
return threads;
addr = active_thread->Data().thread_link.prev;
const auto insert_threads = [&threads](u32 addr, auto get_next_addr) {
while (addr != 0 && PowerPC::HostIsRAMAddress(addr))
@@ -192,11 +191,13 @@ Common::Debug::Threads PPCDebugInterface::GetThreads() const
}
};
insert_threads(addr, [](const auto& thread) { return thread.Data().thread_link.prev; });
const u32 prev_addr = active_thread->Data().thread_link.prev;
insert_threads(prev_addr, [](const auto& thread) { return thread.Data().thread_link.prev; });
std::reverse(threads.begin(), threads.end());
addr = active_thread->Data().thread_link.next;
const u32 next_addr = active_thread->Data().thread_link.next;
threads.emplace_back(std::move(active_thread));
insert_threads(addr, [](const auto& thread) { return thread.Data().thread_link.next; });
insert_threads(next_addr, [](const auto& thread) { return thread.Data().thread_link.next; });
return threads;
}