add itoa(), replace snprintf("%d") calls

we can save some space and still end up with a 20% faster function

Change-Id: Ia58900122944b8527ef01a673afe18ea794acb41
This commit is contained in:
William Wilgus 2025-02-03 01:05:21 -05:00 committed by William Wilgus
parent 9e61d53c7c
commit f55fe21f66
9 changed files with 98 additions and 41 deletions

View file

@ -18,12 +18,12 @@
* KIND, either express or implied.
*
****************************************************************************/
#include <stdio.h>
#include "config.h"
#include "font.h"
#include "kernel.h"
#include "string.h" /* for memcmp oO*/
#include "string-extra.h" /* for itoa */
#include "sound.h"
#include "settings.h"
#include "viewport.h"
@ -611,7 +611,7 @@ static int write_bitmap_number(struct screen * display, int value,
int x, int y)
{
char buf[12], *ptr;
snprintf(buf, sizeof(buf), "%d", value);
itoa(buf, sizeof(buf), value);
for (ptr = buf; *ptr != '\0'; ptr++, x += BM_GLYPH_WIDTH)
display->mono_bitmap(bitmap_glyphs_4x8[*ptr - '0'], x, y,