Index: res/ael/ael_lex.c =================================================================== --- res/ael/ael_lex.c (revision 241765) +++ res/ael/ael_lex.c (working copy) @@ -55,6 +55,7 @@ typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; +#endif /* ! C99 */ /* Limits of integral types. */ #ifndef INT8_MIN @@ -85,8 +86,6 @@ #define UINT32_MAX (4294967295U) #endif -#endif /* ! C99 */ - #endif /* ! FLEXINT_H */ #ifdef __cplusplus @@ -952,7 +951,7 @@ #define STORE_POS #define STORE_LOC #endif -#line 955 "ael_lex.c" +#line 954 "ael_lex.c" #define INITIAL 0 #define paren 1 @@ -1104,7 +1103,7 @@ /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) +#define ECHO fwrite( yytext, yyleng, 1, yyout ) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -1115,7 +1114,7 @@ if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ - size_t n; \ + int n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ @@ -1203,7 +1202,7 @@ #line 217 "ael.flex" -#line 1206 "ael_lex.c" +#line 1205 "ael_lex.c" yylval = yylval_param; @@ -2037,7 +2036,7 @@ #line 656 "ael.flex" YY_FATAL_ERROR( "flex scanner jammed" ); YY_BREAK -#line 2040 "ael_lex.c" +#line 2039 "ael_lex.c" case YY_END_OF_BUFFER: { @@ -3221,7 +3220,8 @@ void ael_yyfree(void *ptr, yyscan_t yyscanner) { - free( (char*) ptr ); + if (ptr) + free( (char*) ptr ); } static int pbcpop(char x) @@ -3360,7 +3360,8 @@ *errors = 1; return 0; } - free(my_file); + if (my_file) + free(my_file); my_file = strdup(filename); stat(filename, &stats); buffer = (char*)malloc(stats.st_size+2); Index: res/Makefile =================================================================== --- res/Makefile (revision 241765) +++ res/Makefile (working copy) @@ -45,11 +45,13 @@ $(if $(filter res_ael_share,$(EMBEDDED_MODS)),modules.link,res_ael_share.so): ael/ael_lex.o ael/ael.tab.o ael/pval.o -ael/ael_lex.c: +ael/ael_lex.c: ael/ael.flex + $(ECHO_PREFIX) echo " [FLEX] $< -> $@" (cd ael; flex ael.flex; sed -e "/begin standard C headers/i#include \"asterisk.h\"" ael_lex.c > zz; mv zz ael_lex.c) (cd ael; sed 's@#if __STDC_VERSION__ >= 199901L@#if !defined __STDC_VERSION__ || __STDC_VERSION__ >= 199901L@' ael_lex.c > zz; mv zz ael_lex.c) -ael/ael.tab.c ael/ael.tab.h: +ael/ael.tab.c ael/ael.tab.h: ael/ael.y + $(ECHO_PREFIX) echo " [BISON] $< -> $@" (cd ael; bison -v -d ael.y) ael/pval.o: ael/pval.c