Remove some // clang-format off with a for loop "trick"

This commit is contained in:
Dragorn421 2022-04-09 12:36:31 +02:00
parent 6b4001ef82
commit 30c344b800
No known key found for this signature in database
GPG Key ID: 8ACAE4BA399BD6B0
5 changed files with 5 additions and 15 deletions

View File

@ -3,9 +3,7 @@
void Lib_MemSet(u8* dest, size_t size, u8 val) { void Lib_MemSet(u8* dest, size_t size, u8 val) {
u32 i; u32 i;
// clang-format off for (i = 0; i < size; i++, *dest++ = val) {}
for (i = 0; i < size; i++) { *dest++ = val; }
// clang-format on
} }
f32 Math_CosS(s16 angle) { f32 Math_CosS(s16 angle) {

View File

@ -4,9 +4,7 @@ void SoundSource_InitAll(GlobalContext* globalCtx) {
SoundSource* sources = &globalCtx->soundSources[0]; SoundSource* sources = &globalCtx->soundSources[0];
s32 i; s32 i;
// clang-format off for (i = 0; i < ARRAY_COUNT(globalCtx->soundSources); sources[i].countdown = 0, i++) {}
for (i = 0; i < ARRAY_COUNT(globalCtx->soundSources); i++) { sources[i].countdown = 0; }
// clang-format on
} }
void SoundSource_UpdateAll(GlobalContext* globalCtx) { void SoundSource_UpdateAll(GlobalContext* globalCtx) {

View File

@ -17,9 +17,7 @@ s32 __osContRamRead(OSMesgQueue* ctrlrqueue, s32 channel, u16 addr, u8* data) {
if ((__osContLastPoll != 2) || (__osPfsLastChannel != channel)) { if ((__osContLastPoll != 2) || (__osPfsLastChannel != channel)) {
__osContLastPoll = 2; __osContLastPoll = 2;
__osPfsLastChannel = channel; __osPfsLastChannel = channel;
// clang-format off for (i = 0; i < channel; i++, *bufptr++ = 0) {}
for (i = 0; i < channel; i++) { *bufptr++ = 0; }
// clang-format on
gPifMempakBuf.status = 1; gPifMempakBuf.status = 1;
((__OSContRamHeader*)bufptr)->unk_00 = 0xFF; ((__OSContRamHeader*)bufptr)->unk_00 = 0xFF;
((__OSContRamHeader*)bufptr)->txsize = 3; ((__OSContRamHeader*)bufptr)->txsize = 3;

View File

@ -21,9 +21,7 @@ s32 __osContRamWrite(OSMesgQueue* mq, s32 channel, u16 address, u8* buffer, s32
__osContLastPoll = CONT_CMD_WRITE_MEMPACK; __osContLastPoll = CONT_CMD_WRITE_MEMPACK;
__osPfsLastChannel = channel; __osPfsLastChannel = channel;
// clang-format off for (i = 0; i < channel; i++, *ptr++ = 0) {}
for (i = 0; i < channel; i++) { *ptr++ = 0; }
// clang-format on
gPifMempakBuf.status = 1; gPifMempakBuf.status = 1;

View File

@ -3762,9 +3762,7 @@ void func_8083819C(Player* this, GlobalContext* globalCtx) {
void func_8083821C(Player* this) { void func_8083821C(Player* this) {
s32 i; s32 i;
// clang-format off for (i = 0; i < PLAYER_BODYPART_MAX; this->flameTimers[i] = Rand_S16Offset(0, 200), i++) {}
for (i = 0; i < PLAYER_BODYPART_MAX; i++) { this->flameTimers[i] = Rand_S16Offset(0, 200); }
// clang-format on
this->isBurning = true; this->isBurning = true;
} }