From ddc2c15ce8eabefd80bd65c1bc9459b514378023 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Fri, 26 Jul 2013 22:12:12 -0700 Subject: [PATCH] Remove some unsigned < 0 comparisons. --- Core/HLE/sceAtrac.cpp | 5 ----- Core/HLE/sceAudio.cpp | 4 ++-- Core/HLE/sceKernelMemory.cpp | 2 +- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/Core/HLE/sceAtrac.cpp b/Core/HLE/sceAtrac.cpp index effd72f489..32600ca637 100644 --- a/Core/HLE/sceAtrac.cpp +++ b/Core/HLE/sceAtrac.cpp @@ -1734,11 +1734,6 @@ int sceAtracSetAA3HalfwayBufferAndGetID(u32 halfBuffer, u32 readSize, u32 halfBu return ATRAC_ERROR_INCORRECT_READ_SIZE; } - if (readSize < 0 || halfBufferSize < 0) { - ERROR_LOG_REPORT(HLE, "sceAtracSetAA3HalfwayBufferAndGetID(%08x, %08x, %08x): invalid buffer size", halfBuffer, readSize, halfBufferSize); - return -1; - } - int codecType = getCodecType(halfBuffer); Atrac *atrac = new Atrac(); atrac->first.addr = halfBuffer; diff --git a/Core/HLE/sceAudio.cpp b/Core/HLE/sceAudio.cpp index 8afcf6f1fc..3f0738dc4f 100644 --- a/Core/HLE/sceAudio.cpp +++ b/Core/HLE/sceAudio.cpp @@ -313,7 +313,7 @@ u32 sceAudioOutput2Reserve(u32 sampleCount) { u32 sceAudioOutput2OutputBlocking(u32 vol, u32 dataPtr){ // Note: 0xFFFFF, not 0xFFFF! - if (vol < 0 || vol > 0xFFFFF) { + if (vol > 0xFFFFF) { ERROR_LOG(HLE,"sceAudioOutput2OutputBlocking(%08x, %08x) - invalid volume", vol, dataPtr); return SCE_ERROR_AUDIO_INVALID_VOLUME; } @@ -401,7 +401,7 @@ u32 sceAudioSRCChRelease() { } u32 sceAudioSRCOutputBlocking(u32 vol, u32 buf) { - if (vol < 0 || vol > 0xFFFFF) { + if (vol > 0xFFFFF) { ERROR_LOG(HLE,"sceAudioSRCOutputBlocking(%08x, %08x) - invalid volume", vol, buf); return SCE_ERROR_AUDIO_INVALID_VOLUME; } diff --git a/Core/HLE/sceKernelMemory.cpp b/Core/HLE/sceKernelMemory.cpp index 764b9bae8c..ab65d02389 100644 --- a/Core/HLE/sceKernelMemory.cpp +++ b/Core/HLE/sceKernelMemory.cpp @@ -1261,7 +1261,7 @@ u32 AllocMemoryBlock(const char *pname, u32 type, u32 size, u32 paramsAddr) { WARN_LOG(HLE, "AllockMemoryBlock(SysMemUserForUser_FE707FDF) : unknown parameters with length %d", length); } } - if (type < 0 || type > 1) { + if (type > 1) { return SCE_KERNEL_ERROR_ILLEGAL_MEMBLOCKTYPE; }