X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2FSDCC.lex;h=0ac4356eee1c3398d650ab1fb47d9808ffd91975;hb=948f2c7c5179a6aeff9286cb4fbdf9ebc55e16b8;hp=64e38670068fd2b00ba34ccabfcff2b222a415c7;hpb=732e7e96d978670c6a8967a0a36a85058ca37971;p=fw%2Fsdcc diff --git a/src/SDCC.lex b/src/SDCC.lex index 64e38670..0ac4356e 100644 --- a/src/SDCC.lex +++ b/src/SDCC.lex @@ -39,14 +39,14 @@ IS (u|U|l|L)* #include "newalloc.h" #include "dbuf.h" -char *stringLiteral(); +static char *stringLiteral(void); char *currFname; extern int lineno, column; -extern char *filename ; -int mylineno = 1 ; -void count() ; -int process_pragma(char *); +extern char *filename; +int mylineno = 1; +static void count(void); +static int process_pragma(char *); #undef yywrap #ifndef YYPROTO @@ -72,17 +72,15 @@ static void my_unput(char c) } #define TKEYWORD(token) return (isTargetKeyword(yytext) ? token :\ - check_type(yytext)) + check_type()) char *asmbuff=NULL; int asmbuffSize=0; char *asmp ; -extern int check_type (); - extern int isTargetKeyword (); -extern int checkCurrFile (char *); -extern int processPragma (char *); -extern int printListing (int ); -struct optimize save_optimize ; -struct options save_options ; +static int check_type(void); +static int isTargetKeyword(char *s); +static int checkCurrFile (char *s); +struct optimize save_optimize; +struct options save_options; %} %x asm @@ -102,7 +100,7 @@ struct options save_options ; } . { if (asmp-asmbuff >= asmbuffSize-2) { - // increase the buffersize with 50% + /* increase the buffersize with 50% */ int size=asmp-asmbuff; asmbuffSize=asmbuffSize*3/2; asmbuff = realloc (asmbuff, asmbuffSize); @@ -113,7 +111,7 @@ struct options save_options ; \n { count(); if (asmp-asmbuff >= asmbuffSize-3) { - // increase the buffersize with 50% + /* increase the buffersize with 50% */ int size=asmp-asmbuff; asmbuffSize=asmbuffSize*3/2; asmbuff = realloc (asmbuff, asmbuffSize); @@ -243,7 +241,7 @@ struct options save_options ; \\ { char ch=input(); if (ch!='\n') { - // that could have been removed by the preprocessor anyway + /* that could have been removed by the preprocessor anyway */ werror (W_STRAY_BACKSLASH, column); my_unput(ch); } @@ -393,7 +391,7 @@ static char *stringLiteral(void) case '\\': if ((ch = input()) != '\n') { werror(W_STRAY_BACKSLASH, column); - my_unput(ch); + my_unput((char)ch); } else { lineno = ++mylineno; @@ -411,7 +409,7 @@ static char *stringLiteral(void) goto out; if (ch != '\"') { - my_unput(ch) ; + my_unput((char)ch) ; goto out; } break; @@ -673,11 +671,11 @@ int yyerror(char *s) if (mylineno && filename) { if(options.vc_err_style) - fprintf(stdout,"\n%s(%d) : %s: token -> '%s' ; column %d\n", + fprintf(stderr,"\n%s(%d) : %s: token -> '%s' ; column %d\n", filename,mylineno, s,yytext,column); else - fprintf(stdout,"\n%s:%d: %s: token -> '%s' ; column %d\n", + fprintf(stderr,"\n%s:%d: %s: token -> '%s' ; column %d\n", filename,mylineno, s,yytext,column); fatalError++;