From 6fa3faec658893c9fae19116232d24dac08babc7 Mon Sep 17 00:00:00 2001 From: Kyle Kienapfel Date: Fri, 11 Nov 2022 04:12:37 -0800 Subject: Add break for default cases Visual Studio has an option to search all files in a solution, so I did a search in there for "default:" looking for any missing break statements. I've left out default statements that return something, and that throw something, even if via ThrowInvalidType. UNREACHABLE leads towards throw R_THROW macro leads towards a return --- src/video_core/engines/maxwell_dma.cpp | 1 + src/video_core/engines/puller.cpp | 4 ++++ src/video_core/macro/macro_interpreter.cpp | 2 ++ src/video_core/macro/macro_jit_x64.cpp | 1 + src/video_core/renderer_opengl/gl_texture_cache.cpp | 2 ++ src/video_core/renderer_opengl/renderer_opengl.cpp | 1 + src/video_core/renderer_vulkan/vk_scheduler.cpp | 1 + src/video_core/renderer_vulkan/vk_texture_cache.cpp | 1 + src/video_core/textures/decoders.cpp | 3 +++ 9 files changed, 16 insertions(+) (limited to 'src/video_core') diff --git a/src/video_core/engines/maxwell_dma.cpp b/src/video_core/engines/maxwell_dma.cpp index 4eb7a100d..27be4af87 100644 --- a/src/video_core/engines/maxwell_dma.cpp +++ b/src/video_core/engines/maxwell_dma.cpp @@ -311,6 +311,7 @@ void MaxwellDMA::ReleaseSemaphore() { } default: ASSERT_MSG(false, "Unknown semaphore type: {}", static_cast(type.Value())); + break; } } diff --git a/src/video_core/engines/puller.cpp b/src/video_core/engines/puller.cpp index 3977bb0fb..4d2278811 100644 --- a/src/video_core/engines/puller.cpp +++ b/src/video_core/engines/puller.cpp @@ -50,6 +50,7 @@ void Puller::ProcessBindMethod(const MethodCall& method_call) { break; default: UNIMPLEMENTED_MSG("Unimplemented engine {:04X}", engine_id); + break; } } @@ -65,6 +66,7 @@ void Puller::ProcessFenceActionMethod() { break; default: UNIMPLEMENTED_MSG("Unimplemented operation {}", regs.fence_action.op.Value()); + break; } } @@ -228,6 +230,7 @@ void Puller::CallEngineMethod(const MethodCall& method_call) { break; default: UNIMPLEMENTED_MSG("Unimplemented engine"); + break; } } @@ -254,6 +257,7 @@ void Puller::CallEngineMultiMethod(u32 method, u32 subchannel, const u32* base_s break; default: UNIMPLEMENTED_MSG("Unimplemented engine"); + break; } } diff --git a/src/video_core/macro/macro_interpreter.cpp b/src/video_core/macro/macro_interpreter.cpp index c0d32c112..0d63495a9 100644 --- a/src/video_core/macro/macro_interpreter.cpp +++ b/src/video_core/macro/macro_interpreter.cpp @@ -201,6 +201,7 @@ bool MacroInterpreterImpl::Step(bool is_delay_slot) { } default: UNIMPLEMENTED_MSG("Unimplemented macro operation {}", opcode.operation.Value()); + break; } // An instruction with the Exit flag will not actually @@ -297,6 +298,7 @@ void MacroInterpreterImpl::ProcessResult(Macro::ResultOperation operation, u32 r break; default: UNIMPLEMENTED_MSG("Unimplemented result operation {}", operation); + break; } } diff --git a/src/video_core/macro/macro_jit_x64.cpp b/src/video_core/macro/macro_jit_x64.cpp index 25c1ce798..7347cbd88 100644 --- a/src/video_core/macro/macro_jit_x64.cpp +++ b/src/video_core/macro/macro_jit_x64.cpp @@ -652,6 +652,7 @@ void MacroJITx64Impl::Compile_ProcessResult(Macro::ResultOperation operation, u3 break; default: UNIMPLEMENTED_MSG("Unimplemented macro operation {}", operation); + break; } } diff --git a/src/video_core/renderer_opengl/gl_texture_cache.cpp b/src/video_core/renderer_opengl/gl_texture_cache.cpp index 99cd11d1e..9f7ce7414 100644 --- a/src/video_core/renderer_opengl/gl_texture_cache.cpp +++ b/src/video_core/renderer_opengl/gl_texture_cache.cpp @@ -891,6 +891,7 @@ void Image::CopyBufferToImage(const VideoCommon::BufferImageCopy& copy, size_t b break; default: ASSERT(false); + break; } } @@ -927,6 +928,7 @@ void Image::CopyImageToBuffer(const VideoCommon::BufferImageCopy& copy, size_t b break; default: ASSERT(false); + break; } // Compressed formats don't have a pixel format or type const bool is_compressed = gl_format == GL_NONE; diff --git a/src/video_core/renderer_opengl/renderer_opengl.cpp b/src/video_core/renderer_opengl/renderer_opengl.cpp index 8bd5eba7e..f29462f7c 100644 --- a/src/video_core/renderer_opengl/renderer_opengl.cpp +++ b/src/video_core/renderer_opengl/renderer_opengl.cpp @@ -340,6 +340,7 @@ void RendererOpenGL::ConfigureFramebufferTexture(TextureInfo& texture, texture.gl_type = GL_UNSIGNED_INT_8_8_8_8_REV; // UNIMPLEMENTED_MSG("Unknown framebuffer pixel format: {}", // static_cast(framebuffer.pixel_format)); + break; } texture.resource.Release(); diff --git a/src/video_core/renderer_vulkan/vk_scheduler.cpp b/src/video_core/renderer_vulkan/vk_scheduler.cpp index 7934f2a51..4a7b633b7 100644 --- a/src/video_core/renderer_vulkan/vk_scheduler.cpp +++ b/src/video_core/renderer_vulkan/vk_scheduler.cpp @@ -221,6 +221,7 @@ void Scheduler::SubmitExecution(VkSemaphore signal_semaphore, VkSemaphore wait_s [[fallthrough]]; default: vk::Check(result); + break; } }); chunk->MarkSubmit(); diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp index 853b80d8a..a65bbeb1c 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp @@ -108,6 +108,7 @@ constexpr VkBorderColor ConvertBorderColor(const std::array& color) { break; default: ASSERT_MSG(false, "Invalid surface type"); + break; } } if (info.storage) { diff --git a/src/video_core/textures/decoders.cpp b/src/video_core/textures/decoders.cpp index fd1a4b987..59120cd09 100644 --- a/src/video_core/textures/decoders.cpp +++ b/src/video_core/textures/decoders.cpp @@ -170,6 +170,7 @@ void Swizzle(std::span output, std::span input, u32 bytes_per_pixe #undef BPP_CASE default: ASSERT_MSG(false, "Invalid bytes_per_pixel={}", bytes_per_pixel); + break; } } @@ -217,6 +218,7 @@ void SwizzleSubrect(std::span output, std::span input, u32 bytes_p #undef BPP_CASE default: ASSERT_MSG(false, "Invalid bytes_per_pixel={}", bytes_per_pixel); + break; } } @@ -240,6 +242,7 @@ void UnswizzleSubrect(std::span output, std::span input, u32 bytes #undef BPP_CASE default: ASSERT_MSG(false, "Invalid bytes_per_pixel={}", bytes_per_pixel); + break; } } -- cgit v1.2.3