From 5e60b961deb0d70935c6b1ec6e92eb7b9f9be75b Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Sun, 13 Nov 1994 12:54:18 -0200 Subject: [PATCH] small changes to avoid shadowing --- iolib.c | 12 ++++++------ lua.stx | 22 +++++++++++----------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/iolib.c b/iolib.c index 8583967e..fbb9081e 100644 --- a/iolib.c +++ b/iolib.c @@ -3,7 +3,7 @@ ** Input/output library to LUA */ -char *rcs_iolib="$Id: iolib.c,v 1.13 1994/10/18 18:34:47 roberto Exp celes $"; +char *rcs_iolib="$Id: iolib.c,v 1.14 1994/10/19 17:02:20 celes Exp roberto $"; #include #include @@ -187,7 +187,7 @@ static void io_read (void) ; if (c == '\"') { - int c, n=0; + int n=0; while((c = fgetc(in)) != '\"') { if (c == EOF) @@ -201,7 +201,7 @@ static void io_read (void) } else if (c == '\'') { - int c, n=0; + int n=0; while((c = fgetc(in)) != '\'') { if (c == EOF) @@ -269,9 +269,9 @@ static void io_read (void) break; case 'f': case 'g': case 'e': { - float f; - sscanf (s, "%f", &f); - lua_pushnumber(f); + float fl; + sscanf (s, "%f", &fl); + lua_pushnumber(fl); } break; default: diff --git a/lua.stx b/lua.stx index 92e7f6b8..177e60ed 100644 --- a/lua.stx +++ b/lua.stx @@ -1,6 +1,6 @@ %{ -char *rcs_luastx = "$Id: lua.stx,v 3.3 1994/11/06 15:35:04 roberto Exp roberto $"; +char *rcs_luastx = "$Id: lua.stx,v 3.4 1994/11/09 18:07:38 roberto Exp roberto $"; #include #include @@ -22,7 +22,7 @@ char *rcs_luastx = "$Id: lua.stx,v 3.3 1994/11/06 15:35:04 roberto Exp roberto $ static Long maxcode; static Long maxmain; static Long maxcurr ; -static Byte *code = NULL; +static Byte *funcCode = NULL; static Byte **initcode; static Byte *basepc; static Long maincode; @@ -166,10 +166,10 @@ static void code_number (float f) static void init_function (void) { - if (code == NULL) /* first function */ + if (funcCode == NULL) /* first function */ { - code = (Byte *) calloc(CODE_BLOCK, sizeof(Byte)); - if (code == NULL) + funcCode = (Byte *) calloc(CODE_BLOCK, sizeof(Byte)); + if (funcCode == NULL) lua_error("not enough memory"); maxcode = CODE_BLOCK; } @@ -240,7 +240,7 @@ functionlist : /* empty */ function : FUNCTION NAME { init_function(); - pc=0; basepc=code; maxcurr=maxcode; + pc=0; basepc=funcCode; maxcurr=maxcode; nlocalvar=0; $$ = lua_findsymbol($2); } @@ -263,9 +263,9 @@ function : FUNCTION NAME if (s_bvalue($3) == NULL) lua_error("not enough memory"); memcpy (s_bvalue($3), basepc, pc*sizeof(Byte)); - code = basepc; maxcode=maxcurr; + funcCode = basepc; maxcode=maxcurr; #if LISTING - PrintCode(code,code+pc); + PrintCode(funcCode,funcCode+pc); #endif } ; @@ -273,7 +273,7 @@ function : FUNCTION NAME method : FUNCTION NAME { $$ = lua_findsymbol($2); } ':' NAME { init_function(); - pc=0; basepc=code; maxcurr=maxcode; + pc=0; basepc=funcCode; maxcurr=maxcode; nlocalvar=0; localvar[nlocalvar]=lua_findsymbol("self"); /* self param. */ add_nlocalvar(1); @@ -298,9 +298,9 @@ method : FUNCTION NAME { $$ = lua_findsymbol($2); } ':' NAME if (b == NULL) lua_error("not enough memory"); memcpy (b, basepc, pc*sizeof(Byte)); - code = basepc; maxcode=maxcurr; + funcCode = basepc; maxcode=maxcurr; #if LISTING - PrintCode(code,code+pc); + PrintCode(funcCode,funcCode+pc); #endif /* assign function to table field */ pc=maincode; basepc=*initcode; maxcurr=maxmain;