From f109c3d69688355992cc92c58efd8aa739085cc1 Mon Sep 17 00:00:00 2001 From: Dianne Skoll Date: Tue, 5 Oct 2021 13:54:04 -0400 Subject: [PATCH] Remove C99-ism. --- src/token.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/token.c b/src/token.c index cfa15397..c723c060 100644 --- a/src/token.c +++ b/src/token.c @@ -173,6 +173,10 @@ void FindToken(char const *s, Token *tok) int top, bot, mid, r, max; int l; +#if LANG != ENGLISH + size_t i; +#endif + tok->type = T_Illegal; if (! *s) { tok->type = T_Empty; @@ -230,11 +234,11 @@ void FindToken(char const *s, Token *tok) /* If language is other than English, search the DayNames[] and MonthNames[] array. */ #if LANG != ENGLISH - for (size_t x=0; x<(sizeof(NonEnglishToks) / sizeof(Token)); x++) { - if (l >= NonEnglishToks[x].MinLen && - !TokStrCmp(&NonEnglishToks[x], s)) { - tok->type = NonEnglishToks[x].type; - tok->val = NonEnglishToks[x].val; + for (i=0; i<(sizeof(NonEnglishToks) / sizeof(Token)); i++) { + if (l >= NonEnglishToks[i].MinLen && + !TokStrCmp(&NonEnglishToks[i], s)) { + tok->type = NonEnglishToks[i].type; + tok->val = NonEnglishToks[i].val; return; } }