From 1c340c6efad903580904297730d708ce8b947eb6 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 15 Apr 2020 15:59:23 -0400 Subject: CMakeLists: Specify -Wextra on linux builds Allows reporting more cases where logic errors may exist, such as implicit fallthrough cases, etc. We currently ignore unused parameters, since we currently have many cases where this is intentional (virtual interfaces). While we're at it, we can also tidy up any existing code that causes warnings. This also uncovered a few bugs as well. --- src/video_core/shader/track.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/video_core/shader/track.cpp') diff --git a/src/video_core/shader/track.cpp b/src/video_core/shader/track.cpp index 10739b37d..224943ad9 100644 --- a/src/video_core/shader/track.cpp +++ b/src/video_core/shader/track.cpp @@ -27,8 +27,9 @@ std::pair FindOperation(const NodeBlock& code, s64 cursor, if (const auto conditional = std::get_if(&*node)) { const auto& conditional_code = conditional->GetCode(); - auto [found, internal_cursor] = FindOperation( + auto result = FindOperation( conditional_code, static_cast(conditional_code.size() - 1), operation_code); + auto& found = result.first; if (found) { return {std::move(found), cursor}; } @@ -186,8 +187,8 @@ std::tuple ShaderIR::TrackCbuf(Node tracked, const NodeBlock& co std::optional ShaderIR::TrackImmediate(Node tracked, const NodeBlock& code, s64 cursor) const { // Reduce the cursor in one to avoid infinite loops when the instruction sets the same register // that it uses as operand - const auto [found, found_cursor] = - TrackRegister(&std::get(*tracked), code, cursor - 1); + const auto result = TrackRegister(&std::get(*tracked), code, cursor - 1); + const auto& found = result.first; if (!found) { return {}; } -- cgit v1.2.3