From 428afa4c92f304de4441aba34b4f7f90e4e588cf Mon Sep 17 00:00:00 2001
From: Sylvain <[EMAIL REDACTED]>
Date: Sun, 2 Jul 2023 14:40:14 +0200
Subject: [PATCH] Use SDL functions instead of stdlib
---
glfont.c | 18 +++++++++---------
showfont.c | 2 +-
testapp.c | 6 +++---
3 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/glfont.c b/glfont.c
index 5416068b..63362157 100644
--- a/glfont.c
+++ b/glfont.c
@@ -214,25 +214,25 @@ int main(int argc, char *argv[])
forecol = &black;
backcol = &white;
for (i=1; argv[i] && argv[i][0] == '-'; ++i) {
- if (strcmp(argv[i], "-utf8") == 0) {
+ if (SDL_strcmp(argv[i], "-utf8") == 0) {
rendertype = RENDER_UTF8;
} else
- if (strcmp(argv[i], "-unicode") == 0) {
+ if (SDL_strcmp(argv[i], "-unicode") == 0) {
rendertype = RENDER_UNICODE;
} else
- if (strcmp(argv[i], "-b") == 0) {
+ if (SDL_strcmp(argv[i], "-b") == 0) {
renderstyle |= TTF_STYLE_BOLD;
} else
- if (strcmp(argv[i], "-i") == 0) {
+ if (SDL_strcmp(argv[i], "-i") == 0) {
renderstyle |= TTF_STYLE_ITALIC;
} else
- if (strcmp(argv[i], "-u") == 0) {
+ if (SDL_strcmp(argv[i], "-u") == 0) {
renderstyle |= TTF_STYLE_UNDERLINE;
} else
- if (strcmp(argv[i], "-dump") == 0) {
+ if (SDL_strcmp(argv[i], "-dump") == 0) {
dump = 1;
} else
- if (strcmp(argv[i], "-fgcol") == 0) {
+ if (SDL_strcmp(argv[i], "-fgcol") == 0) {
int r, g, b;
if (sscanf (argv[++i], "%d,%d,%d", &r, &g, &b) != 3) {
fprintf(stderr, TTF_GLFONT_USAGE, argv0);
@@ -242,7 +242,7 @@ int main(int argc, char *argv[])
forecol->g = (Uint8)g;
forecol->b = (Uint8)b;
} else
- if (strcmp(argv[i], "-bgcol") == 0) {
+ if (SDL_strcmp(argv[i], "-bgcol") == 0) {
int r, g, b;
if (sscanf (argv[++i], "%d,%d,%d", &r, &g, &b) != 3) {
fprintf(stderr, TTF_GLFONT_USAGE, argv0);
@@ -275,7 +275,7 @@ int main(int argc, char *argv[])
/* Open the font file with the requested point size */
ptsize = 0;
if (argc > 1) {
- ptsize = atoi(argv[1]);
+ ptsize = SDL_atoi(argv[1]);
}
if (ptsize == 0) {
i = 2;
diff --git a/showfont.c b/showfont.c
index 24fafca5..fa528a85 100644
--- a/showfont.c
+++ b/showfont.c
@@ -203,7 +203,7 @@ int main(int argc, char *argv[])
/* Open the font file with the requested point size */
ptsize = 0;
if (argc > 1) {
- ptsize = atoi(argv[1]);
+ ptsize = SDL_atoi(argv[1]);
}
if (ptsize == 0) {
i = 2;
diff --git a/testapp.c b/testapp.c
index d48ed895..9f720313 100644
--- a/testapp.c
+++ b/testapp.c
@@ -803,7 +803,7 @@ int main(void)
/* Get some console output out in case we crash next... */
if (! mode_random_test) {
char title[1024];
- snprintf(title, sizeof(title) - 1, "%s Sz=%d outline=%d Hinting=%s %s",
+ SDL_snprintf(title, sizeof(title) - 1, "%s Sz=%d outline=%d Hinting=%s %s",
render_mode_desc[render_mode],
curr_size,
outline,
@@ -811,7 +811,7 @@ int main(void)
basename((char*)font_path));
if (save_to_bmp) {
- snprintf(filename, sizeof(filename) - 1 ,
+ SDL_snprintf(filename, sizeof(filename) - 1 ,
"Render=%s_size=%d_outline=%d_wrap=%d_wrap_size=%d_kerning=%d_sdf=%d_italic=%d_bold=%d_underline=%d_strikethrough=%d_hinting=%s_%s__%ld.bmp",
render_mode_desc[render_mode],
curr_size,
@@ -830,7 +830,7 @@ int main(void)
);
}
- snprintf(infos, sizeof(infos) - 1 ,
+ SDL_snprintf(infos, sizeof(infos) - 1 ,
"Render=%s size=%d outline=%d wrap=%d wrap_size=%d kerning=%d sdf=%d italic=%d bold=%d underline=%d strikethrough=%d hinting=%s %s",
render_mode_desc[render_mode],
curr_size,