From 2bb0fa08cf4ad11c7df971c4d09716f9eaeb9893 Mon Sep 17 00:00:00 2001 From: Alejandro Javier Asenjo Nitti Date: Wed, 18 Oct 2023 10:50:51 -0300 Subject: [PATCH] format style change: SpaceAfterCStyleCast: true --- .clang-format | 2 +- src/libultra/io/controller.c | 8 ++++---- src/libultra/io/pidma.c | 2 +- src/libultra/libc/string.c | 6 +++--- src/main/5A20.c | 8 ++++---- src/main/7B20.c | 2 +- src/main/hud.c | 4 ++-- src/overlays/segment_DF4260/DF4260.c | 2 +- 8 files changed, 17 insertions(+), 17 deletions(-) diff --git a/.clang-format b/.clang-format index d4450a21..8cb9c0d4 100644 --- a/.clang-format +++ b/.clang-format @@ -4,7 +4,7 @@ UseTab: Never ColumnLimit: 120 PointerAlignment: Left BreakBeforeBraces: Attach -SpaceAfterCStyleCast: false +SpaceAfterCStyleCast: true Cpp11BracedListStyle: false IndentCaseLabels: true BinPackArguments: true diff --git a/src/libultra/io/controller.c b/src/libultra/io/controller.c index 90bf1169..5c7e9fcb 100644 --- a/src/libultra/io/controller.c +++ b/src/libultra/io/controller.c @@ -45,9 +45,9 @@ void __osContGetInitData(u8* pattern, OSContStatus* data) { u8 bits; bits = 0; - ptr = (u8*)__osContPifRam.ramarray; + ptr = (u8*) __osContPifRam.ramarray; for (i = 0; i < __osMaxControllers; i++, ptr += sizeof(requestHeader), data++) { - requestHeader = *(__OSContRequestHeader*)ptr; + requestHeader = *(__OSContRequestHeader*) ptr; data->errno = (requestHeader.rxsize & 0xC0) >> 4; if (data->errno == 0) { data->type = requestHeader.typel << 8 | requestHeader.typeh; @@ -69,7 +69,7 @@ void __osPackRequestData(u8 poll) { } __osContPifRam.pifstatus = CONT_CMD_READ_BUTTON; - ptr = (u8*)__osContPifRam.ramarray; + ptr = (u8*) __osContPifRam.ramarray; requestHeader.align = 255; requestHeader.txsize = 1; requestHeader.rxsize = 3; @@ -80,7 +80,7 @@ void __osPackRequestData(u8 poll) { requestHeader.align1 = 255; for (i = 0; i < __osMaxControllers; i++) { - *(__OSContRequestHeader*)ptr = requestHeader; + *(__OSContRequestHeader*) ptr = requestHeader; ptr += sizeof(requestHeader); } *ptr = 254; diff --git a/src/libultra/io/pidma.c b/src/libultra/io/pidma.c index 78f971f1..23bddae3 100644 --- a/src/libultra/io/pidma.c +++ b/src/libultra/io/pidma.c @@ -28,7 +28,7 @@ s32 osPiStartDma(test* arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s arg0->unk0 = 0xC; } - arg0->unk2 = (s8)arg1; + arg0->unk2 = (s8) arg1; arg0->unk4 = arg6; arg0->unk8 = arg4; arg0->unkC = arg3; diff --git a/src/libultra/libc/string.c b/src/libultra/libc/string.c index f35bb375..750d8ec5 100644 --- a/src/libultra/libc/string.c +++ b/src/libultra/libc/string.c @@ -1,8 +1,8 @@ #include "global.h" void* memcpy(void* s1, const void* s2, size_t n) { - unsigned char* su1 = (unsigned char*)s1; - const unsigned char* su2 = (const unsigned char*)s2; + unsigned char* su1 = (unsigned char*) s1; + const unsigned char* su2 = (const unsigned char*) s2; while (n > 0) { *su1 = *su2; @@ -21,7 +21,7 @@ size_t strlen(const char* s) { sc++; } - return (size_t)(sc - s); + return (size_t) (sc - s); } const char* strchr(const char* s, int c) { diff --git a/src/main/5A20.c b/src/main/5A20.c index 5d188491..6e9a5db6 100644 --- a/src/main/5A20.c +++ b/src/main/5A20.c @@ -18,13 +18,13 @@ extern f32 func_8001FBE8(f32); extern u64 osGetTime(void); f32 func_80004E20(f32 arg0, f32 arg1) { - return arg0 - ((s32)(arg0 / arg1) * arg1); + return arg0 - ((s32) (arg0 / arg1) * arg1); } void func_80004E4C(void) { - D_8013B3A4 = (s32)osGetTime() % 30000; - D_8013B3A8 = (s32)osGetTime() % 30000; - D_8013B3AC = (s32)osGetTime() % 30000; + D_8013B3A4 = (s32) osGetTime() % 30000; + D_8013B3A8 = (s32) osGetTime() % 30000; + D_8013B3AC = (s32) osGetTime() % 30000; } #pragma GLOBAL_ASM("asm/us/nonmatchings/main/5A20/func_80004EB0.s") diff --git a/src/main/7B20.c b/src/main/7B20.c index 8786e003..c42a0bf7 100644 --- a/src/main/7B20.c +++ b/src/main/7B20.c @@ -12,7 +12,7 @@ extern s32 D_8013C3D0; extern s32 D_80144BD0; void func_80006F20(void) { - D_80144BD0 = (s32)&D_8013C3D0; + D_80144BD0 = (s32) &D_8013C3D0; } s32 func_80006F38(s32 arg0) { diff --git a/src/main/hud.c b/src/main/hud.c index 5a537e37..09a2a70e 100644 --- a/src/main/hud.c +++ b/src/main/hud.c @@ -254,7 +254,7 @@ s32 func_8008BCBC(s32 arg0) { s32 ret; if (arg0 < 0) { - arg0 = (s64)-arg0; + arg0 = (s64) -arg0; } ret = 1; @@ -430,7 +430,7 @@ void func_80095350(UnkStruct_func_80095350* arg0) { arg0->unk0 = 2; arg0->unk2 = 0xC3; arg0->unkB6 = 0x270F; - func_800612B8((s32*)arg0 + 7, arg0->unk2, arg0); + func_800612B8((s32*) arg0 + 7, arg0->unk2, arg0); } #pragma GLOBAL_ASM("asm/us/nonmatchings/main/hud/func_800953A0.s") diff --git a/src/overlays/segment_DF4260/DF4260.c b/src/overlays/segment_DF4260/DF4260.c index 361e8877..a4afa037 100644 --- a/src/overlays/segment_DF4260/DF4260.c +++ b/src/overlays/segment_DF4260/DF4260.c @@ -28,7 +28,7 @@ void func_80187530_DF4270(s32 arg0) { #pragma GLOBAL_ASM("asm/us/nonmatchings/overlays/segment_DF4260/DF4260/func_80187A38_DF4778.s") f32 func_80187A88_DF47C8(s32 arg0) { - f32 ret = (f32)arg0 * 0.5f; + f32 ret = (f32) arg0 * 0.5f; if (ret > 8.0f) { ret = 8.0f;