diff options
| author | Ruben Beltran del Rio <git@r.bdr.sh> | 2025-09-19 17:37:36 +0200 |
|---|---|---|
| committer | Ruben Beltran del Rio <git@r.bdr.sh> | 2025-09-19 17:37:36 +0200 |
| commit | e9553cf80c3a5588b68a38ea7a99936a8b9b88b7 (patch) | |
| tree | 3a60831f6142470467cc14e8fb7e160613f5c711 /src | |
| parent | 00ea2943c81d2b3a8531e8b7b591de3443b1250c (diff) | |
Fix warnings for older compilers
Diffstat (limited to 'src')
| -rw-r--r-- | src/wmap_parser.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/wmap_parser.c b/src/wmap_parser.c index e0cf6d6..0fa8427 100644 --- a/src/wmap_parser.c +++ b/src/wmap_parser.c @@ -1,5 +1,9 @@ #include "wmap_parser.h" +/* Forward declarations for older compilers */ +static int wmap_lexer_is_identifier_char(char c); +static int wmap_lexer_is_keyword(const char* text, const char* keyword); + static void wmap_lexer_init(wmap_lexer_t* lexer, const char* input) { lexer->input = input; lexer->pos = 0; @@ -18,7 +22,7 @@ static void wmap_lexer_skip_whitespace(wmap_lexer_t* lexer) { } } -WMAP_68K_INLINE int wmap_lexer_is_identifier_char(char c) WMAP_68K_FAST_CALL { +static int wmap_lexer_is_identifier_char(char c) { return c != '-' && c != '+' && c != ',' && c != '[' && c != ']' && c != '(' && c != ')' && c != '\n' && c != '\r' && c != '\0' && c != ' ' && c != '\t'; } @@ -104,7 +108,7 @@ static wmap_token_type_t wmap_lexer_next_token(wmap_lexer_t* lexer) { } } - if (isdigit(c) || c == '.') { + if (isdigit((unsigned char)c) || c == '.') { start = lexer->pos; has_dot = 0; @@ -112,12 +116,12 @@ static wmap_token_type_t wmap_lexer_next_token(wmap_lexer_t* lexer) { has_dot = 1; lexer->pos++; lexer->col++; - if (!isdigit(lexer->input[lexer->pos])) { + if (!isdigit((unsigned char)lexer->input[lexer->pos])) { return lexer->current_token = WMAP_TOKEN_ERROR; } } - while (isdigit(lexer->input[lexer->pos])) { + while (isdigit((unsigned char)lexer->input[lexer->pos])) { lexer->pos++; lexer->col++; } @@ -126,7 +130,7 @@ static wmap_token_type_t wmap_lexer_next_token(wmap_lexer_t* lexer) { has_dot = 1; lexer->pos++; lexer->col++; - while (isdigit(lexer->input[lexer->pos])) { + while (isdigit((unsigned char)lexer->input[lexer->pos])) { lexer->pos++; lexer->col++; } @@ -169,7 +173,7 @@ static wmap_token_type_t wmap_lexer_next_token(wmap_lexer_t* lexer) { return lexer->current_token = WMAP_TOKEN_ERROR; } -WMAP_68K_INLINE int wmap_lexer_is_keyword(const char* text, const char* keyword) WMAP_68K_FAST_CALL { +static int wmap_lexer_is_keyword(const char* text, const char* keyword) { int i = 0; while (text[i] && keyword[i]) { char tc = text[i]; |