From 891e203dedd0795aea0d33ae98d6db9a03868efa Mon Sep 17 00:00:00 2001 From: SiliconA-Z Date: Sat, 21 Mar 2026 18:20:00 -0400 Subject: [PATCH] Simplify DynamicPlaceholderTextUtil_Reset (#719) Replace the pointer-based do/while and intptr_t casts with a simple indexed for-loop that sets each element of sStringPointers to NULL. --- src/dynamic_placeholder_text_util.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/dynamic_placeholder_text_util.c b/src/dynamic_placeholder_text_util.c index e9089c30a..63f49748b 100644 --- a/src/dynamic_placeholder_text_util.c +++ b/src/dynamic_placeholder_text_util.c @@ -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)