From d7ec031419f7eef3f85210659cf7f6dc8c50d791 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 29 Nov 2022 08:04:40 -0500 Subject: engines: Remove unnecessary casts In a few cases we have some casts that can be trivially removed. --- src/video_core/engines/maxwell_dma.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/video_core/engines/maxwell_dma.cpp') diff --git a/src/video_core/engines/maxwell_dma.cpp b/src/video_core/engines/maxwell_dma.cpp index 334429514..a189e60ae 100644 --- a/src/video_core/engines/maxwell_dma.cpp +++ b/src/video_core/engines/maxwell_dma.cpp @@ -41,8 +41,8 @@ void MaxwellDMA::CallMethod(u32 method, u32 method_argument, bool is_last_call) void MaxwellDMA::CallMultiMethod(u32 method, const u32* base_start, u32 amount, u32 methods_pending) { - for (size_t i = 0; i < amount; ++i) { - CallMethod(method, base_start[i], methods_pending - static_cast(i) <= 1); + for (u32 i = 0; i < amount; ++i) { + CallMethod(method, base_start[i], methods_pending - i <= 1); } } @@ -94,14 +94,14 @@ void MaxwellDMA::Launch() { reinterpret_cast(tmp_buffer.data()), regs.line_length_in * sizeof(u32)); } else { - auto convert_linear_2_blocklinear_addr = [](u64 address) { + const auto convert_linear_2_blocklinear_addr = [](u64 address) { return (address & ~0x1f0ULL) | ((address & 0x40) >> 2) | ((address & 0x10) << 1) | ((address & 0x180) >> 1) | ((address & 0x20) << 3); }; - auto src_kind = memory_manager.GetPageKind(regs.offset_in); - auto dst_kind = memory_manager.GetPageKind(regs.offset_out); - const bool is_src_pitch = IsPitchKind(static_cast(src_kind)); - const bool is_dst_pitch = IsPitchKind(static_cast(dst_kind)); + const auto src_kind = memory_manager.GetPageKind(regs.offset_in); + const auto dst_kind = memory_manager.GetPageKind(regs.offset_out); + const bool is_src_pitch = IsPitchKind(src_kind); + const bool is_dst_pitch = IsPitchKind(dst_kind); if (!is_src_pitch && is_dst_pitch) { UNIMPLEMENTED_IF(regs.line_length_in % 16 != 0); UNIMPLEMENTED_IF(regs.offset_in % 16 != 0); -- cgit v1.2.3