Skip to content

Commit 35324be

Browse files
committed
Fix compiling with latest wut version
1 parent bac71e8 commit 35324be

6 files changed

Lines changed: 23 additions & 23 deletions

File tree

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ INCLUDES := src
2929
#-------------------------------------------------------------------------------
3030
# options for code generation
3131
#-------------------------------------------------------------------------------
32-
CFLAGS := -Wall -Wextra -Os -ffunction-sections\
32+
CFLAGS := -Wall -Werror -Wextra -Os -ffunction-sections\
3333
$(MACHDEP)
3434

3535
CFLAGS += $(INCLUDE) -D__WIIU__ -D__WUT__

src/FSWrapper.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ FSError FSWrapper::FSReadDirWrapper(const FSDirectoryHandle handle, FSDirectoryE
7575
DIR *dir = dirHandle->dir;
7676

7777
FSError result = FS_ERROR_END_OF_DIR;
78-
DEBUG_FUNCTION_LINE_VERBOSE("[%s] readdir %08X (handle %08X)", getName().c_str(), dir, handle);
78+
DEBUG_FUNCTION_LINE_VERBOSE("[%s] readdir %p (handle %08X)", getName().c_str(), dir, handle);
7979
do {
8080
errno = 0;
8181
struct dirent *entry_ = readdir(dir);
@@ -128,7 +128,7 @@ FSError FSWrapper::FSReadDirWrapper(const FSDirectoryHandle handle, FSDirectoryE
128128
} else {
129129
auto err = errno;
130130
if (err != 0) {
131-
DEBUG_FUNCTION_LINE_ERR("[%s] Failed to read dir %08X (handle %08X). errno %d (%s)", getName().c_str(), dir, handle, err, strerror(err));
131+
DEBUG_FUNCTION_LINE_ERR("[%s] Failed to read dir %p (handle %08X). errno %d (%s)", getName().c_str(), dir, handle, err, strerror(err));
132132
result = FS_ERROR_MEDIA_ERROR;
133133
}
134134
}
@@ -146,9 +146,9 @@ FSError FSWrapper::FSCloseDirWrapper(const FSDirectoryHandle handle) {
146146
DIR *dir = dirHandle->dir;
147147

148148
FSError result = FS_ERROR_OK;
149-
DEBUG_FUNCTION_LINE_VERBOSE("[%s] closedir %08X (handle %08X)", getName().c_str(), dir, handle);
149+
DEBUG_FUNCTION_LINE_VERBOSE("[%s] closedir %p (handle %08X)", getName().c_str(), dir, handle);
150150
if (closedir(dir) < 0) {
151-
DEBUG_FUNCTION_LINE_ERR("[%s] Failed to close dir %08X (handle %08X)", getName().c_str(), dir, handle);
151+
DEBUG_FUNCTION_LINE_ERR("[%s] Failed to close dir %p (handle %08X)", getName().c_str(), dir, handle);
152152
result = FS_ERROR_MEDIA_ERROR;
153153
}
154154
dirHandle->dir = nullptr;
@@ -164,7 +164,7 @@ FSError FSWrapper::FSRewindDirWrapper(const FSDirectoryHandle handle) {
164164

165165
DIR *dir = dirHandle->dir;
166166

167-
DEBUG_FUNCTION_LINE_VERBOSE("[%s] rewinddir %08X (handle %08X)", getName().c_str(), dir, handle);
167+
DEBUG_FUNCTION_LINE_VERBOSE("[%s] rewinddir %p (handle %08X)", getName().c_str(), dir, handle);
168168
rewinddir(dir);
169169

170170
return FS_ERROR_OK;
@@ -397,7 +397,7 @@ FSError FSWrapper::FSReadFileWrapper(void *buffer, const uint32_t size, const ui
397397
auto fileHandle = getFileFromHandle(handle);
398398
int real_fd = fileHandle->fd;
399399

400-
DEBUG_FUNCTION_LINE_VERBOSE("[%s] Read %u bytes of fd %08X (FSFileHandle %08X) to buffer %08X", getName().c_str(), size * count, real_fd, handle, buffer);
400+
DEBUG_FUNCTION_LINE_VERBOSE("[%s] Read %u bytes of fd %08X (FSFileHandle %08X) to buffer %p", getName().c_str(), size * count, real_fd, handle, buffer);
401401
int64_t read = readIntoBuffer(real_fd, buffer, size, count);
402402

403403
FSError result;
@@ -468,7 +468,7 @@ FSError FSWrapper::FSGetPosFileWrapper(const FSFileHandle handle, uint32_t *pos)
468468
DEBUG_FUNCTION_LINE_VERBOSE("[%s] lseek fd %08X (FSFileHandle %08X) to get current position for truncation", getName().c_str(), real_fd, handle);
469469
off_t currentPos = lseek(real_fd, (off_t) 0, SEEK_CUR);
470470
if (currentPos == -1) {
471-
DEBUG_FUNCTION_LINE_ERR("[%s] Failed to get current position (res: %lld) of fd (handle %08X) to check EoF", getName().c_str(), currentPos, real_fd, handle);
471+
DEBUG_FUNCTION_LINE_ERR("[%s] Failed to get current position (res: %lld) of fd %08X (handle %08X) to check EoF", getName().c_str(), currentPos, real_fd, handle);
472472
result = FS_ERROR_MEDIA_ERROR;
473473
} else {
474474
*pos = currentPos;
@@ -493,7 +493,7 @@ FSError FSWrapper::FSIsEofWrapper(const FSFileHandle handle) {
493493

494494
if (currentPos == -1 || endPos == -1) {
495495
// TODO: check errno
496-
DEBUG_FUNCTION_LINE_ERR("[%s] Failed to get current position (res: %lld) or endPos (res: %lld) of fd (handle %08X) to check EoF", getName().c_str(), currentPos, endPos, real_fd, handle);
496+
DEBUG_FUNCTION_LINE_ERR("[%s] Failed to get current position (res: %lld) or endPos (res: %lld) of fd %08X (handle %08X) to check EoF", getName().c_str(), currentPos, endPos, real_fd, handle);
497497
result = FS_ERROR_MEDIA_ERROR;
498498
} else if (currentPos == endPos) {
499499
DEBUG_FUNCTION_LINE_VERBOSE("[%s] FSIsEof END for %d\n", getName().c_str(), real_fd);
@@ -512,7 +512,7 @@ FSError FSWrapper::FSTruncateFileWrapper(const FSFileHandle handle) {
512512
return FS_ERROR_FORCE_PARENT_LAYER;
513513
}
514514

515-
if (!pIsWriteable) {
515+
if (pIsWriteable) {
516516
DEBUG_FUNCTION_LINE_VERBOSE("[%s] Tried to truncate fd %d (handle %08X) but layer is not writeable", getName().c_str(), getFileFromHandle(handle)->fd, handle);
517517
return FS_ERROR_ACCESS_ERROR;
518518
}
@@ -527,7 +527,7 @@ FSError FSWrapper::FSTruncateFileWrapper(const FSFileHandle handle) {
527527
off_t currentPos = lseek(real_fd, (off_t) 0, SEEK_CUR);
528528
if (currentPos == -1) {
529529
// TODO check errno
530-
DEBUG_FUNCTION_LINE_ERR("[%s] Failed to get current position of fd (handle %08X) to truncate file", getName().c_str(), real_fd, handle);
530+
DEBUG_FUNCTION_LINE_ERR("[%s] Failed to get current position of fd %08X (handle %08X) to truncate file", getName().c_str(), real_fd, handle);
531531
result = FS_ERROR_MEDIA_ERROR;
532532
} else {
533533
DEBUG_FUNCTION_LINE_VERBOSE("[%s] Truncate fd %08X (FSFileHandle %08X) to %lld bytes ", getName().c_str(), real_fd, handle, currentPos);
@@ -554,11 +554,11 @@ FSError FSWrapper::FSWriteFileWrapper(const uint8_t *buffer, const uint32_t size
554554

555555
int real_fd = fileHandle->fd;
556556

557-
DEBUG_FUNCTION_LINE_VERBOSE("[%s] Write %u bytes to fd %08X (FSFileHandle %08X) from buffer %08X", getName().c_str(), count * size, real_fd, handle, buffer);
557+
DEBUG_FUNCTION_LINE_VERBOSE("[%s] Write %u bytes to fd %08X (FSFileHandle %08X) from buffer %p", getName().c_str(), count * size, real_fd, handle, buffer);
558558
auto writeRes = writeFromBuffer(real_fd, buffer, size, count);
559559
if (writeRes < 0) {
560560
auto err = errno;
561-
DEBUG_FUNCTION_LINE_ERR("[%s] Write failed %u bytes to fd %08X (FSFileHandle %08X) from buffer %08X errno %d", getName().c_str(), count * size, real_fd, handle, buffer, err);
561+
DEBUG_FUNCTION_LINE_ERR("[%s] Write failed %u bytes to fd %08X (FSFileHandle %08X) from buffer %p errno %d", getName().c_str(), count * size, real_fd, handle, buffer, err);
562562
if (err == EFBIG) {
563563
result = FS_ERROR_FILE_TOO_BIG;
564564
} else if (err == EACCES) {
@@ -640,7 +640,7 @@ FSError FSWrapper::FSFlushFileWrapper(const FSFileHandle handle) {
640640
const auto fileHandle = getFileFromHandle(handle);
641641
const int real_fd = fileHandle->fd;
642642

643-
DEBUG_FUNCTION_LINE_VERBOSE("[%s] fsync fd %08X (FSFileHandle %08X)", real_fd, handle);
643+
DEBUG_FUNCTION_LINE_VERBOSE("[%s] fsync fd %08X (FSFileHandle %08X)", getName().c_str(), real_fd, handle);
644644
FSError result = FS_ERROR_OK;
645645
if (fsync(real_fd) < 0) {
646646
DEBUG_FUNCTION_LINE_ERR("[%s] fsync failed for fd %08X (FSFileHandle %08X)", getName().c_str(), real_fd, handle);

src/FSWrapperMergeDirsWithParent.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ FSError FSWrapperMergeDirsWithParent::FSReadDirWrapper(FSADirectoryHandle handle
6868
if (dirHandle->readResultCapacity == 0) {
6969
dirHandle->readResult = (FSDirectoryEntryEx *) malloc(sizeof(FSDirectoryEntryEx));
7070
if (dirHandle->readResult == nullptr) {
71-
DEBUG_FUNCTION_LINE_ERR("[%s] Failed to alloc memory for %08X (handle %08X)", getName().c_str(), dirHandle.get(), handle);
71+
DEBUG_FUNCTION_LINE_ERR("[%s] Failed to alloc memory for %p (handle %08X)", getName().c_str(), dirHandle.get(), handle);
7272
OSFatal("ContentRedirectionModule: Failed to alloc memory for read result");
7373
}
7474
dirHandle->readResultCapacity = 1;
@@ -79,7 +79,7 @@ FSError FSWrapperMergeDirsWithParent::FSReadDirWrapper(FSADirectoryHandle handle
7979
dirHandle->readResult = (FSDirectoryEntryEx *) realloc(dirHandle->readResult, newCapacity * sizeof(FSDirectoryEntryEx));
8080
dirHandle->readResultCapacity = newCapacity;
8181
if (dirHandle->readResult == nullptr) {
82-
DEBUG_FUNCTION_LINE_ERR("[%s] Failed to realloc memory for %08X (handle %08X)", getName().c_str(), dirHandle.get(), handle);
82+
DEBUG_FUNCTION_LINE_ERR("[%s] Failed to realloc memory for %p (handle %08X)", getName().c_str(), dirHandle.get(), handle);
8383
OSFatal("ContentRedirectionModule: Failed to alloc memory for read result");
8484
}
8585
}
@@ -242,7 +242,7 @@ FSWrapperMergeDirsWithParent::~FSWrapperMergeDirsWithParent() {
242242
if (mClientHandle) {
243243
FSError res;
244244
if ((res = FSADelClient(mClientHandle)) != FS_ERROR_OK) {
245-
DEBUG_FUNCTION_LINE_ERR("[%s] FSADelClient failed: %s (%d)", FSAGetStatusStr(res), res);
245+
DEBUG_FUNCTION_LINE_ERR("[%s] FSADelClient failed: %s (%d)", pName.c_str(), FSAGetStatusStr(res), res);
246246
}
247247
mClientHandle = 0;
248248
}

src/FSWrapperReplaceSingleFile.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ FSWrapperReplaceSingleFile::FSWrapperReplaceSingleFile(const std::string &name,
4141
FSWrapperReplaceSingleFile::~FSWrapperReplaceSingleFile() {
4242
if (mClientHandle) {
4343
if (const FSError res = FSADelClient(mClientHandle); res != FS_ERROR_OK) {
44-
DEBUG_FUNCTION_LINE_ERR("[%s] FSADelClient failed: %s (%d)", FSAGetStatusStr(res), res);
44+
DEBUG_FUNCTION_LINE_ERR("[%s] FSADelClient failed: %s (%d)", pName.c_str(), FSAGetStatusStr(res), res);
4545
}
4646
mClientHandle = 0;
4747
}

src/FileUtils.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -209,10 +209,10 @@ FSError doForLayer(FSShimWrapper *param) {
209209

210210
auto *request = &param->shim->request.readFile;
211211
if (request->readFlags == FSA_READ_FLAG_NONE) {
212-
DEBUG_FUNCTION_LINE_VERBOSE("[%s] ReadFile: buffer %08X size %08X count %08X handle %08X", layer->getName().c_str(), request->buffer, request->size, request->count, request->handle);
212+
DEBUG_FUNCTION_LINE_VERBOSE("[%s] ReadFile: buffer %p size %08X count %08X handle %08X", layer->getName().c_str(), request->buffer, request->size, request->count, request->handle);
213213
layerResult = layer->FSReadFileWrapper(request->buffer, request->size, request->count, request->handle, 0);
214214
} else if (request->readFlags == FSA_READ_FLAG_READ_WITH_POS) {
215-
DEBUG_FUNCTION_LINE_VERBOSE("[%s] ReadFileWithPos: buffer %08X size %08X count %08X pos %08X handle %08X", layer->getName().c_str(), request->buffer, request->size, request->count, request->pos, request->handle);
215+
DEBUG_FUNCTION_LINE_VERBOSE("[%s] ReadFileWithPos: buffer %p size %08X count %08X pos %08X handle %08X", layer->getName().c_str(), request->buffer, request->size, request->count, request->pos, request->handle);
216216
layerResult = layer->FSReadFileWithPosWrapper(request->buffer, request->size, request->count, request->pos, request->handle, 0);
217217
}
218218
break;
@@ -250,10 +250,10 @@ FSError doForLayer(FSShimWrapper *param) {
250250

251251
auto *request = &param->shim->request.writeFile;
252252
if (request->writeFlags == FSA_WRITE_FLAG_NONE) {
253-
DEBUG_FUNCTION_LINE_VERBOSE("[%s] WriteFile: buffer %08X size %08X count %08X handle %08X", layer->getName().c_str(), request->buffer, request->size, request->count, request->handle);
253+
DEBUG_FUNCTION_LINE_VERBOSE("[%s] WriteFile: buffer %p size %08X count %08X handle %08X", layer->getName().c_str(), request->buffer, request->size, request->count, request->handle);
254254
layerResult = layer->FSWriteFileWrapper(request->buffer, request->size, request->count, request->handle, 0);
255255
} else if (request->writeFlags == FSA_WRITE_FLAG_READ_WITH_POS) {
256-
DEBUG_FUNCTION_LINE_VERBOSE("[%s] WriteFileWithPos: buffer %08X size %08X count %08X pos %08X handle %08X", layer->getName().c_str(), request->buffer, request->size, request->count, request->pos, request->handle);
256+
DEBUG_FUNCTION_LINE_VERBOSE("[%s] WriteFileWithPos: buffer %p size %08X count %08X pos %08X handle %08X", layer->getName().c_str(), request->buffer, request->size, request->count, request->pos, request->handle);
257257
layerResult = layer->FSWriteFileWithPosWrapper(request->buffer, request->size, request->count, request->pos, request->handle, 0);
258258
}
259259
break;

src/utils/utils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ void dumpHex(const void *data, size_t size) {
1212
char ascii[17];
1313
size_t i, j;
1414
ascii[16] = '\0';
15-
DEBUG_FUNCTION_LINE("0x%08X (0x0000): ", data);
15+
DEBUG_FUNCTION_LINE("0x%p (0x0000): ", data);
1616
for (i = 0; i < size; ++i) {
1717
WHBLogWritef("%02X ", ((unsigned char *) data)[i]);
1818
if (((unsigned char *) data)[i] >= ' ' && ((unsigned char *) data)[i] <= '~') {

0 commit comments

Comments
 (0)