diff --git a/rpcs3/Emu/Cell/Modules/cellFs.cpp b/rpcs3/Emu/Cell/Modules/cellFs.cpp index 0ff30feb53..bf2f453123 100644 --- a/rpcs3/Emu/Cell/Modules/cellFs.cpp +++ b/rpcs3/Emu/Cell/Modules/cellFs.cpp @@ -221,7 +221,7 @@ s32 cellFsGetDirectoryEntries(u32 fd, vm::ptr entries, u32 { cellFs.warning("cellFsGetDirectoryEntries(fd=%d, entries=*0x%x, entries_size=0x%x, data_count=*0x%x)", fd, entries, entries_size, data_count); - const auto directory = idm::get(fd); + const auto directory = idm::get(fd); if (!directory) { @@ -345,7 +345,7 @@ s32 cellFsStReadInit(u32 fd, vm::cptr ringbuf) return CELL_EINVAL; } - const auto file = idm::get(fd); + const auto file = idm::get(fd); if (!file) { @@ -366,7 +366,7 @@ s32 cellFsStReadFinish(u32 fd) { cellFs.todo("cellFsStReadFinish(fd=%d)", fd); - const auto file = idm::get(fd); + const auto file = idm::get(fd); if (!file) { @@ -382,7 +382,7 @@ s32 cellFsStReadGetRingBuf(u32 fd, vm::ptr ringbuf) { cellFs.todo("cellFsStReadGetRingBuf(fd=%d, ringbuf=*0x%x)", fd, ringbuf); - const auto file = idm::get(fd); + const auto file = idm::get(fd); if (!file) { @@ -398,7 +398,7 @@ s32 cellFsStReadGetStatus(u32 fd, vm::ptr status) { cellFs.todo("cellFsStReadGetRingBuf(fd=%d, status=*0x%x)", fd, status); - const auto file = idm::get(fd); + const auto file = idm::get(fd); if (!file) { @@ -414,7 +414,7 @@ s32 cellFsStReadGetRegid(u32 fd, vm::ptr regid) { cellFs.todo("cellFsStReadGetRingBuf(fd=%d, regid=*0x%x)", fd, regid); - const auto file = idm::get(fd); + const auto file = idm::get(fd); if (!file) { @@ -430,7 +430,7 @@ s32 cellFsStReadStart(u32 fd, u64 offset, u64 size) { cellFs.todo("cellFsStReadStart(fd=%d, offset=0x%llx, size=0x%llx)", fd, offset, size); - const auto file = idm::get(fd); + const auto file = idm::get(fd); if (!file) { @@ -446,7 +446,7 @@ s32 cellFsStReadStop(u32 fd) { cellFs.todo("cellFsStReadStop(fd=%d)", fd); - const auto file = idm::get(fd); + const auto file = idm::get(fd); if (!file) { @@ -462,7 +462,7 @@ s32 cellFsStRead(u32 fd, vm::ptr buf, u64 size, vm::ptr rsize) { cellFs.todo("cellFsStRead(fd=%d, buf=*0x%x, size=0x%llx, rsize=*0x%x)", fd, buf, size, rsize); - const auto file = idm::get(fd); + const auto file = idm::get(fd); if (!file) { @@ -478,7 +478,7 @@ s32 cellFsStReadGetCurrentAddr(u32 fd, vm::ptr addr, vm::ptr size) { cellFs.todo("cellFsStReadGetCurrentAddr(fd=%d, addr=*0x%x, size=*0x%x)", fd, addr, size); - const auto file = idm::get(fd); + const auto file = idm::get(fd); if (!file) { @@ -494,7 +494,7 @@ s32 cellFsStReadPutCurrentAddr(u32 fd, vm::ptr addr, u64 size) { cellFs.todo("cellFsStReadPutCurrentAddr(fd=%d, addr=*0x%x, size=0x%llx)", fd, addr, size); - const auto file = idm::get(fd); + const auto file = idm::get(fd); if (!file) { @@ -510,7 +510,7 @@ s32 cellFsStReadWait(u32 fd, u64 size) { cellFs.todo("cellFsStReadWait(fd=%d, size=0x%llx)", fd, size); - const auto file = idm::get(fd); + const auto file = idm::get(fd); if (!file) { @@ -526,7 +526,7 @@ s32 cellFsStReadWaitCallback(u32 fd, u64 size, vm::ptr { cellFs.todo("cellFsStReadWaitCallback(fd=%d, size=0x%llx, func=*0x%x)", fd, size, func); - const auto file = idm::get(fd); + const auto file = idm::get(fd); if (!file) { @@ -710,7 +710,7 @@ struct fs_aio_thread : ppu_thread s32 error = CELL_OK; u64 result = 0; - const auto file = idm::get(aio->fd); + const auto file = idm::get(aio->fd); if (!file || (type == 1 && file->flags & CELL_FS_O_WRONLY) || (type == 2 && !(file->flags & CELL_FS_O_ACCMODE))) { @@ -838,7 +838,7 @@ s32 cellFsSetIoBufferFromDefaultContainer(u32 fd, u32 buffer_size, u32 page_type { cellFs.todo("cellFsSetIoBufferFromDefaultContainer(fd=%d, buffer_size=%d, page_type=%d)", fd, buffer_size, page_type); - const auto file = idm::get(fd); + const auto file = idm::get(fd); if (!file) { diff --git a/rpcs3/Emu/Cell/Modules/cellGifDec.cpp b/rpcs3/Emu/Cell/Modules/cellGifDec.cpp index d768869076..095cbaf824 100644 --- a/rpcs3/Emu/Cell/Modules/cellGifDec.cpp +++ b/rpcs3/Emu/Cell/Modules/cellGifDec.cpp @@ -61,7 +61,7 @@ s32 cellGifDecOpen(PMainHandle mainHandle, PPSubHandle subHandle, PSrc src, POpe if (!file_s) return CELL_GIFDEC_ERROR_OPEN_FILE; current_subHandle.fileSize = file_s.size(); - current_subHandle.fd = idm::make(src->fileName.get_ptr(), std::move(file_s), 0, 0); + current_subHandle.fd = idm::make(src->fileName.get_ptr(), std::move(file_s), 0, 0); break; } } @@ -97,7 +97,7 @@ s32 cellGifDecReadHeader(PMainHandle mainHandle, PSubHandle subHandle, PInfo inf case CELL_GIFDEC_FILE: { - auto file = idm::get(fd); + auto file = idm::get(fd); file->file.seek(0); file->file.read(buffer, sizeof(buffer)); break; @@ -181,7 +181,7 @@ s32 cellGifDecDecodeData(PMainHandle mainHandle, PSubHandle subHandle, vm::ptr(fd); + auto file = idm::get(fd); file->file.seek(0); file->file.read(gif.get(), fileSize); break; @@ -283,7 +283,7 @@ s32 cellGifDecClose(PMainHandle mainHandle, PSubHandle subHandle) { cellGifDec.warning("cellGifDecClose(mainHandle=*0x%x, subHandle=*0x%x)", mainHandle, subHandle); - idm::remove(subHandle->fd); + idm::remove(subHandle->fd); vm::dealloc(subHandle.addr()); diff --git a/rpcs3/Emu/Cell/Modules/cellJpgDec.cpp b/rpcs3/Emu/Cell/Modules/cellJpgDec.cpp index e75ff12055..8de68133a0 100644 --- a/rpcs3/Emu/Cell/Modules/cellJpgDec.cpp +++ b/rpcs3/Emu/Cell/Modules/cellJpgDec.cpp @@ -51,7 +51,7 @@ s32 cellJpgDecOpen(u32 mainHandle, vm::ptr subHandle, vm::ptr(src->fileName.get_ptr(), std::move(file_s), 0, 0); + current_subHandle.fd = idm::make(src->fileName.get_ptr(), std::move(file_s), 0, 0); break; } } @@ -78,7 +78,7 @@ s32 cellJpgDecClose(u32 mainHandle, u32 subHandle) return CELL_JPGDEC_ERROR_FATAL; } - idm::remove(subHandle_data->fd); + idm::remove(subHandle_data->fd); idm::remove(subHandle); return CELL_OK; @@ -110,7 +110,7 @@ s32 cellJpgDecReadHeader(u32 mainHandle, u32 subHandle, vm::ptr case CELL_JPGDEC_FILE: { - auto file = idm::get(fd); + auto file = idm::get(fd); file->file.seek(0); file->file.read(buffer.get(), fileSize); break; @@ -189,7 +189,7 @@ s32 cellJpgDecDecodeData(u32 mainHandle, u32 subHandle, vm::ptr data, vm::cp case CELL_JPGDEC_FILE: { - auto file = idm::get(fd); + auto file = idm::get(fd); file->file.seek(0); file->file.read(jpg.get(), fileSize); break; diff --git a/rpcs3/Emu/Cell/Modules/cellPngDec.cpp b/rpcs3/Emu/Cell/Modules/cellPngDec.cpp index 43982a9571..30b66881c6 100644 --- a/rpcs3/Emu/Cell/Modules/cellPngDec.cpp +++ b/rpcs3/Emu/Cell/Modules/cellPngDec.cpp @@ -65,7 +65,7 @@ void pngDecReadBuffer(png_structp png_ptr, png_bytep out, png_size_t length) if (buffer.file) { // Get the file - auto file = idm::get(buffer.fd); + auto file = idm::get(buffer.fd); // Read the data file->file.read(out, length); @@ -364,7 +364,7 @@ s32 pngDecOpen(ppu_thread& ppu, PHandle handle, PPStream png_stream, PSrc source } // Get the file descriptor - buffer->fd = idm::make(stream->source.fileName.get_ptr(), std::move(file_stream), 0, 0); + buffer->fd = idm::make(stream->source.fileName.get_ptr(), std::move(file_stream), 0, 0); // Indicate that we need to read from a file stream buffer->file = true; @@ -447,7 +447,7 @@ s32 pngDecClose(ppu_thread& ppu, PHandle handle, PStream stream) // Remove the file descriptor, if a file descriptor was used for decoding if (stream->buffer->file) { - idm::remove(stream->buffer->fd); + idm::remove(stream->buffer->fd); } // Deallocate the PNG buffer structure used to decode from memory, if we decoded from memory diff --git a/rpcs3/Emu/Cell/lv2/sys_fs.cpp b/rpcs3/Emu/Cell/lv2/sys_fs.cpp index f9a47f7a95..8bc33c2c14 100644 --- a/rpcs3/Emu/Cell/lv2/sys_fs.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_fs.cpp @@ -143,7 +143,7 @@ error_code sys_fs_open(vm::cptr path, s32 flags, vm::ptr fd, s32 mode return CELL_ENOENT; } - const auto _file = idm::make_ptr(path.get_ptr(), std::move(file), mode, flags); + const auto _file = idm::make_ptr(path.get_ptr(), std::move(file), mode, flags); if (!_file) { @@ -165,7 +165,7 @@ error_code sys_fs_read(u32 fd, vm::ptr buf, u64 nbytes, vm::ptr nread return CELL_EFAULT; } - const auto file = idm::get(fd); + const auto file = idm::get(fd); if (!file || file->flags & CELL_FS_O_WRONLY) { @@ -183,7 +183,7 @@ error_code sys_fs_write(u32 fd, vm::cptr buf, u64 nbytes, vm::ptr nwr { sys_fs.trace("sys_fs_write(fd=%d, buf=*0x%x, nbytes=0x%llx, nwrite=*0x%x)", fd, buf, nbytes, nwrite); - const auto file = idm::get(fd); + const auto file = idm::get(fd); if (!file || !(file->flags & CELL_FS_O_ACCMODE)) { @@ -203,7 +203,7 @@ error_code sys_fs_close(u32 fd) { sys_fs.trace("sys_fs_close(fd=%d)", fd); - const auto file = idm::get(fd); + const auto file = idm::get(fd); if (!file) { @@ -212,7 +212,7 @@ error_code sys_fs_close(u32 fd) // TODO: return CELL_EBUSY if locked - idm::remove(fd); + idm::remove(fd); return CELL_OK; } @@ -245,7 +245,7 @@ error_code sys_fs_opendir(vm::cptr path, vm::ptr fd) return CELL_ENOENT; } - const auto _dir = idm::make_ptr(path.get_ptr(), std::move(dir)); + const auto _dir = idm::make_ptr(path.get_ptr(), std::move(dir)); if (!_dir) { @@ -263,7 +263,7 @@ error_code sys_fs_readdir(u32 fd, vm::ptr dir, vm::ptr nread) { sys_fs.warning("sys_fs_readdir(fd=%d, dir=*0x%x, nread=*0x%x)", fd, dir, nread); - const auto directory = idm::get(fd); + const auto directory = idm::get(fd); if (!directory) { @@ -291,14 +291,14 @@ error_code sys_fs_closedir(u32 fd) { sys_fs.warning("sys_fs_closedir(fd=%d)", fd); - const auto directory = idm::get(fd); + const auto directory = idm::get(fd); if (!directory) { return CELL_EBADF; } - idm::remove(fd); + idm::remove(fd); return CELL_OK; } @@ -339,7 +339,7 @@ error_code sys_fs_fstat(u32 fd, vm::ptr sb) { sys_fs.warning("sys_fs_fstat(fd=%d, sb=*0x%x)", fd, sb); - const auto file = idm::get(fd); + const auto file = idm::get(fd); if (!file) { @@ -449,7 +449,7 @@ error_code sys_fs_fcntl(u32 fd, u32 op, vm::ptr _arg, u32 _size) return CELL_EINVAL; } - const auto file = idm::get(fd); + const auto file = idm::get(fd); if (!file) { @@ -500,7 +500,7 @@ error_code sys_fs_lseek(u32 fd, s64 offset, s32 whence, vm::ptr pos) return CELL_EINVAL; } - const auto file = idm::get(fd); + const auto file = idm::get(fd); if (!file) { @@ -518,7 +518,7 @@ error_code sys_fs_fget_block_size(u32 fd, vm::ptr sector_size, vm::ptr { sys_fs.todo("sys_fs_fget_block_size(fd=%d, sector_size=*0x%x, block_size=*0x%x, arg4=*0x%x, arg5=*0x%x)", fd, sector_size, block_size, arg4, arg5); - const auto file = idm::get(fd); + const auto file = idm::get(fd); if (!file) { @@ -563,7 +563,7 @@ error_code sys_fs_ftruncate(u32 fd, u64 size) { sys_fs.warning("sys_fs_ftruncate(fd=%d, size=0x%llx)", fd, size); - const auto file = idm::get(fd); + const auto file = idm::get(fd); if (!file || !(file->flags & CELL_FS_O_ACCMODE)) {