CDVD: Fix -Wsign-compare warnings.

This commit is contained in:
lightningterror 2024-06-15 00:57:04 +02:00
parent 6fcd5d0aff
commit 4e3431585f
1 changed files with 2 additions and 2 deletions

View File

@ -230,7 +230,7 @@ void cdvdSaveNVRAM()
static void cdvdReadNVM(u8* dst, int offset, int bytes)
{
int to_read = bytes;
if ((offset + bytes) > sizeof(s_nvram)) [[unlikely]]
if (static_cast<size_t>(offset + bytes) > sizeof(s_nvram)) [[unlikely]]
{
WARNING_LOG("CDVD: Out of bounds NVRAM read: offset={}, bytes={}", offset, bytes);
to_read = std::max(static_cast<int>(sizeof(s_nvram)) - offset, 0);
@ -245,7 +245,7 @@ static void cdvdReadNVM(u8* dst, int offset, int bytes)
static void cdvdWriteNVM(const u8* src, int offset, int bytes)
{
int to_write = bytes;
if ((offset + bytes) > sizeof(s_nvram)) [[unlikely]]
if (static_cast<size_t>(offset + bytes) > sizeof(s_nvram)) [[unlikely]]
{
WARNING_LOG("CDVD: Out of bounds NVRAM write: offset={}, bytes={}", offset, bytes);
to_write = std::max(static_cast<int>(sizeof(s_nvram)) - offset, 0);