From 8d7cf2d19a01182bef2da86de630c09eb9c915fe Mon Sep 17 00:00:00 2001 From: tehzz Date: Thu, 29 Dec 2022 21:30:56 -0500 Subject: [PATCH] correct warnings --- src/crash_screen.c | 12 ++++++------ src/dma.c | 4 ++-- src/dp_intro.c | 24 ++++++++++++------------ 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/crash_screen.c b/src/crash_screen.c index f60b5fe..f950e66 100644 --- a/src/crash_screen.c +++ b/src/crash_screen.c @@ -7,7 +7,7 @@ #include "memmap.h" #include "controller.h" -extern u32 D_80068BA0[]; +extern void *D_80068BA0[]; CrashScreen gCrashScreen; @@ -186,7 +186,7 @@ void crash_screen_printf(s32 x, s32 y, const char *fmt, ...) { va_list args; va_start(args, fmt); - size = _Printf(crash_screen_copy_to_buf, buf, fmt, args); + size = _Printf(crash_screen_copy_to_buf, (char *)buf, fmt, args); if (size > 0) { ptr = buf; @@ -315,7 +315,7 @@ void crash_screen_draw(OSThread* faultedThread) { // all of these null terminators needed to pad the rodata section for this file // can potentially fix this problem in another way? - crash_screen_printf(210, 140, "MM:%08XH", *(u32*)ctx->pc); + crash_screen_printf(210, 140, "MM:%08XH", *(u32 *)(uintptr_t)ctx->pc); } OSThread* crash_screen_get_faulted_thread(void) { @@ -332,7 +332,7 @@ OSThread* crash_screen_get_faulted_thread(void) { return NULL; } -void crash_screen_thread_entry(void* unused) { +void crash_screen_thread_entry(UNUSED void* unused) { OSMesg mesg; OSThread* faultedThread; @@ -358,7 +358,7 @@ void crash_screen_set_draw_info(u16* frameBufPtr, u16 width, u16 height) { } void crash_screen_init(void) { - gCrashScreen.frameBuf = (u16*)((osMemSize | 0xA0000000) - ((SCREEN_WIDTH * SCREEN_HEIGHT) * 2)); + gCrashScreen.frameBuf = (u16*)(uintptr_t)((osMemSize | 0xA0000000) - ((SCREEN_WIDTH * SCREEN_HEIGHT) * 2)); gCrashScreen.width = SCREEN_WIDTH; gCrashScreen.height = 16; osCreateMesgQueue(&gCrashScreen.queue, &gCrashScreen.mesg, 1); @@ -376,7 +376,7 @@ void crash_screen_printf_with_bg(s16 x, s16 y, const char* fmt, ...) { va_start(args, fmt); - size = _Printf(crash_screen_copy_to_buf, buf, fmt, args); + size = _Printf(crash_screen_copy_to_buf, (char *)buf, fmt, args); if (size > 0) { crash_screen_draw_rect(x - 6, y - 6, (size + 2) * 6, 19); diff --git a/src/dma.c b/src/dma.c index c8bf7ff..682b59d 100644 --- a/src/dma.c +++ b/src/dma.c @@ -31,9 +31,9 @@ s32 func_80000F0C(s32 arg0, void *arg1, s32 arg2, s32 arg3, s32 arg4) { temp_v0 = func_80002FDC(0x2C); if (temp_v0 != NULL) { temp_v0->unk0 = 0xF4; - temp_v0->unk1C = arg1; + temp_v0->unk1C = (uintptr_t)arg1; temp_v0->unk24 = arg2; - temp_v0->unk20 = arg0; + temp_v0->unk20 = (void *)(uintptr_t)arg0; temp_v0->unk28 = arg3; func_80000E2C(temp_v0, arg4); } diff --git a/src/dp_intro.c b/src/dp_intro.c index 36a6b7b..52e111b 100644 --- a/src/dp_intro.c +++ b/src/dp_intro.c @@ -118,9 +118,9 @@ void func_80001380(struct UnkStruct80001380* arg0) { arg0->task.t.ucode_data = F3DEX2_data_bin; arg0->task.t.ucode_size = 0x1000; arg0->task.t.ucode_data_size = 0x800; - arg0->task.t.dram_stack = ALIGN16((u32)D_80084860); + arg0->task.t.dram_stack = (void *)ALIGN16((uintptr_t)D_80084860); arg0->task.t.dram_stack_size = 0x400; - arg0->task.t.yield_data_ptr = ALIGN16((u32)D_80084C68); + arg0->task.t.yield_data_ptr = (void *)ALIGN16((uintptr_t)D_80084C68); arg0->task.t.yield_data_size = 0xC00; arg0->task.t.output_buff = (D_80085870); arg0->task.t.output_buff_size = (D_80085870 + (0x20000/sizeof(u64))); @@ -128,7 +128,7 @@ void func_80001380(struct UnkStruct80001380* arg0) { } void func_80001444(struct UnkStruct80001380* arg0, struct UnkArray4* arg1, s32 arg2) { - arg0->task.t.data_ptr = arg1->unk4; + arg0->task.t.data_ptr = (void *)(uintptr_t)arg1->unk4; arg0->task.t.data_size = arg1->unk8; func_800053B4(arg0, arg2); } @@ -142,7 +142,7 @@ void func_80001474(s8 arg0, s8 arg1) { var_v0 = (arg0 * 2) + arg1 + 4; } - osViSetMode(&D_800796E0[D_80068B74[var_v0]]); + osViSetMode(&D_800796E0[(s32)D_80068B74[var_v0]]); osViSetSpecialFeatures(0x40U); osViSetSpecialFeatures(2U); osViSetSpecialFeatures(0x10U); @@ -194,7 +194,7 @@ void func_800015A8(void) { } while (D_80083CA0.unk1C8 > 0); } if (D_80083CA0.unkAA8 != NULL) { - osViSwapBuffer(D_80083CA0.unkAA8->unk8); + osViSwapBuffer((void *)(uintptr_t)D_80083CA0.unkAA8->unk8); osViRepeatLine(0); if ((D_80083CA0.unkA9D != D_80083CA0.unkAAD) || (D_80083CA0.unkA9E != D_80083CA0.unkAAE)) { func_80001474((s8) D_80083CA0.unkA9D, (s8) D_80083CA0.unkA9E); @@ -204,10 +204,10 @@ void func_800015A8(void) { } else { osViBlack(0U); } - crash_screen_set_draw_info(D_80083CA0.unkAA8->unk8, *(u16 *)&D_80083CA0.unkAA8->unk4, 0x10); + crash_screen_set_draw_info((void *)(uintptr_t)D_80083CA0.unkAA8->unk8, *(u16 *)&D_80083CA0.unkAA8->unk4, 0x10); } else { osViRepeatLine(1); - osViSwapBuffer(D_80083CA0.unk9E0->unk8); + osViSwapBuffer((void *)(uintptr_t)D_80083CA0.unk9E0->unk8); if ((D_80083CA0.unkA9D != D_80083CA0.unkAAD) || (D_80083CA0.unkA9E != D_80083CA0.unkAAE)) { func_80001474((s8) D_80083CA0.unkA9D, (s8) D_80083CA0.unkA9E); } @@ -231,7 +231,7 @@ void func_800017E4(void) { func_80004CF4(&D_80083CA0); } -void func_8000183C(void* arg) { +void func_8000183C(UNUSED void *arg) { __osSetFpcCsr(0x01000C01); func_80001C1C(&D_8008474C, 0, 1, 2, 0xFF, 0, 0, 0); func_80001C1C(&D_8008473C, 0, 1, 2, 0xFF, 0, 0, 0); @@ -276,25 +276,25 @@ void func_800019C8(void) { void func_80001AD4(u16 arg0) { s32 i = 0x280; - u16 *arr = D_80083CA0.unk9E0->unk8; + u16 *arr = (void *)(uintptr_t)D_80083CA0.unk9E0->unk8; while(i --> 0) { *(arr)++ = arg0; } - osWritebackDCache(D_80083CA0.unk9E0->unk8, 0x500); + osWritebackDCache((void *)(uintptr_t)D_80083CA0.unk9E0->unk8, 0x500); } u16 func_80001B2C(void) { // YIKES. What is this typing?!? - u16 *ptr = (u16*)((u32*)D_80084680[0])[2]; + u16 *ptr = (u16*)(uintptr_t)((u32 *)(uintptr_t)D_80084680[0])[2]; return *ptr; } s32 func_80001B40(void) { s32 result = 0; - if (osViGetCurrentFramebuffer() == (void*)((u32*)D_80084680[0])[2]) + if (osViGetCurrentFramebuffer() == ((void **)(uintptr_t)D_80084680[0])[2]) result = 1; return result;