mirror of
https://github.com/zeldaret/oot.git
synced 2025-07-10 01:44:36 +00: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:
parent
d615ec4f31
commit
f9d96d9f73
208 changed files with 1702 additions and 1846 deletions
|
@ -8,7 +8,7 @@ s32 gSystemArenaLogSeverity = LOG_SEVERITY_NOLOG;
|
|||
Arena gSystemArena;
|
||||
|
||||
void SystemArena_CheckPointer(void* ptr, u32 size, const char* name, const char* action) {
|
||||
if (!ptr) {
|
||||
if (ptr == NULL) {
|
||||
if (gSystemArenaLogSeverity >= LOG_SEVERITY_ERROR) {
|
||||
// "%s: %u bytes %s failed\n"
|
||||
osSyncPrintf("%s: %u バイトの%sに失敗しました\n", name, size, action);
|
||||
|
@ -22,29 +22,29 @@ void SystemArena_CheckPointer(void* ptr, u32 size, const char* name, const char*
|
|||
}
|
||||
|
||||
void* SystemArena_Malloc(u32 size) {
|
||||
void* ptr;
|
||||
ptr = __osMalloc(&gSystemArena, size);
|
||||
void* ptr = __osMalloc(&gSystemArena, size);
|
||||
|
||||
SystemArena_CheckPointer(ptr, size, "malloc", "確保"); // Secure
|
||||
return ptr;
|
||||
}
|
||||
|
||||
void* SystemArena_MallocDebug(u32 size, const char* file, s32 line) {
|
||||
void* ptr;
|
||||
ptr = __osMallocDebug(&gSystemArena, size, file, line);
|
||||
void* ptr = __osMallocDebug(&gSystemArena, size, file, line);
|
||||
|
||||
SystemArena_CheckPointer(ptr, size, "malloc_DEBUG", "確保"); // Secure
|
||||
return ptr;
|
||||
}
|
||||
|
||||
void* SystemArena_MallocR(u32 size) {
|
||||
void* ptr;
|
||||
ptr = __osMallocR(&gSystemArena, size);
|
||||
void* ptr = __osMallocR(&gSystemArena, size);
|
||||
|
||||
SystemArena_CheckPointer(ptr, size, "malloc_r", "確保"); // Secure
|
||||
return ptr;
|
||||
}
|
||||
|
||||
void* SystemArena_MallocRDebug(u32 size, const char* file, s32 line) {
|
||||
void* ptr;
|
||||
ptr = __osMallocRDebug(&gSystemArena, size, file, line);
|
||||
void* ptr = __osMallocRDebug(&gSystemArena, size, file, line);
|
||||
|
||||
SystemArena_CheckPointer(ptr, size, "malloc_r_DEBUG", "確保"); // Secure
|
||||
return ptr;
|
||||
}
|
||||
|
@ -71,11 +71,10 @@ void SystemArena_FreeDebug(void* ptr, const char* file, s32 line) {
|
|||
|
||||
void* SystemArena_Calloc(u32 num, u32 size) {
|
||||
void* ret;
|
||||
u32 n;
|
||||
u32 n = num * size;
|
||||
|
||||
n = num * size;
|
||||
ret = __osMalloc(&gSystemArena, n);
|
||||
if (ret) {
|
||||
if (ret != NULL) {
|
||||
bzero(ret, n);
|
||||
}
|
||||
|
||||
|
@ -83,7 +82,7 @@ void* SystemArena_Calloc(u32 num, u32 size) {
|
|||
return ret;
|
||||
}
|
||||
|
||||
void SystemArena_Display() {
|
||||
void SystemArena_Display(void) {
|
||||
// System heap display
|
||||
osSyncPrintf("システムヒープ表示\n");
|
||||
__osDisplayArena(&gSystemArena);
|
||||
|
@ -93,7 +92,7 @@ void SystemArena_GetSizes(u32* outMaxFree, u32* outFree, u32* outAlloc) {
|
|||
ArenaImpl_GetSizes(&gSystemArena, outMaxFree, outFree, outAlloc);
|
||||
}
|
||||
|
||||
void SystemArena_Check() {
|
||||
void SystemArena_Check(void) {
|
||||
__osCheckArena(&gSystemArena);
|
||||
}
|
||||
|
||||
|
@ -102,11 +101,11 @@ void SystemArena_Init(void* start, u32 size) {
|
|||
__osMallocInit(&gSystemArena, start, size);
|
||||
}
|
||||
|
||||
void SystemArena_Cleanup() {
|
||||
void SystemArena_Cleanup(void) {
|
||||
gSystemArenaLogSeverity = LOG_SEVERITY_NOLOG;
|
||||
__osMallocCleanup(&gSystemArena);
|
||||
}
|
||||
|
||||
u8 SystemArena_IsInitalized() {
|
||||
u8 SystemArena_IsInitalized(void) {
|
||||
return __osMallocIsInitalized(&gSystemArena);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue