mirror of https://github.com/PCSX2/pcsx2.git
CDVD: Fix -Wsign-compare warnings.
This commit is contained in:
parent
6fcd5d0aff
commit
4e3431585f
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue