Skip to content

Commit

Permalink
CDVD: Fix -Wsign-compare warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
lightningterror committed Jun 15, 2024
1 parent 6fcd5d0 commit 4e34315
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pcsx2/CDVD/CDVD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit 4e34315

Please sign in to comment.