mirror of
https://github.com/zeldaret/oot
synced 2026-06-06 03:38:24 -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:
@@ -13,10 +13,9 @@ void GameAlloc_Log(GameAlloc* this) {
|
||||
}
|
||||
|
||||
void* GameAlloc_MallocDebug(GameAlloc* this, u32 size, const char* file, s32 line) {
|
||||
GameAllocEntry* ptr;
|
||||
GameAllocEntry* ptr = SystemArena_MallocDebug(size + sizeof(GameAllocEntry), file, line);
|
||||
|
||||
ptr = SystemArena_MallocDebug(size + sizeof(GameAllocEntry), file, line);
|
||||
if (ptr) {
|
||||
if (ptr != NULL) {
|
||||
ptr->size = size;
|
||||
ptr->prev = this->head;
|
||||
this->head->next = ptr;
|
||||
@@ -30,10 +29,9 @@ void* GameAlloc_MallocDebug(GameAlloc* this, u32 size, const char* file, s32 lin
|
||||
}
|
||||
|
||||
void* GameAlloc_Malloc(GameAlloc* this, u32 size) {
|
||||
GameAllocEntry* ptr;
|
||||
GameAllocEntry* ptr = SystemArena_MallocDebug(size + sizeof(GameAllocEntry), "../gamealloc.c", 93);
|
||||
|
||||
ptr = SystemArena_MallocDebug(size + sizeof(GameAllocEntry), "../gamealloc.c", 93);
|
||||
if (ptr) {
|
||||
if (ptr != NULL) {
|
||||
ptr->size = size;
|
||||
ptr->prev = this->head;
|
||||
this->head->next = ptr;
|
||||
@@ -49,7 +47,7 @@ void* GameAlloc_Malloc(GameAlloc* this, u32 size) {
|
||||
void GameAlloc_Free(GameAlloc* this, void* data) {
|
||||
GameAllocEntry* ptr;
|
||||
|
||||
if (data) {
|
||||
if (data != NULL) {
|
||||
ptr = &((GameAllocEntry*)data)[-1];
|
||||
LogUtils_CheckNullPointer("ptr->prev", ptr->prev, "../gamealloc.c", 120);
|
||||
LogUtils_CheckNullPointer("ptr->next", ptr->next, "../gamealloc.c", 121);
|
||||
@@ -61,10 +59,9 @@ void GameAlloc_Free(GameAlloc* this, void* data) {
|
||||
}
|
||||
|
||||
void GameAlloc_Cleanup(GameAlloc* this) {
|
||||
GameAllocEntry* next;
|
||||
GameAllocEntry* next = this->base.next;
|
||||
GameAllocEntry* cur;
|
||||
|
||||
next = this->base.next;
|
||||
while (&this->base != next) {
|
||||
cur = next;
|
||||
next = next->next;
|
||||
|
||||
Reference in New Issue
Block a user