mirror of
https://github.com/pret/pokefirered.git
synced 2026-04-25 07:19:36 -05:00
Simplify DynamicPlaceholderTextUtil_Reset (#719)
Some checks are pending
CI / build (push) Waiting to run
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:
parent
7b745dc283
commit
891e203ded
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user