1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2024-11-11 03:39:59 +00:00

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) {
u32 i;
// clang-format off
for (i = 0; i < size; i++) { *dest++ = val; }
// clang-format on
for (i = 0; i < size; i++, *dest++ = val) {}
}
f32 Math_CosS(s16 angle) {

View file

@ -4,9 +4,7 @@ void SoundSource_InitAll(GlobalContext* globalCtx) {
SoundSource* sources = &globalCtx->soundSources[0];
s32 i;
// clang-format off
for (i = 0; i < ARRAY_COUNT(globalCtx->soundSources); i++) { sources[i].countdown = 0; }
// clang-format on
for (i = 0; i < ARRAY_COUNT(globalCtx->soundSources); sources[i].countdown = 0, i++) {}
}
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)) {
__osContLastPoll = 2;
__osPfsLastChannel = channel;
// clang-format off
for (i = 0; i < channel; i++) { *bufptr++ = 0; }
// clang-format on
for (i = 0; i < channel; i++, *bufptr++ = 0) {}
gPifMempakBuf.status = 1;
((__OSContRamHeader*)bufptr)->unk_00 = 0xFF;
((__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;
__osPfsLastChannel = channel;
// clang-format off
for (i = 0; i < channel; i++) { *ptr++ = 0; }
// clang-format on
for (i = 0; i < channel; i++, *ptr++ = 0) {}
gPifMempakBuf.status = 1;

View file

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