diff options
| author | Tharo <17233964+Thar0@users.noreply.github.com> | 2021-02-14 00:49:40 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-02-13 19:49:40 -0500 |
| commit | f9d96d9f73ac090245a518ec04f3fa0e50655d1e (patch) | |
| tree | 9dc905fce276cbfb07a05fc2bf0883bcedddcf23 /src/libultra_boot_O2/vimgr.c | |
| parent | d615ec4f31563b939f8c0dce1c20c79e137c2043 (diff) | |
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>
Diffstat (limited to 'src/libultra_boot_O2/vimgr.c')
| -rw-r--r-- | src/libultra_boot_O2/vimgr.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/libultra_boot_O2/vimgr.c b/src/libultra_boot_O2/vimgr.c index 5525ec74f..c195bbf4c 100644 --- a/src/libultra_boot_O2/vimgr.c +++ b/src/libultra_boot_O2/vimgr.c @@ -22,9 +22,10 @@ u32 __additional_scanline = 0; void viMgrMain(void*); void osCreateViManager(OSPri pri) { - u32 int_disabled; + u32 prevInt; OSPri newPri; OSPri currentPri; + if (!__osViDevMgr.initialized) { __osTimerServicesInit(); __additional_scanline = 0; @@ -44,7 +45,7 @@ void osCreateViManager(OSPri pri) { osSetThreadPri(NULL, pri); } - int_disabled = __osDisableInt(); + prevInt = __osDisableInt(); __osViDevMgr.initialized = true; __osViDevMgr.mgrThread = &viThread; __osViDevMgr.cmdQueue = &viEventQueue; @@ -56,7 +57,7 @@ void osCreateViManager(OSPri pri) { osCreateThread(&viThread, 0, &viMgrMain, &__osViDevMgr, viThreadStack + sizeof(viThreadStack), pri); __osViInit(); osStartThread(&viThread); - __osRestoreInt(int_disabled); + __osRestoreInt(prevInt); if (newPri != -1) { osSetThreadPri(NULL, newPri); } @@ -68,9 +69,8 @@ void viMgrMain(void* vargs) { static u16 viRetrace; u32 addTime; viMesgStruct* mesg; - u32 temp; // always 0 + u32 temp = 0; // always 0 - temp = 0; mesg = NULL; viRetrace = __osViGetCurrentContext()->retraceCount; if (viRetrace == 0) { @@ -79,7 +79,7 @@ void viMgrMain(void* vargs) { args = (OSMgrArgs*)vargs; - while (1) { + while (true) { osRecvMesg(args->eventQueue, (OSMesg)&mesg, OS_MESG_BLOCK); switch (mesg->unk00) { case 13: @@ -107,9 +107,7 @@ void viMgrMain(void* vargs) { __osBaseCounter = osGetCount(); addTime = __osBaseCounter - addTime; __osCurrentTime = __osCurrentTime + addTime; - break; - case 14: __osTimerInterrupt(); break; |
