mirror of
https://github.com/zeldaret/oot
synced 2026-05-23 23:05:31 -04:00
Fix most compiler warnings in the boot and code segments (#674)
* Less warnings in boot & code segments * few more warnings gone * Ran formatter * z_view warning gone * -> 1 * f31 -> 31 * Remove function casts * Few more small improvements * Separate declaration and assignment in func_80091738 and Item_Give Co-authored-by: Thar0 <maximilianc64@gmail.com>
This commit is contained in:
+15
-16
@@ -8,7 +8,7 @@ s32 gDebugArenaLogSeverity = LOG_SEVERITY_ERROR;
|
||||
Arena sDebugArena;
|
||||
|
||||
void DebugArena_CheckPointer(void* ptr, u32 size, const char* name, const char* action) {
|
||||
if (!ptr) {
|
||||
if (ptr == NULL) {
|
||||
if (gDebugArenaLogSeverity >= LOG_SEVERITY_ERROR) {
|
||||
// "%s: %u bytes %s failed\n"
|
||||
osSyncPrintf("%s: %u バイトの%sに失敗しました\n", name, size, action);
|
||||
@@ -22,29 +22,29 @@ void DebugArena_CheckPointer(void* ptr, u32 size, const char* name, const char*
|
||||
}
|
||||
|
||||
void* DebugArena_Malloc(u32 size) {
|
||||
void* ptr;
|
||||
ptr = __osMalloc(&sDebugArena, size);
|
||||
void* ptr = __osMalloc(&sDebugArena, size);
|
||||
|
||||
DebugArena_CheckPointer(ptr, size, "debug_malloc", "確保"); // Secure
|
||||
return ptr;
|
||||
}
|
||||
|
||||
void* DebugArena_MallocDebug(u32 size, const char* file, s32 line) {
|
||||
void* ptr;
|
||||
ptr = __osMallocDebug(&sDebugArena, size, file, line);
|
||||
void* ptr = __osMallocDebug(&sDebugArena, size, file, line);
|
||||
|
||||
DebugArena_CheckPointer(ptr, size, "debug_malloc_DEBUG", "確保"); // Secure
|
||||
return ptr;
|
||||
}
|
||||
|
||||
void* DebugArena_MallocR(u32 size) {
|
||||
void* ptr;
|
||||
ptr = __osMallocR(&sDebugArena, size);
|
||||
void* ptr = __osMallocR(&sDebugArena, size);
|
||||
|
||||
DebugArena_CheckPointer(ptr, size, "debug_malloc_r", "確保"); // Secure
|
||||
return ptr;
|
||||
}
|
||||
|
||||
void* DebugArena_MallocRDebug(u32 size, const char* file, s32 line) {
|
||||
void* ptr;
|
||||
ptr = __osMallocRDebug(&sDebugArena, size, file, line);
|
||||
void* ptr = __osMallocRDebug(&sDebugArena, size, file, line);
|
||||
|
||||
DebugArena_CheckPointer(ptr, size, "debug_malloc_r_DEBUG", "確保"); // Secure
|
||||
return ptr;
|
||||
}
|
||||
@@ -71,11 +71,10 @@ void DebugArena_FreeDebug(void* ptr, const char* file, s32 line) {
|
||||
|
||||
void* DebugArena_Calloc(u32 num, u32 size) {
|
||||
void* ret;
|
||||
u32 n;
|
||||
u32 n = num * size;
|
||||
|
||||
n = num * size;
|
||||
ret = __osMalloc(&sDebugArena, n);
|
||||
if (ret) {
|
||||
if (ret != NULL) {
|
||||
bzero(ret, n);
|
||||
}
|
||||
|
||||
@@ -83,7 +82,7 @@ void* DebugArena_Calloc(u32 num, u32 size) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
void DebugArena_Display() {
|
||||
void DebugArena_Display(void) {
|
||||
// Zelda heap display (devs forgot to change "Zelda" to "Debug" apparently)
|
||||
osSyncPrintf("ゼルダヒープ表示\n");
|
||||
__osDisplayArena(&sDebugArena);
|
||||
@@ -93,7 +92,7 @@ void DebugArena_GetSizes(u32* outMaxFree, u32* outFree, u32* outAlloc) {
|
||||
ArenaImpl_GetSizes(&sDebugArena, outMaxFree, outFree, outAlloc);
|
||||
}
|
||||
|
||||
void DebugArena_Check() {
|
||||
void DebugArena_Check(void) {
|
||||
__osCheckArena(&sDebugArena);
|
||||
}
|
||||
|
||||
@@ -102,11 +101,11 @@ void DebugArena_Init(void* start, u32 size) {
|
||||
__osMallocInit(&sDebugArena, start, size);
|
||||
}
|
||||
|
||||
void DebugArena_Cleanup() {
|
||||
void DebugArena_Cleanup(void) {
|
||||
gDebugArenaLogSeverity = LOG_SEVERITY_NOLOG;
|
||||
__osMallocCleanup(&sDebugArena);
|
||||
}
|
||||
|
||||
u8 DebugArena_IsInitalized() {
|
||||
u8 DebugArena_IsInitalized(void) {
|
||||
return __osMallocIsInitalized(&sDebugArena);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user