From 096f339a2a817054c9e2dfef188a5e2470126236 Mon Sep 17 00:00:00 2001 From: ReinUsesLisp Date: Fri, 8 Nov 2019 17:08:07 -0300 Subject: video_core: Silence implicit conversion warnings --- src/video_core/engines/maxwell_3d.cpp | 3 ++- src/video_core/engines/shader_bytecode.h | 12 +++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) (limited to 'src/video_core/engines') diff --git a/src/video_core/engines/maxwell_3d.cpp b/src/video_core/engines/maxwell_3d.cpp index 2bed6cb38..42ce49a4d 100644 --- a/src/video_core/engines/maxwell_3d.cpp +++ b/src/video_core/engines/maxwell_3d.cpp @@ -261,7 +261,8 @@ void Maxwell3D::CallMacroMethod(u32 method, std::size_t num_parameters, const u3 executing_macro = 0; // Lookup the macro offset - const u32 entry = ((method - MacroRegistersStart) >> 1) % macro_positions.size(); + const u32 entry = + ((method - MacroRegistersStart) >> 1) % static_cast(macro_positions.size()); // Execute the current macro. macro_interpreter.Execute(macro_positions[entry], num_parameters, parameters); diff --git a/src/video_core/engines/shader_bytecode.h b/src/video_core/engines/shader_bytecode.h index 8f6bc76eb..78d6886fb 100644 --- a/src/video_core/engines/shader_bytecode.h +++ b/src/video_core/engines/shader_bytecode.h @@ -1478,7 +1478,8 @@ union Instruction { u32 value = static_cast(target); // The branch offset is relative to the next instruction and is stored in bytes, so // divide it by the size of an instruction and add 1 to it. - return static_cast((value ^ mask) - mask) / sizeof(Instruction) + 1; + return static_cast((value ^ mask) - mask) / static_cast(sizeof(Instruction)) + + 1; } } bra; @@ -1492,7 +1493,8 @@ union Instruction { u32 value = static_cast(target); // The branch offset is relative to the next instruction and is stored in bytes, so // divide it by the size of an instruction and add 1 to it. - return static_cast((value ^ mask) - mask) / sizeof(Instruction) + 1; + return static_cast((value ^ mask) - mask) / static_cast(sizeof(Instruction)) + + 1; } } brx; @@ -1851,11 +1853,11 @@ private: const std::size_t bit_position = opcode_bitsize - i - 1; switch (bitstring[i]) { case '0': - mask |= 1 << bit_position; + mask |= static_cast(1U << bit_position); break; case '1': - expect |= 1 << bit_position; - mask |= 1 << bit_position; + expect |= static_cast(1U << bit_position); + mask |= static_cast(1U << bit_position); break; default: // Ignore -- cgit v1.2.3