mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
Declare string uppercase/lowercase functions unconditionally.
Avoid naming them str*(), because such names are reserved by ISO C.
This commit is contained in:
@@ -59,9 +59,7 @@ extern void yyunputbytes(ULONG count);
|
|||||||
|
|
||||||
extern YY_BUFFER_STATE pCurrentBuffer;
|
extern YY_BUFFER_STATE pCurrentBuffer;
|
||||||
|
|
||||||
#ifdef __GNUC__
|
extern void upperstring(char *s);
|
||||||
extern void strupr(char *s);
|
extern void lowerstring(char *s);
|
||||||
extern void strlwr(char *s);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1079,9 +1079,9 @@ string : T_STRING
|
|||||||
| T_OP_STRCAT '(' string ',' string ')'
|
| T_OP_STRCAT '(' string ',' string ')'
|
||||||
{ strcpy($$,$3); strcat($$,$5); }
|
{ strcpy($$,$3); strcat($$,$5); }
|
||||||
| T_OP_STRUPR '(' string ')'
|
| T_OP_STRUPR '(' string ')'
|
||||||
{ strcpy($$,$3); strupr($$); }
|
{ strcpy($$,$3); upperstring($$); }
|
||||||
| T_OP_STRLWR '(' string ')'
|
| T_OP_STRLWR '(' string ')'
|
||||||
{ strcpy($$,$3); strlwr($$); }
|
{ strcpy($$,$3); lowerstring($$); }
|
||||||
;
|
;
|
||||||
section:
|
section:
|
||||||
T_POP_SECTION string ',' sectiontype
|
T_POP_SECTION string ',' sectiontype
|
||||||
|
|||||||
@@ -39,9 +39,8 @@ ULONG tFloatingChars[256];
|
|||||||
ULONG nFloating;
|
ULONG nFloating;
|
||||||
enum eLexerState lexerstate = LEX_STATE_NORMAL;
|
enum eLexerState lexerstate = LEX_STATE_NORMAL;
|
||||||
|
|
||||||
#ifdef __GNUC__
|
|
||||||
void
|
void
|
||||||
strupr(char *s)
|
upperstring(char *s)
|
||||||
{
|
{
|
||||||
while (*s) {
|
while (*s) {
|
||||||
*s = toupper(*s);
|
*s = toupper(*s);
|
||||||
@@ -50,14 +49,14 @@ strupr(char *s)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
strlwr(char *s)
|
lowerstring(char *s)
|
||||||
{
|
{
|
||||||
while (*s) {
|
while (*s) {
|
||||||
*s = tolower(*s);
|
*s = tolower(*s);
|
||||||
s += 1;
|
s += 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
void
|
void
|
||||||
yyskipbytes(ULONG count)
|
yyskipbytes(ULONG count)
|
||||||
{
|
{
|
||||||
@@ -352,7 +351,7 @@ lex_AddStrings(struct sLexInitString * lex)
|
|||||||
(*ppHash)->nToken = lex->nToken;
|
(*ppHash)->nToken = lex->nToken;
|
||||||
(*ppHash)->pNext = NULL;
|
(*ppHash)->pNext = NULL;
|
||||||
|
|
||||||
strupr((*ppHash)->tzName);
|
upperstring((*ppHash)->tzName);
|
||||||
|
|
||||||
if ((*ppHash)->nNameLength > nLexMaxLength)
|
if ((*ppHash)->nNameLength > nLexMaxLength)
|
||||||
nLexMaxLength = (*ppHash)->nNameLength;
|
nLexMaxLength = (*ppHash)->nNameLength;
|
||||||
|
|||||||
Reference in New Issue
Block a user