mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Io: Ensure sign extension for error codes.
The ternary `cond ? EnumValue : IntValue` was not sign extending consistently across compilers, but we actually want it to always sign extend in either case.
This commit is contained in:
parent
571ea0eec5
commit
ac6106af03
1 changed files with 3 additions and 3 deletions
|
@ -991,7 +991,7 @@ static u32 sceIoReadAsync(int id, u32 data_addr, int size) {
|
|||
int us;
|
||||
bool complete = __IoRead(result, id, data_addr, size, us);
|
||||
if (complete) {
|
||||
f->asyncResult = result;
|
||||
f->asyncResult = (s64)result;
|
||||
DEBUG_LOG(SCEIO, "%llx=sceIoReadAsync(%d, %08x, %x)", f->asyncResult, id, data_addr, size);
|
||||
} else {
|
||||
DEBUG_LOG(SCEIO, "sceIoReadAsync(%d, %08x, %x): deferring result", id, data_addr, size);
|
||||
|
@ -1125,7 +1125,7 @@ static u32 sceIoWriteAsync(int id, u32 data_addr, int size) {
|
|||
int us;
|
||||
bool complete = __IoWrite(result, id, data_addr, size, us);
|
||||
if (complete) {
|
||||
f->asyncResult = result;
|
||||
f->asyncResult = (s64)result;
|
||||
DEBUG_LOG(SCEIO, "%llx=sceIoWriteAsync(%d, %08x, %x)", f->asyncResult, id, data_addr, size);
|
||||
} else {
|
||||
DEBUG_LOG(SCEIO, "sceIoWriteAsync(%d, %08x, %x): deferring result", id, data_addr, size);
|
||||
|
@ -1935,7 +1935,7 @@ static u32 sceIoOpenAsync(const char *filename, int flags, int mode)
|
|||
f = new FileNode();
|
||||
f->handle = kernelObjects.Create(f);
|
||||
f->fullpath = filename;
|
||||
f->asyncResult = error == 0 ? SCE_KERNEL_ERROR_ERRNO_FILE_NOT_FOUND : error;
|
||||
f->asyncResult = error == 0 ? (s64)SCE_KERNEL_ERROR_ERRNO_FILE_NOT_FOUND : (s64)error;
|
||||
f->closePending = true;
|
||||
|
||||
fd = __IoAllocFd(f);
|
||||
|
|
Loading…
Add table
Reference in a new issue