From 9597bc91c3b8097908914c90958421311761eecb Mon Sep 17 00:00:00 2001 From: farisawan-2000 Date: Tue, 15 Dec 2020 23:10:28 -0500 Subject: [PATCH] updated headers to reduce warnings --- config.h | 2 ++ s2d_parse.c | 6 +++--- s2d_print.h | 6 +++--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/config.h b/config.h index 8fb41c65..15e06dfe 100644 --- a/config.h +++ b/config.h @@ -1,6 +1,8 @@ #ifndef S2D_CONFIG_H #define S2D_CONFIG_H +#define const + // include your font header here #include "fonts/impact.h" diff --git a/s2d_parse.c b/s2d_parse.c index 66cb9d0c..a121d076 100644 --- a/s2d_parse.c +++ b/s2d_parse.c @@ -15,7 +15,7 @@ int s2d_colorFrames = 0; extern u32 gGlobalTimer; -void s2d_snprint(int x, int y, char *str, uObjMtx *buf, int len) { +void s2d_snprint(int x, int y, const char *str, uObjMtx *buf, int len) { char *p = str; int tx = 0, ty = 0; int tmp_len = 0; @@ -94,7 +94,7 @@ void s2d_print(int x, int y, const char *str, uObjMtx *buf) { s2d_snprint(x, y, str, buf, s2d_strlen(str)); } -void s2d_type_print(int x, int y, char *str, uObjMtx *buf, int *pos) { +void s2d_type_print(int x, int y, const char *str, uObjMtx *buf, int *pos) { int len = s2d_strlen(str); s2d_snprint(x, y, str, buf, *pos); @@ -105,7 +105,7 @@ void s2d_type_print(int x, int y, char *str, uObjMtx *buf, int *pos) { } } -void s2d_vsprint(int x, int y, uObjMtx *buf, char *str, ...) { +void s2d_vsprint(int x, int y, uObjMtx *buf, const char *str, ...) { va_list args; va_start(args, str); // vsprintf(str, ) diff --git a/s2d_print.h b/s2d_print.h index 9a1dbf41..9ff3ee6b 100644 --- a/s2d_print.h +++ b/s2d_print.h @@ -17,7 +17,7 @@ #define CH_GET_NEXT(x) (*(++x)) #define CH_SKIP(x) {x++;} -extern void s2d_snprint(int x, int y, char *str, uObjMtx *buf, int len); +extern void s2d_snprint(int x, int y, const char *str, uObjMtx *buf, int len); extern void s2d_print(int x, int y, const char *str, uObjMtx *buf); -extern void s2d_type_print(int x, int y, char *str, uObjMtx *buf, int *pos); -extern void s2d_vsprint(int x, int y, uObjMtx *buf, char *str, ...); +extern void s2d_type_print(int x, int y, const char *str, uObjMtx *buf, int *pos); +extern void s2d_vsprint(int x, int y, uObjMtx *buf, const char *str, ...);