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
0bbacb9c66
commit
af8e44c84a
|
@ -36,6 +36,6 @@ typedef struct {
|
||||||
} linear_zone_t;
|
} linear_zone_t;
|
||||||
|
|
||||||
extern int debug;
|
extern int debug;
|
||||||
extern int line_number;
|
extern int linenumber;
|
||||||
extern int yyerror(const char *);
|
extern int yyerror(const char *);
|
||||||
extern int yylex(void);
|
extern int yylex(void);
|
||||||
|
|
|
@ -41,7 +41,7 @@
|
||||||
#include "ldef.h"
|
#include "ldef.h"
|
||||||
#include "yacc.h"
|
#include "yacc.h"
|
||||||
|
|
||||||
int line_number = 1;
|
int linenumber = 1;
|
||||||
%}
|
%}
|
||||||
%option noinput
|
%option noinput
|
||||||
%option nounput
|
%option nounput
|
||||||
|
@ -51,11 +51,11 @@ int line_number = 1;
|
||||||
%%
|
%%
|
||||||
|
|
||||||
[ \t]+ { }
|
[ \t]+ { }
|
||||||
#.*[\n]|"//".*[\n]|[\n] { line_number++; return (R_LN); }
|
#.*[\n]|"//".*[\n]|[\n] { linenumber++; return (R_LN); }
|
||||||
|
|
||||||
"/*" { BEGIN COMMENT; }
|
"/*" { BEGIN COMMENT; }
|
||||||
<COMMENT>"*/" { BEGIN 0; }
|
<COMMENT>"*/" { BEGIN 0; }
|
||||||
<COMMENT>[\n] { line_number++; }
|
<COMMENT>[\n] { linenumber++; }
|
||||||
<COMMENT>. { }
|
<COMMENT>. { }
|
||||||
<COMMENT><<EOF>> {
|
<COMMENT><<EOF>> {
|
||||||
yyerror("unexpected file end (unterminated comment)\n");
|
yyerror("unexpected file end (unterminated comment)\n");
|
||||||
|
|
|
@ -203,7 +203,7 @@ static void
|
||||||
warning(const char *s)
|
warning(const char *s)
|
||||||
{
|
{
|
||||||
|
|
||||||
fprintf(stderr, "%s in %d\n", s, line_number);
|
fprintf(stderr, "%s in %d\n", s, linenumber);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
extern int line_number;
|
extern int linenumber;
|
||||||
extern int yyerror(const char *);
|
extern int yyerror(const char *);
|
||||||
extern int yylex(void);
|
extern int yylex(void);
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@
|
||||||
#include "ldef.h"
|
#include "ldef.h"
|
||||||
#include "yacc.h"
|
#include "yacc.h"
|
||||||
|
|
||||||
int line_number = 1;
|
int linenumber = 1;
|
||||||
%}
|
%}
|
||||||
%option noinput
|
%option noinput
|
||||||
%option nounput
|
%option nounput
|
||||||
|
@ -53,11 +53,11 @@ int line_number = 1;
|
||||||
%%
|
%%
|
||||||
|
|
||||||
[ \t]+ { }
|
[ \t]+ { }
|
||||||
#.*[\n]|"//".*[\n]|[\n] { line_number++; return (R_LN); }
|
#.*[\n]|"//".*[\n]|[\n] { linenumber++; return (R_LN); }
|
||||||
|
|
||||||
"/*" { BEGIN COMMENT; }
|
"/*" { BEGIN COMMENT; }
|
||||||
<COMMENT>"*/" { BEGIN 0; }
|
<COMMENT>"*/" { BEGIN 0; }
|
||||||
<COMMENT>[\n] { line_number++; }
|
<COMMENT>[\n] { linenumber++; }
|
||||||
<COMMENT>. { }
|
<COMMENT>. { }
|
||||||
<COMMENT><<EOF>> {
|
<COMMENT><<EOF>> {
|
||||||
yyerror("unexpected file end (unterminated comment)\n");
|
yyerror("unexpected file end (unterminated comment)\n");
|
||||||
|
|
|
@ -114,7 +114,7 @@ int
|
||||||
yyerror(const char *s)
|
yyerror(const char *s)
|
||||||
{
|
{
|
||||||
|
|
||||||
fprintf(stderr, "%s in %d\n", s, line_number);
|
fprintf(stderr, "%s in %d\n", s, linenumber);
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue