Simplify DynamicPlaceholderTextUtil_Reset (#719)
Some checks are pending
CI / build (push) Waiting to run

Replace the pointer-based do/while and intptr_t casts with a simple indexed for-loop that sets each element of sStringPointers to NULL.
This commit is contained in:
SiliconA-Z 2026-03-21 18:20:00 -04:00 committed by GitHub
parent 7b745dc283
commit 891e203ded
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -89,15 +89,9 @@ static const u8 sTextColorTable[] =
void DynamicPlaceholderTextUtil_Reset(void)
{
const u8 **ptr = sStringPointers;
u8 *fillval = NULL;
const u8 **ptr2 = ptr + (NELEMS(sStringPointers) - 1);
do
{
*ptr2-- = fillval;
}
while ((intptr_t)ptr2 >= (intptr_t)ptr);
s32 i;
for (i = 0; i < NELEMS(sStringPointers); i++)
sStringPointers[i] = NULL;
}
void DynamicPlaceholderTextUtil_SetPlaceholderPtr(u8 idx, const u8 *ptr)