From ae772e6a7413ced2a0e897f084f336b05be7ae73 Mon Sep 17 00:00:00 2001 From: lightningterror <18107717+lightningterror@users.noreply.github.com> Date: Tue, 20 Jun 2023 21:33:01 +0200 Subject: [PATCH] Elfheader: Fix Wsign-compare warnings. --- pcsx2/Elfheader.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pcsx2/Elfheader.cpp b/pcsx2/Elfheader.cpp index 6908a7bfb0..5ad61b408b 100644 --- a/pcsx2/Elfheader.cpp +++ b/pcsx2/Elfheader.cpp @@ -149,7 +149,7 @@ void ElfObject::initElfHeaders() bool ElfObject::hasValidPSXHeader() { - if (data.GetSizeInBytes() < sizeof(PSXEXEHeader)) + if (data.GetSizeInBytes() < static_cast(sizeof(PSXEXEHeader))) return false; const PSXEXEHeader* header = reinterpret_cast(data.GetPtr()); @@ -158,7 +158,7 @@ bool ElfObject::hasValidPSXHeader() if (std::memcmp(header->id, expected_id, sizeof(expected_id)) != 0) return false; - if ((header->file_size + sizeof(PSXEXEHeader)) > data.GetSizeInBytes()) + if (static_cast(header->file_size + sizeof(PSXEXEHeader)) > data.GetSizeInBytes()) { Console.Warning("Incorrect file size in PS-EXE header: %u bytes should not be greater than %u bytes", header->file_size, static_cast(data.GetSizeInBytes() - sizeof(PSXEXEHeader)));