Prevent shadowing.
The name line_number seems to be used as a function parameter name for one of the Lex functions. Change the name to linenumber.
This commit is contained in:
parent
843b520e07
commit
9b52f7b4ed
@ -36,6 +36,6 @@ typedef struct {
|
||||
} linear_zone_t;
|
||||
|
||||
extern int debug;
|
||||
extern int line_number;
|
||||
extern int linenumber;
|
||||
extern int yyerror(const char *);
|
||||
extern int yylex(void);
|
||||
|
@ -41,7 +41,7 @@
|
||||
#include "ldef.h"
|
||||
#include "yacc.h"
|
||||
|
||||
int line_number = 1;
|
||||
int linenumber = 1;
|
||||
%}
|
||||
%option noinput
|
||||
%option nounput
|
||||
@ -51,11 +51,11 @@ int line_number = 1;
|
||||
%%
|
||||
|
||||
[ \t]+ { }
|
||||
#.*[\n]|"//".*[\n]|[\n] { line_number++; return (R_LN); }
|
||||
#.*[\n]|"//".*[\n]|[\n] { linenumber++; return (R_LN); }
|
||||
|
||||
"/*" { BEGIN COMMENT; }
|
||||
<COMMENT>"*/" { BEGIN 0; }
|
||||
<COMMENT>[\n] { line_number++; }
|
||||
<COMMENT>[\n] { linenumber++; }
|
||||
<COMMENT>. { }
|
||||
<COMMENT><<EOF>> {
|
||||
yyerror("unexpected file end (unterminated comment)\n");
|
||||
|
@ -203,7 +203,7 @@ static void
|
||||
warning(const char *s)
|
||||
{
|
||||
|
||||
fprintf(stderr, "%s in %d\n", s, line_number);
|
||||
fprintf(stderr, "%s in %d\n", s, linenumber);
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -27,7 +27,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
extern int line_number;
|
||||
extern int linenumber;
|
||||
extern int yyerror(const char *);
|
||||
extern int yylex(void);
|
||||
|
||||
|
@ -43,7 +43,7 @@
|
||||
#include "ldef.h"
|
||||
#include "yacc.h"
|
||||
|
||||
int line_number = 1;
|
||||
int linenumber = 1;
|
||||
%}
|
||||
%option noinput
|
||||
%option nounput
|
||||
@ -53,11 +53,11 @@ int line_number = 1;
|
||||
%%
|
||||
|
||||
[ \t]+ { }
|
||||
#.*[\n]|"//".*[\n]|[\n] { line_number++; return (R_LN); }
|
||||
#.*[\n]|"//".*[\n]|[\n] { linenumber++; return (R_LN); }
|
||||
|
||||
"/*" { BEGIN COMMENT; }
|
||||
<COMMENT>"*/" { BEGIN 0; }
|
||||
<COMMENT>[\n] { line_number++; }
|
||||
<COMMENT>[\n] { linenumber++; }
|
||||
<COMMENT>. { }
|
||||
<COMMENT><<EOF>> {
|
||||
yyerror("unexpected file end (unterminated comment)\n");
|
||||
|
@ -114,7 +114,7 @@ int
|
||||
yyerror(const char *s)
|
||||
{
|
||||
|
||||
fprintf(stderr, "%s in %d\n", s, line_number);
|
||||
fprintf(stderr, "%s in %d\n", s, linenumber);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user