Elfheader: Fix Wsign-compare warnings.

This commit is contained in:
lightningterror 2023-06-20 21:33:01 +02:00
parent 0a58783a86
commit ae772e6a74
1 changed files with 2 additions and 2 deletions

View File

@ -149,7 +149,7 @@ void ElfObject::initElfHeaders()
bool ElfObject::hasValidPSXHeader()
{
if (data.GetSizeInBytes() < sizeof(PSXEXEHeader))
if (data.GetSizeInBytes() < static_cast<s64>(sizeof(PSXEXEHeader)))
return false;
const PSXEXEHeader* header = reinterpret_cast<const PSXEXEHeader*>(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<s64>(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<unsigned>(data.GetSizeInBytes() - sizeof(PSXEXEHeader)));