From dfa582169bfeec61f0e4c01545a7e3c290210d0d Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 3 May 2020 13:29:06 -0400 Subject: [PATCH] kernel/memory: Resolve -Wshadow warnings Prevents variable name clashing. --- src/core/hle/kernel/memory/memory_manager.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core/hle/kernel/memory/memory_manager.cpp b/src/core/hle/kernel/memory/memory_manager.cpp index 3cd4f9e85c..6b432e1b2c 100644 --- a/src/core/hle/kernel/memory/memory_manager.cpp +++ b/src/core/hle/kernel/memory/memory_manager.cpp @@ -104,9 +104,9 @@ ResultCode MemoryManager::Allocate(PageLinkedList& page_list, std::size_t num_pa // Ensure that we don't leave anything un-freed auto group_guard = detail::ScopeExit([&] { for (const auto& it : page_list.Nodes()) { - const auto num_pages{std::min( + const auto min_num_pages{std::min( it.GetNumPages(), (chosen_manager.GetEndAddress() - it.GetAddress()) / PageSize)}; - chosen_manager.Free(it.GetAddress(), num_pages); + chosen_manager.Free(it.GetAddress(), min_num_pages); } }); @@ -165,9 +165,9 @@ ResultCode MemoryManager::Free(PageLinkedList& page_list, std::size_t num_pages, // Free all of the pages for (const auto& it : page_list.Nodes()) { - const auto num_pages{std::min( + const auto min_num_pages{std::min( it.GetNumPages(), (chosen_manager.GetEndAddress() - it.GetAddress()) / PageSize)}; - chosen_manager.Free(it.GetAddress(), num_pages); + chosen_manager.Free(it.GetAddress(), min_num_pages); } return RESULT_SUCCESS;