X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/750b78ba359e7d30c7d3ad49d268923e986268cb..f76dbc4d52c005b63745cf924efe30eece4c6f79:/src/common/lexer.l?ds=sidebyside diff --git a/src/common/lexer.l b/src/common/lexer.l index c8700e0c78..8f8a1cdd9b 100644 --- a/src/common/lexer.l +++ b/src/common/lexer.l @@ -25,9 +25,6 @@ WORDCHAR [^'\\] #include "wx/expr.h" -#ifdef wx_x -extern char *malloc(); -#endif #define Return(x) return x; #if defined(VMS) && !defined(strdup) @@ -40,10 +37,9 @@ static size_t lex_string_ptr = 0; static int lex_read_from_string = 0; static int my_input(void); -static int my_unput(char); #ifdef FLEX_SCANNER -#undef YY_INPUT +# undef YY_INPUT # define YY_INPUT(buf,result,max_size) \ if (lex_read_from_string) \ { int c = my_input(); result = (c == 0) ? YY_NULL : ((buf)[0]=(c), 1); } \ @@ -53,6 +49,7 @@ static int my_unput(char); #else # undef unput # define unput(_c) my_unput(_c) + static int my_unput(char); #endif %} @@ -67,7 +64,7 @@ static int my_unput(char); "'"{WORDCHAR}*"'" {int len = strlen(yytext); yytext[len-1] = 0; - yylval.s = strdup(yytext+1); + yylval.s = strdup(yytext+1); Return(WORD);} \"({STRINGCHAR}|\\\"|\|\\\\|\\)*\" {yylval.s = strdup(yytext); Return(STRING);} @@ -121,15 +118,12 @@ static int lex_input() { static int lex_input() { return input(); } -/* # undef unput -# define unput(_c) my_unput(_c) -*/ # undef input # define input() my_input() static int my_unput(char c) { - if (lex_read_from_string) { + if (lex_read_from_string != 0) { /* Make sure we have something */ if (lex_string_ptr) { if (c == '\n') yylineno--; @@ -144,7 +138,7 @@ static int my_unput(char c) #endif -/* Public */ +/* Public */ void LexFromFile(FILE *fd) { lex_read_from_string = 0;