svn commit: r250984 - in head/usr.bin: mkcsmapper mkesdb
Ed Schouten
ed at FreeBSD.org
Sat May 25 15:36:17 UTC 2013
Author: ed
Date: Sat May 25 15:36:15 2013
New Revision: 250984
URL: http://svnweb.freebsd.org/changeset/base/250984
Log:
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.
Modified:
head/usr.bin/mkcsmapper/ldef.h
head/usr.bin/mkcsmapper/lex.l
head/usr.bin/mkcsmapper/yacc.y
head/usr.bin/mkesdb/ldef.h
head/usr.bin/mkesdb/lex.l
head/usr.bin/mkesdb/yacc.y
Modified: head/usr.bin/mkcsmapper/ldef.h
==============================================================================
--- head/usr.bin/mkcsmapper/ldef.h Sat May 25 15:17:58 2013 (r250983)
+++ head/usr.bin/mkcsmapper/ldef.h Sat May 25 15:36:15 2013 (r250984)
@@ -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);
Modified: head/usr.bin/mkcsmapper/lex.l
==============================================================================
--- head/usr.bin/mkcsmapper/lex.l Sat May 25 15:17:58 2013 (r250983)
+++ head/usr.bin/mkcsmapper/lex.l Sat May 25 15:36:15 2013 (r250984)
@@ -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");
Modified: head/usr.bin/mkcsmapper/yacc.y
==============================================================================
--- head/usr.bin/mkcsmapper/yacc.y Sat May 25 15:17:58 2013 (r250983)
+++ head/usr.bin/mkcsmapper/yacc.y Sat May 25 15:36:15 2013 (r250984)
@@ -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
Modified: head/usr.bin/mkesdb/ldef.h
==============================================================================
--- head/usr.bin/mkesdb/ldef.h Sat May 25 15:17:58 2013 (r250983)
+++ head/usr.bin/mkesdb/ldef.h Sat May 25 15:36:15 2013 (r250984)
@@ -27,7 +27,7 @@
* SUCH DAMAGE.
*/
-extern int line_number;
+extern int linenumber;
extern int yyerror(const char *);
extern int yylex(void);
Modified: head/usr.bin/mkesdb/lex.l
==============================================================================
--- head/usr.bin/mkesdb/lex.l Sat May 25 15:17:58 2013 (r250983)
+++ head/usr.bin/mkesdb/lex.l Sat May 25 15:36:15 2013 (r250984)
@@ -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");
Modified: head/usr.bin/mkesdb/yacc.y
==============================================================================
--- head/usr.bin/mkesdb/yacc.y Sat May 25 15:17:58 2013 (r250983)
+++ head/usr.bin/mkesdb/yacc.y Sat May 25 15:36:15 2013 (r250984)
@@ -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);
}
More information about the svn-src-all
mailing list