Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

text: Simplify DynamicPlaceholderTextUtil_Reset #1841

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 4 additions & 10 deletions src/dynamic_placeholder_text_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,11 @@ static EWRAM_DATA const u8 *sStringPointers[8] = {};

void DynamicPlaceholderTextUtil_Reset(void)
{
const u8 **ptr;
u8 *fillval;
const u8 **ptr2;

ptr = sStringPointers;
fillval = NULL;
ptr2 = ptr + (ARRAY_COUNT(sStringPointers) - 1);
do
s32 i;
for (i = 0; i < (s32)ARRAY_COUNT(sStringPointers); i++)
{
AreaZeroArven marked this conversation as resolved.
Show resolved Hide resolved
*ptr2-- = fillval;
} while ((int)ptr2 >= (int)ptr);
sStringPointers[i] = NULL;
}
}

void DynamicPlaceholderTextUtil_SetPlaceholderPtr(u8 idx, const u8 *ptr)
Expand Down