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:
Tharo
2021-02-14 00:49:40 +00:00
committed by GitHub
parent d615ec4f31
commit f9d96d9f73
208 changed files with 1702 additions and 1846 deletions
+8 -6
View File
@@ -10,9 +10,9 @@ struct_800A9D40 D_8012A690 = { 0 };
void func_800A9D40(u32 addr, u8 handleType, u8 handleDomain, u8 handleLatency, u8 handlePageSize, u8 handleRelDuration,
u8 handlePulse, u32 handleSpeed) {
u32 int_disabled;
u32 prevInt;
OSPiHandle* handle = &D_8012A690.piHandle;
if ((u32)OS_PHYSICAL_TO_K1(addr) != (*handle).baseAddress) {
D_8012A690.piHandle.type = handleType;
(*handle).baseAddress = OS_PHYSICAL_TO_K1(addr);
@@ -23,10 +23,12 @@ void func_800A9D40(u32 addr, u8 handleType, u8 handleDomain, u8 handleLatency, u
D_8012A690.piHandle.domain = handleDomain;
D_8012A690.piHandle.speed = handleSpeed;
bzero(&D_8012A690.piHandle.transferInfo, sizeof(__OSTranxInfo));
int_disabled = __osDisableInt();
prevInt = __osDisableInt();
D_8012A690.piHandle.next = __osPiTable;
__osPiTable = &D_8012A690;
__osRestoreInt(int_disabled);
__osPiTable = &D_8012A690.piHandle;
__osRestoreInt(prevInt);
D_8012A690.ioMesg.hdr.pri = 0;
D_8012A690.ioMesg.hdr.retQueue = &D_8012A690.mesgQ;
D_8012A690.ioMesg.devAddr = addr;
@@ -40,7 +42,7 @@ void func_800A9E14(UNK_PTR dramAddr, size_t size, UNK_TYPE arg2) {
D_8012A690.ioMesg.dramAddr = dramAddr;
D_8012A690.ioMesg.size = size;
osWritebackDCache(dramAddr, size);
osEPiStartDma(&D_8012A690, &D_8012A690.ioMesg, arg2);
osEPiStartDma(&D_8012A690.piHandle, &D_8012A690.ioMesg, arg2);
osRecvMesg(&D_8012A690.mesgQ, &mesg, 1);
osInvalDCache(dramAddr, size);
}