Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion source/devoptab/devoptab_fsa.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ MochaUtilsStatus Mocha_MountFSEx(const char *virt_name, const char *dev_path, co
if (dev_path) {
res = FSAMount(mount->clientHandle, dev_path, mount_path, mountFlags, mountArgBuf, mountArgBufLen);
if (res < 0) {
DEBUG_FUNCTION_LINE_ERR("FSAMount(0x%08X, %s, %s, %08X, %08X, %08X) failed: %s", mount->clientHandle, dev_path, mount_path, mountFlags, mountArgBuf, mountArgBufLen, FSAGetStatusStr(res));
DEBUG_FUNCTION_LINE_ERR("FSAMount(0x%08X, %s, %s, %08X, %p, %08X) failed: %s", mount->clientHandle, dev_path, mount_path, mountFlags, mountArgBuf, mountArgBufLen, FSAGetStatusStr(res));
fsa_free(mount);
if (res == FS_ERROR_ALREADY_EXISTS) {
return MOCHA_RESULT_ALREADY_EXISTS;
Expand Down
2 changes: 1 addition & 1 deletion source/devoptab/devoptab_fsa_dirnext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ int __fsa_dirnext(struct _reent *r,
status = FSAReadDir(deviceData->clientHandle, dir->fd, &dir->entry_data);
if (status < 0) {
if (status != FS_ERROR_END_OF_DIR) {
DEBUG_FUNCTION_LINE_ERR("FSAReadDir(0x%08X, 0x%08X, 0x%08X) (%s) failed: %s",
DEBUG_FUNCTION_LINE_ERR("FSAReadDir(0x%08X, 0x%08X, %p) (%s) failed: %s",
deviceData->clientHandle, dir->fd, &dir->entry_data, dir->name, FSAGetStatusStr(status));
}
r->_errno = __fsa_translate_error(status);
Expand Down
2 changes: 1 addition & 1 deletion source/devoptab/devoptab_fsa_diropen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ __fsa_diropen(struct _reent *r,
auto *deviceData = (FSADeviceData *) r->deviceData;
status = FSAOpenDir(deviceData->clientHandle, dir->name, &fd);
if (status < 0) {
DEBUG_FUNCTION_LINE_ERR("FSAOpenDir(0x%08X, %s, 0x%08X) failed: %s",
DEBUG_FUNCTION_LINE_ERR("FSAOpenDir(0x%08X, %s, %p) failed: %s",
deviceData->clientHandle, dir->name, &fd, FSAGetStatusStr(status));
r->_errno = __fsa_translate_error(status);
return nullptr;
Expand Down
2 changes: 1 addition & 1 deletion source/devoptab/devoptab_fsa_fstat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ int __fsa_fstat(struct _reent *r,

status = FSAGetStatFile(deviceData->clientHandle, file->fd, &fsStat);
if (status < 0) {
DEBUG_FUNCTION_LINE_ERR("FSAGetStatFile(0x%08X, 0x%08X, 0x%08X) (%s) failed: %s",
DEBUG_FUNCTION_LINE_ERR("FSAGetStatFile(0x%08X, 0x%08X, %p) (%s) failed: %s",
deviceData->clientHandle, file->fd, &fsStat, file->fullPath, FSAGetStatusStr(status));
r->_errno = __fsa_translate_error(status);
return -1;
Expand Down
8 changes: 4 additions & 4 deletions source/devoptab/devoptab_fsa_open.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ int __fsa_open(struct _reent *r,
}
fd = -1;
} else {
DEBUG_FUNCTION_LINE_ERR("FSAOpenFileEx(0x%08X, %s, %s, 0x%X, 0x%08X, 0x%08X, 0x%08X) failed: %s",
DEBUG_FUNCTION_LINE_ERR("FSAOpenFileEx(0x%08X, %s, %s, 0x%X, 0x%08X, 0x%08X, %p) failed: %s",
deviceData->clientHandle, file->fullPath, "w", translatedMode, openFlags, preAllocSize, &fd,
FSAGetStatusStr(status));
r->_errno = __fsa_translate_error(status);
Expand All @@ -113,7 +113,7 @@ int __fsa_open(struct _reent *r,

status = FSAOpenFileEx(deviceData->clientHandle, file->fullPath, fsMode, translatedMode, openFlags, preAllocSize, &fd);
if (status < 0) {
DEBUG_FUNCTION_LINE_ERR("FSAOpenFileEx(0x%08X, %s, %s, 0x%X, 0x%08X, 0x%08X, 0x%08X) failed: %s",
DEBUG_FUNCTION_LINE_ERR("FSAOpenFileEx(0x%08X, %s, %s, 0x%X, 0x%08X, 0x%08X, %p) failed: %s",
deviceData->clientHandle, file->fullPath, fsMode, translatedMode, openFlags, preAllocSize, &fd,
FSAGetStatusStr(status));
r->_errno = __fsa_translate_error(status);
Expand All @@ -129,11 +129,11 @@ int __fsa_open(struct _reent *r,
FSAStat stat;
status = FSAGetStatFile(deviceData->clientHandle, fd, &stat);
if (status < 0) {
DEBUG_FUNCTION_LINE_ERR("FSAGetStatFile(0x%08X, 0x%08X, 0x%08X) (%s) failed: %s",
DEBUG_FUNCTION_LINE_ERR("FSAGetStatFile(0x%08X, 0x%08X, %p) (%s) failed: %s",
deviceData->clientHandle, fd, &stat, file->fullPath, FSAGetStatusStr(status));
r->_errno = __fsa_translate_error(status);
if (FSACloseFile(deviceData->clientHandle, fd) < 0) {
DEBUG_FUNCTION_LINE_ERR("FSACloseFile(0x%08X, 0x%08X) (%d) failed: %s",
DEBUG_FUNCTION_LINE_ERR("FSACloseFile(0x%08X, 0x%08X) (%s) failed: %s",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch :D

deviceData->clientHandle, fd, file->fullPath, FSAGetStatusStr(status));
}
return -1;
Expand Down
2 changes: 1 addition & 1 deletion source/devoptab/devoptab_fsa_read.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ ssize_t __fsa_read(struct _reent *r, void *fd, char *ptr, size_t len) {
status = FSAReadFile(deviceData->clientHandle, tmp, 1, size, file->fd, 0);

if (status < 0) {
DEBUG_FUNCTION_LINE_ERR("FSAReadFile(0x%08X, 0x%08X, 1, 0x%08X, 0x%08X, 0) (%s) failed: %s",
DEBUG_FUNCTION_LINE_ERR("FSAReadFile(0x%08X, %p, 1, 0x%08X, 0x%08X, 0) (%s) failed: %s",
deviceData->clientHandle, tmp, size, file->fd, file->fullPath, FSAGetStatusStr(status));
if (bytesRead != 0) {
return bytesRead; // error after partial read
Expand Down
2 changes: 1 addition & 1 deletion source/devoptab/devoptab_fsa_seek.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ off_t __fsa_seek(struct _reent *r,
case SEEK_END: { // Set position relative to the end of the file
status = FSAGetStatFile(deviceData->clientHandle, file->fd, &fsStat);
if (status < 0) {
DEBUG_FUNCTION_LINE_ERR("FSAGetStatFile(0x%08X, 0x%08X, 0x%08X) (%s) failed: %s",
DEBUG_FUNCTION_LINE_ERR("FSAGetStatFile(0x%08X, 0x%08X, %p) (%s) failed: %s",
deviceData->clientHandle, file->fd, &fsStat, file->fullPath, FSAGetStatusStr(status));
r->_errno = __fsa_translate_error(status);
return -1;
Expand Down
2 changes: 1 addition & 1 deletion source/devoptab/devoptab_fsa_stat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ int __fsa_stat(struct _reent *r,

status = FSAGetStat(deviceData->clientHandle, fixedPath, &fsStat);
if (status < 0) {
DEBUG_FUNCTION_LINE_ERR("FSAGetStat(0x%08X, %s, 0x%08X) failed: %s",
DEBUG_FUNCTION_LINE_ERR("FSAGetStat(0x%08X, %s, %p) failed: %s",
deviceData->clientHandle, fixedPath, &fsStat, FSAGetStatusStr(status));
free(fixedPath);
r->_errno = __fsa_translate_error(status);
Expand Down
2 changes: 1 addition & 1 deletion source/devoptab/devoptab_fsa_statvfs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ int __fsa_statvfs(struct _reent *r,

status = FSAGetFreeSpaceSize(deviceData->clientHandle, fixedPath, &freeSpace);
if (status < 0) {
DEBUG_FUNCTION_LINE_ERR("FSAGetFreeSpaceSize(0x%08X, %s, 0x%08X) failed: %s",
DEBUG_FUNCTION_LINE_ERR("FSAGetFreeSpaceSize(0x%08X, %s, %p) failed: %s",
deviceData->clientHandle, fixedPath, &freeSpace, FSAGetStatusStr(status));
free(fixedPath);
r->_errno = __fsa_translate_error(status);
Expand Down
2 changes: 1 addition & 1 deletion source/devoptab/devoptab_fsa_truncate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ int __fsa_ftruncate(struct _reent *r,
// Set the new file size
status = FSASetPosFile(deviceData->clientHandle, file->fd, len);
if (status < 0) {
DEBUG_FUNCTION_LINE_ERR("FSASetPosFile(0x%08X, 0x%08X, 0x%08X) failed: %s",
DEBUG_FUNCTION_LINE_ERR("FSASetPosFile(0x%08X, 0x%08X, 0x%08llX) failed: %s",
deviceData->clientHandle, file->fd, len, FSAGetStatusStr(status));
r->_errno = __fsa_translate_error(status);
return -1;
Expand Down
2 changes: 1 addition & 1 deletion source/devoptab/devoptab_fsa_write.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ ssize_t __fsa_write(struct _reent *r, void *fd, const char *ptr, size_t len) {

status = FSAWriteFile(deviceData->clientHandle, tmp, 1, size, file->fd, 0);
if (status < 0) {
DEBUG_FUNCTION_LINE_ERR("FSAWriteFile(0x%08X, 0x%08X, 1, 0x%08X, 0x%08X, 0) (%s) failed: %s",
DEBUG_FUNCTION_LINE_ERR("FSAWriteFile(0x%08X, %p, 1, 0x%08X, 0x%08X, 0) (%s) failed: %s",
deviceData->clientHandle, tmp, size, file->fd, file->fullPath, FSAGetStatusStr(status));
if (bytesWritten != 0) {
return bytesWritten; // error after partial write
Expand Down
8 changes: 4 additions & 4 deletions source/fsa.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,10 @@ FSError FSAEx_RawReadEx(int clientHandle, void *data, uint32_t size_bytes, uint3
if ((uint32_t) data & 0x3F) {
auto *alignedBuffer = memalign(0x40, ROUNDUP(size_bytes * cnt, 0x40));
if (!alignedBuffer) {
DEBUG_FUNCTION_LINE_ERR("Buffer not aligned (%08X).\n", data);
DEBUG_FUNCTION_LINE_ERR("Buffer not aligned (%p).\n", data);
return FS_ERROR_INVALID_ALIGNMENT;
}
DEBUG_FUNCTION_LINE_WARN("Buffer not aligned (%08X). Align to 0x40 for best performance\n", data);
DEBUG_FUNCTION_LINE_WARN("Buffer not aligned (%p). Align to 0x40 for best performance\n", data);
tmp = alignedBuffer;
}

Expand Down Expand Up @@ -162,10 +162,10 @@ FSError FSAEx_RawWriteEx(int clientHandle, const void *data, uint32_t size_bytes
if ((uint32_t) data & 0x3F) {
auto *alignedBuffer = memalign(0x40, ROUNDUP(size_bytes * cnt, 0x40));
if (!alignedBuffer) {
DEBUG_FUNCTION_LINE_ERR("Buffer not aligned (%08X).", data);
DEBUG_FUNCTION_LINE_ERR("Buffer not aligned (%p).", data);
return FS_ERROR_INVALID_ALIGNMENT;
}
DEBUG_FUNCTION_LINE_WARN("Buffer not aligned (%08X). Align to 0x40 for best performance", data);
DEBUG_FUNCTION_LINE_WARN("Buffer not aligned (%p). Align to 0x40 for best performance", data);
tmp = alignedBuffer;
memcpy(tmp, data, size_bytes * cnt);
}
Expand Down