From 9b52f7b4ed3c8328148e0309a1940c05066ddf43 Mon Sep 17 00:00:00 2001 From: ed Date: Sat, 25 May 2013 15:36:15 +0000 Subject: [PATCH] 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. --- usr.bin/mkcsmapper/ldef.h | 2 +- usr.bin/mkcsmapper/lex.l | 6 +++--- usr.bin/mkcsmapper/yacc.y | 2 +- usr.bin/mkesdb/ldef.h | 2 +- usr.bin/mkesdb/lex.l | 6 +++--- usr.bin/mkesdb/yacc.y | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/usr.bin/mkcsmapper/ldef.h b/usr.bin/mkcsmapper/ldef.h index 70c31225d9a..d5857032d75 100644 --- a/usr.bin/mkcsmapper/ldef.h +++ b/usr.bin/mkcsmapper/ldef.h @@ -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); diff --git a/usr.bin/mkcsmapper/lex.l b/usr.bin/mkcsmapper/lex.l index d8ab1b6b301..4ba7fc4af04 100644 --- a/usr.bin/mkcsmapper/lex.l +++ b/usr.bin/mkcsmapper/lex.l @@ -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; } "*/" { BEGIN 0; } -[\n] { line_number++; } +[\n] { linenumber++; } . { } <> { yyerror("unexpected file end (unterminated comment)\n"); diff --git a/usr.bin/mkcsmapper/yacc.y b/usr.bin/mkcsmapper/yacc.y index 5d1a06bfb8b..18497cef1c3 100644 --- a/usr.bin/mkcsmapper/yacc.y +++ b/usr.bin/mkcsmapper/yacc.y @@ -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 diff --git a/usr.bin/mkesdb/ldef.h b/usr.bin/mkesdb/ldef.h index 0c5e76a25b1..45b4e60cd70 100644 --- a/usr.bin/mkesdb/ldef.h +++ b/usr.bin/mkesdb/ldef.h @@ -27,7 +27,7 @@ * SUCH DAMAGE. */ -extern int line_number; +extern int linenumber; extern int yyerror(const char *); extern int yylex(void); diff --git a/usr.bin/mkesdb/lex.l b/usr.bin/mkesdb/lex.l index 3e852b099b8..19c5379b59d 100644 --- a/usr.bin/mkesdb/lex.l +++ b/usr.bin/mkesdb/lex.l @@ -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; } "*/" { BEGIN 0; } -[\n] { line_number++; } +[\n] { linenumber++; } . { } <> { yyerror("unexpected file end (unterminated comment)\n"); diff --git a/usr.bin/mkesdb/yacc.y b/usr.bin/mkesdb/yacc.y index 0c01b61f65c..6d77b157f10 100644 --- a/usr.bin/mkesdb/yacc.y +++ b/usr.bin/mkesdb/yacc.y @@ -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); } -- 2.45.0