From 13671d9684ce77321ba003f8acaf43f602b46d82 Mon Sep 17 00:00:00 2001 From: scribam Date: Sat, 8 Jun 2019 10:35:09 +0200 Subject: [PATCH] rsx: Apply Clang-Tidy fix "modernize-loop-convert" + const when relevant --- rpcs3/Emu/RSX/Common/ShaderParam.h | 16 ++++++++-------- rpcs3/Emu/RSX/Common/VertexProgramDecompiler.cpp | 12 ++++++------ rpcs3/Emu/RSX/GL/GLOverlays.h | 6 +++--- rpcs3/Emu/RSX/RSXThread.cpp | 6 +++--- rpcs3/Emu/RSX/VK/VKOverlays.h | 6 +++--- 5 files changed, 23 insertions(+), 23 deletions(-) diff --git a/rpcs3/Emu/RSX/Common/ShaderParam.h b/rpcs3/Emu/RSX/Common/ShaderParam.h index 19f4794fcd..87f6988d10 100644 --- a/rpcs3/Emu/RSX/Common/ShaderParam.h +++ b/rpcs3/Emu/RSX/Common/ShaderParam.h @@ -90,11 +90,11 @@ struct ParamType { } - bool SearchName(const std::string& name) + bool SearchName(const std::string& name) const { - for (u32 i = 0; i keys_to_remove; - for (auto It = temp_image_cache.begin(); It != temp_image_cache.end(); ++It) + for (const auto& temp_image : temp_image_cache) { - if (It->second.first == key) + if (temp_image.second.first == key) { - keys_to_remove.push_back(It->first); + keys_to_remove.push_back(temp_image.first); } } diff --git a/rpcs3/Emu/RSX/RSXThread.cpp b/rpcs3/Emu/RSX/RSXThread.cpp index 1dd5acd6e1..45b572372b 100644 --- a/rpcs3/Emu/RSX/RSXThread.cpp +++ b/rpcs3/Emu/RSX/RSXThread.cpp @@ -2172,11 +2172,11 @@ namespace rsx if (zeta_address) { //Find zeta address in bound zculls - for (int i = 0; i < rsx::limits::zculls_count; i++) + for (const auto& zcull : zculls) { - if (zculls[i].binded) + if (zcull.binded) { - const u32 rsx_address = rsx::get_address(zculls[i].offset, CELL_GCM_LOCATION_LOCAL); + const u32 rsx_address = rsx::get_address(zcull.offset, CELL_GCM_LOCATION_LOCAL); if (rsx_address == zeta_address) { zcull_surface_active = true; diff --git a/rpcs3/Emu/RSX/VK/VKOverlays.h b/rpcs3/Emu/RSX/VK/VKOverlays.h index 15d63b7949..b5efdabaf0 100644 --- a/rpcs3/Emu/RSX/VK/VKOverlays.h +++ b/rpcs3/Emu/RSX/VK/VKOverlays.h @@ -661,11 +661,11 @@ namespace vk void remove_temp_resources(u32 key) { std::vector keys_to_remove; - for (auto It = temp_image_cache.begin(); It != temp_image_cache.end(); ++It) + for (const auto& temp_image : temp_image_cache) { - if (It->second.first == key) + if (temp_image.second.first == key) { - keys_to_remove.push_back(It->first); + keys_to_remove.push_back(temp_image.first); } }