more warning cleanup (trunk only)
More warning bits that never got committed. More appropriate compiler flags for warning checks (macosx only for the moment). The changes in dgn*[lc] just rename line_number to nh_line_number to avoid a clash, so no need to regenerate the lex output.
This commit is contained in:
@@ -73,7 +73,7 @@ void FDECL(init_yyout, (FILE *));
|
||||
|
||||
extern YYSTYPE yylval;
|
||||
|
||||
int line_number = 1;
|
||||
int nh_line_number = 1;
|
||||
|
||||
%}
|
||||
%%
|
||||
@@ -110,8 +110,8 @@ RNDCHLEVEL return(RNDCHLEVEL);
|
||||
yylval.str = (char *) alloc(strlen(yytext+1)+1);
|
||||
Strcpy(yylval.str, yytext+1); /* Discard the first \" */
|
||||
return(STRING); }
|
||||
^#.*\n { line_number++; }
|
||||
\r?\n { line_number++; }
|
||||
^#.*\n { nh_line_number++; }
|
||||
\r?\n { nh_line_number++; }
|
||||
[ \t]+ ; /* skip trailing tabs & spaces */
|
||||
. { return yytext[0]; }
|
||||
%%
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
#define MAX_ERRORS 25
|
||||
|
||||
extern int NDECL (yyparse);
|
||||
extern int line_number;
|
||||
extern int nh_line_number;
|
||||
const char *fname = "(stdin)";
|
||||
int fatal_error = 0;
|
||||
|
||||
@@ -135,7 +135,7 @@ char **argv;
|
||||
init_yyin(fin);
|
||||
init_yyout(fout);
|
||||
(void) yyparse();
|
||||
line_number = 1;
|
||||
nh_line_number = 1;
|
||||
if (fatal_error > 0) {
|
||||
errors_encountered = TRUE;
|
||||
fatal_error = 0;
|
||||
@@ -161,7 +161,7 @@ char **argv;
|
||||
void yyerror(s)
|
||||
const char *s;
|
||||
{
|
||||
(void) fprintf(stderr,"%s : line %d : %s\n",fname,line_number, s);
|
||||
(void) fprintf(stderr,"%s : line %d : %s\n",fname,nh_line_number, s);
|
||||
if (++fatal_error > MAX_ERRORS) {
|
||||
(void) fprintf(stderr,"Too many errors, good bye!\n");
|
||||
exit(EXIT_FAILURE);
|
||||
@@ -175,7 +175,7 @@ const char *s;
|
||||
void yywarning(s)
|
||||
const char *s;
|
||||
{
|
||||
(void) fprintf(stderr,"%s : line %d : WARNING : %s\n",fname,line_number,s);
|
||||
(void) fprintf(stderr,"%s : line %d : WARNING : %s\n",fname,nh_line_number,s);
|
||||
}
|
||||
|
||||
int yywrap()
|
||||
|
||||
Reference in New Issue
Block a user