small changes to avoid shadowing

This commit is contained in:
Roberto Ierusalimschy 1994-11-13 12:54:18 -02:00
parent e4645c835d
commit 5e60b961de
2 changed files with 17 additions and 17 deletions

12
iolib.c
View File

@ -3,7 +3,7 @@
** Input/output library to LUA ** 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 <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
@ -187,7 +187,7 @@ static void io_read (void)
; ;
if (c == '\"') if (c == '\"')
{ {
int c, n=0; int n=0;
while((c = fgetc(in)) != '\"') while((c = fgetc(in)) != '\"')
{ {
if (c == EOF) if (c == EOF)
@ -201,7 +201,7 @@ static void io_read (void)
} }
else if (c == '\'') else if (c == '\'')
{ {
int c, n=0; int n=0;
while((c = fgetc(in)) != '\'') while((c = fgetc(in)) != '\'')
{ {
if (c == EOF) if (c == EOF)
@ -269,9 +269,9 @@ static void io_read (void)
break; break;
case 'f': case 'g': case 'e': case 'f': case 'g': case 'e':
{ {
float f; float fl;
sscanf (s, "%f", &f); sscanf (s, "%f", &fl);
lua_pushnumber(f); lua_pushnumber(fl);
} }
break; break;
default: default:

22
lua.stx
View File

@ -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 <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
@ -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 maxcode;
static Long maxmain; static Long maxmain;
static Long maxcurr ; static Long maxcurr ;
static Byte *code = NULL; static Byte *funcCode = NULL;
static Byte **initcode; static Byte **initcode;
static Byte *basepc; static Byte *basepc;
static Long maincode; static Long maincode;
@ -166,10 +166,10 @@ static void code_number (float f)
static void init_function (void) static void init_function (void)
{ {
if (code == NULL) /* first function */ if (funcCode == NULL) /* first function */
{ {
code = (Byte *) calloc(CODE_BLOCK, sizeof(Byte)); funcCode = (Byte *) calloc(CODE_BLOCK, sizeof(Byte));
if (code == NULL) if (funcCode == NULL)
lua_error("not enough memory"); lua_error("not enough memory");
maxcode = CODE_BLOCK; maxcode = CODE_BLOCK;
} }
@ -240,7 +240,7 @@ functionlist : /* empty */
function : FUNCTION NAME function : FUNCTION NAME
{ {
init_function(); init_function();
pc=0; basepc=code; maxcurr=maxcode; pc=0; basepc=funcCode; maxcurr=maxcode;
nlocalvar=0; nlocalvar=0;
$<vWord>$ = lua_findsymbol($2); $<vWord>$ = lua_findsymbol($2);
} }
@ -263,9 +263,9 @@ function : FUNCTION NAME
if (s_bvalue($<vWord>3) == NULL) if (s_bvalue($<vWord>3) == NULL)
lua_error("not enough memory"); lua_error("not enough memory");
memcpy (s_bvalue($<vWord>3), basepc, pc*sizeof(Byte)); memcpy (s_bvalue($<vWord>3), basepc, pc*sizeof(Byte));
code = basepc; maxcode=maxcurr; funcCode = basepc; maxcode=maxcurr;
#if LISTING #if LISTING
PrintCode(code,code+pc); PrintCode(funcCode,funcCode+pc);
#endif #endif
} }
; ;
@ -273,7 +273,7 @@ function : FUNCTION NAME
method : FUNCTION NAME { $<vWord>$ = lua_findsymbol($2); } ':' NAME method : FUNCTION NAME { $<vWord>$ = lua_findsymbol($2); } ':' NAME
{ {
init_function(); init_function();
pc=0; basepc=code; maxcurr=maxcode; pc=0; basepc=funcCode; maxcurr=maxcode;
nlocalvar=0; nlocalvar=0;
localvar[nlocalvar]=lua_findsymbol("self"); /* self param. */ localvar[nlocalvar]=lua_findsymbol("self"); /* self param. */
add_nlocalvar(1); add_nlocalvar(1);
@ -298,9 +298,9 @@ method : FUNCTION NAME { $<vWord>$ = lua_findsymbol($2); } ':' NAME
if (b == NULL) if (b == NULL)
lua_error("not enough memory"); lua_error("not enough memory");
memcpy (b, basepc, pc*sizeof(Byte)); memcpy (b, basepc, pc*sizeof(Byte));
code = basepc; maxcode=maxcurr; funcCode = basepc; maxcode=maxcurr;
#if LISTING #if LISTING
PrintCode(code,code+pc); PrintCode(funcCode,funcCode+pc);
#endif #endif
/* assign function to table field */ /* assign function to table field */
pc=maincode; basepc=*initcode; maxcurr=maxmain; pc=maincode; basepc=*initcode; maxcurr=maxmain;