From 6339a5ea8ea8920c1c7f1076b687512013da1457 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 5 Dec 2019 08:43:34 -0500 Subject: [PATCH] VideoCommon/OpcodeDecoding: Resolve implicit signedness conversion cmd2 is a u32, so any bitwise arithmetic on it with a type of the same size or smaller will result in a u32 value. This is also implicitly converted to an unsigned type in the if statement as well, given that size_t * int -> size_t. This is just more explicit about the operations occurring and also likely silences a sign conversion warning. --- Source/Core/VideoCommon/OpcodeDecoding.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/VideoCommon/OpcodeDecoding.cpp b/Source/Core/VideoCommon/OpcodeDecoding.cpp index 8aeb385977..ab904e6a8c 100644 --- a/Source/Core/VideoCommon/OpcodeDecoding.cpp +++ b/Source/Core/VideoCommon/OpcodeDecoding.cpp @@ -136,7 +136,7 @@ u8* Run(DataReader src, u32* cycles, bool in_display_list) return finish_up(); const u32 cmd2 = src.Read(); - const int transfer_size = ((cmd2 >> 16) & 15) + 1; + const u32 transfer_size = ((cmd2 >> 16) & 15) + 1; if (src.size() < transfer_size * sizeof(u32)) return finish_up();