From a7a5b662c0f2772c258de3a85ca433050a5d1939 Mon Sep 17 00:00:00 2001 From: "Dr. Dystopia" Date: Tue, 13 Aug 2024 11:42:14 +0200 Subject: [PATCH] Remove unreachable code --- Source/Core/Core/ActionReplay.cpp | 2 -- Source/Core/Core/PowerPC/GDBStub.cpp | 2 -- Source/Core/VideoBackends/D3D/DXShader.cpp | 3 --- .../Core/VideoCommon/Assets/DirectFilesystemAssetLibrary.cpp | 5 ++--- Source/Core/VideoCommon/Assets/MeshAsset.cpp | 2 -- Source/Core/VideoCommon/BPStructs.cpp | 1 - Source/Core/VideoCommon/XFStructs.cpp | 3 --- 7 files changed, 2 insertions(+), 16 deletions(-) diff --git a/Source/Core/Core/ActionReplay.cpp b/Source/Core/Core/ActionReplay.cpp index 3052f06dec..c4f0dd9ae7 100644 --- a/Source/Core/Core/ActionReplay.cpp +++ b/Source/Core/Core/ActionReplay.cpp @@ -314,8 +314,6 @@ static void VLogInfo(std::string_view format, fmt::format_args args) return; const bool use_internal_log = s_use_internal_log.load(std::memory_order_relaxed); - if (Common::Log::MAX_LOGLEVEL < Common::Log::LogLevel::LINFO && !use_internal_log) - return; std::string text = fmt::vformat(format, args); INFO_LOG_FMT(ACTIONREPLAY, "{}", text); diff --git a/Source/Core/Core/PowerPC/GDBStub.cpp b/Source/Core/Core/PowerPC/GDBStub.cpp index c293977aeb..3cb188868b 100644 --- a/Source/Core/Core/PowerPC/GDBStub.cpp +++ b/Source/Core/Core/PowerPC/GDBStub.cpp @@ -574,7 +574,6 @@ static void ReadRegister() break; default: return SendReply("E01"); - break; } } @@ -798,7 +797,6 @@ static void WriteRegister() break; default: return SendReply("E01"); - break; } } diff --git a/Source/Core/VideoBackends/D3D/DXShader.cpp b/Source/Core/VideoBackends/D3D/DXShader.cpp index 8ee6b0aecc..65cb6be06d 100644 --- a/Source/Core/VideoBackends/D3D/DXShader.cpp +++ b/Source/Core/VideoBackends/D3D/DXShader.cpp @@ -72,7 +72,6 @@ std::unique_ptr DXShader::CreateFromBytecode(ShaderStage stage, Binary return std::make_unique(ShaderStage::Geometry, std::move(bytecode), gs.Get(), name); } - break; case ShaderStage::Pixel: { @@ -84,7 +83,6 @@ std::unique_ptr DXShader::CreateFromBytecode(ShaderStage stage, Binary return std::make_unique(ShaderStage::Pixel, std::move(bytecode), ps.Get(), name); } - break; case ShaderStage::Compute: { @@ -96,7 +94,6 @@ std::unique_ptr DXShader::CreateFromBytecode(ShaderStage stage, Binary return std::make_unique(ShaderStage::Compute, std::move(bytecode), cs.Get(), name); } - break; default: break; diff --git a/Source/Core/VideoCommon/Assets/DirectFilesystemAssetLibrary.cpp b/Source/Core/VideoCommon/Assets/DirectFilesystemAssetLibrary.cpp index 90d77d8ec9..d2702eea73 100644 --- a/Source/Core/VideoCommon/Assets/DirectFilesystemAssetLibrary.cpp +++ b/Source/Core/VideoCommon/Assets/DirectFilesystemAssetLibrary.cpp @@ -455,7 +455,8 @@ bool DirectFilesystemAssetLibrary::LoadMips(const std::filesystem::path& asset_p Common::ToLower(&extension_lower); // Load additional mip levels - for (u32 mip_level = static_cast(data->m_levels.size());; mip_level++) + for (u32 initial_mip_level = static_cast(data->m_levels.size()), mip_level = + initial_mip_level; mip_level < initial_mip_level + 100; mip_level++) { const auto mip_level_filename = filename + fmt::format("_mip{}", mip_level); @@ -488,8 +489,6 @@ bool DirectFilesystemAssetLibrary::LoadMips(const std::filesystem::path& asset_p data->m_levels.push_back(std::move(level)); } - - return true; } DirectFilesystemAssetLibrary::AssetMap diff --git a/Source/Core/VideoCommon/Assets/MeshAsset.cpp b/Source/Core/VideoCommon/Assets/MeshAsset.cpp index 05a4ba0961..eb411dbdf5 100644 --- a/Source/Core/VideoCommon/Assets/MeshAsset.cpp +++ b/Source/Core/VideoCommon/Assets/MeshAsset.cpp @@ -72,7 +72,6 @@ bool GLTFComponentTypeToAttributeFormat(int component_type, AttributeFormat* for { return false; } - break; case TINYGLTF_COMPONENT_TYPE_FLOAT: { format->type = ComponentFormat::Float; @@ -101,7 +100,6 @@ bool GLTFComponentTypeToAttributeFormat(int component_type, AttributeFormat* for { return false; } - break; case TINYGLTF_COMPONENT_TYPE_UNSIGNED_SHORT: { format->type = ComponentFormat::UShort; diff --git a/Source/Core/VideoCommon/BPStructs.cpp b/Source/Core/VideoCommon/BPStructs.cpp index 4f02c298b4..7353cc78af 100644 --- a/Source/Core/VideoCommon/BPStructs.cpp +++ b/Source/Core/VideoCommon/BPStructs.cpp @@ -198,7 +198,6 @@ static void BPWritten(PixelShaderManager& pixel_shader_manager, XFStateManager& WARN_LOG_FMT(VIDEO, "GXSetDrawDone ??? (value {:#04X})", bp.newvalue & 0xFFFF); return; } - return; case BPMEM_PE_TOKEN_ID: // Pixel Engine Token ID { INCSTAT(g_stats.this_frame.num_token); diff --git a/Source/Core/VideoCommon/XFStructs.cpp b/Source/Core/VideoCommon/XFStructs.cpp index e5ca9b81ea..0b07d9bca2 100644 --- a/Source/Core/VideoCommon/XFStructs.cpp +++ b/Source/Core/VideoCommon/XFStructs.cpp @@ -338,7 +338,6 @@ std::pair GetXFRegInfo(u32 address, u32 value) case XFMEM_SETNUMCHAN: return std::make_pair(RegName(XFMEM_SETNUMCHAN), fmt::format("Number of color channels: {}", value & 3)); - break; case XFMEM_SETCHAN0_AMBCOLOR: return std::make_pair(RegName(XFMEM_SETCHAN0_AMBCOLOR), @@ -396,7 +395,6 @@ std::pair GetXFRegInfo(u32 address, u32 value) case XFMEM_SETVIEWPORT + 5: return std::make_pair(RegName(XFMEM_SETVIEWPORT + 5), fmt::format("Viewport far z: {}", std::bit_cast(value))); - break; case XFMEM_SETPROJECTION: return std::make_pair(RegName(XFMEM_SETPROJECTION + 0), @@ -464,7 +462,6 @@ std::pair GetXFRegInfo(u32 address, u32 value) return std::make_pair( fmt::format("Possible Normal Mtx XF reg?: {:x}={:x}", address, value), "Maybe these are for Normals? xfmem.texcoords[0].nrmmtxinfo.hex = data; break; ??"); - break; case 0x1013: case 0x1014: