aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1994-11-13 12:54:18 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1994-11-13 12:54:18 -0200
commit5e60b961deb0d70935c6b1ec6e92eb7b9f9be75b (patch)
tree9314a6ccf89fdf0dcfbd0d870967f61c45c3e565
parente4645c835d2b2e49f0d39eb3069638f60da388cd (diff)
downloadlua-5e60b961deb0d70935c6b1ec6e92eb7b9f9be75b.tar.gz
lua-5e60b961deb0d70935c6b1ec6e92eb7b9f9be75b.tar.bz2
lua-5e60b961deb0d70935c6b1ec6e92eb7b9f9be75b.zip
small changes to avoid shadowing
-rw-r--r--iolib.c12
-rw-r--r--lua.stx22
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 @@
3** Input/output library to LUA 3** Input/output library to LUA
4*/ 4*/
5 5
6char *rcs_iolib="$Id: iolib.c,v 1.13 1994/10/18 18:34:47 roberto Exp celes $"; 6char *rcs_iolib="$Id: iolib.c,v 1.14 1994/10/19 17:02:20 celes Exp roberto $";
7 7
8#include <stdlib.h> 8#include <stdlib.h>
9#include <string.h> 9#include <string.h>
@@ -187,7 +187,7 @@ static void io_read (void)
187 ; 187 ;
188 if (c == '\"') 188 if (c == '\"')
189 { 189 {
190 int c, n=0; 190 int n=0;
191 while((c = fgetc(in)) != '\"') 191 while((c = fgetc(in)) != '\"')
192 { 192 {
193 if (c == EOF) 193 if (c == EOF)
@@ -201,7 +201,7 @@ static void io_read (void)
201 } 201 }
202 else if (c == '\'') 202 else if (c == '\'')
203 { 203 {
204 int c, n=0; 204 int n=0;
205 while((c = fgetc(in)) != '\'') 205 while((c = fgetc(in)) != '\'')
206 { 206 {
207 if (c == EOF) 207 if (c == EOF)
@@ -269,9 +269,9 @@ static void io_read (void)
269 break; 269 break;
270 case 'f': case 'g': case 'e': 270 case 'f': case 'g': case 'e':
271 { 271 {
272 float f; 272 float fl;
273 sscanf (s, "%f", &f); 273 sscanf (s, "%f", &fl);
274 lua_pushnumber(f); 274 lua_pushnumber(fl);
275 } 275 }
276 break; 276 break;
277 default: 277 default:
diff --git a/lua.stx b/lua.stx
index 92e7f6b8..177e60ed 100644
--- a/lua.stx
+++ b/lua.stx
@@ -1,6 +1,6 @@
1%{ 1%{
2 2
3char *rcs_luastx = "$Id: lua.stx,v 3.3 1994/11/06 15:35:04 roberto Exp roberto $"; 3char *rcs_luastx = "$Id: lua.stx,v 3.4 1994/11/09 18:07:38 roberto Exp roberto $";
4 4
5#include <stdio.h> 5#include <stdio.h>
6#include <stdlib.h> 6#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 $
22static Long maxcode; 22static Long maxcode;
23static Long maxmain; 23static Long maxmain;
24static Long maxcurr ; 24static Long maxcurr ;
25static Byte *code = NULL; 25static Byte *funcCode = NULL;
26static Byte **initcode; 26static Byte **initcode;
27static Byte *basepc; 27static Byte *basepc;
28static Long maincode; 28static Long maincode;
@@ -166,10 +166,10 @@ static void code_number (float f)
166 166
167static void init_function (void) 167static void init_function (void)
168{ 168{
169 if (code == NULL) /* first function */ 169 if (funcCode == NULL) /* first function */
170 { 170 {
171 code = (Byte *) calloc(CODE_BLOCK, sizeof(Byte)); 171 funcCode = (Byte *) calloc(CODE_BLOCK, sizeof(Byte));
172 if (code == NULL) 172 if (funcCode == NULL)
173 lua_error("not enough memory"); 173 lua_error("not enough memory");
174 maxcode = CODE_BLOCK; 174 maxcode = CODE_BLOCK;
175 } 175 }
@@ -240,7 +240,7 @@ functionlist : /* empty */
240function : FUNCTION NAME 240function : FUNCTION NAME
241 { 241 {
242 init_function(); 242 init_function();
243 pc=0; basepc=code; maxcurr=maxcode; 243 pc=0; basepc=funcCode; maxcurr=maxcode;
244 nlocalvar=0; 244 nlocalvar=0;
245 $<vWord>$ = lua_findsymbol($2); 245 $<vWord>$ = lua_findsymbol($2);
246 } 246 }
@@ -263,9 +263,9 @@ function : FUNCTION NAME
263 if (s_bvalue($<vWord>3) == NULL) 263 if (s_bvalue($<vWord>3) == NULL)
264 lua_error("not enough memory"); 264 lua_error("not enough memory");
265 memcpy (s_bvalue($<vWord>3), basepc, pc*sizeof(Byte)); 265 memcpy (s_bvalue($<vWord>3), basepc, pc*sizeof(Byte));
266 code = basepc; maxcode=maxcurr; 266 funcCode = basepc; maxcode=maxcurr;
267#if LISTING 267#if LISTING
268 PrintCode(code,code+pc); 268 PrintCode(funcCode,funcCode+pc);
269#endif 269#endif
270 } 270 }
271 ; 271 ;
@@ -273,7 +273,7 @@ function : FUNCTION NAME
273method : FUNCTION NAME { $<vWord>$ = lua_findsymbol($2); } ':' NAME 273method : FUNCTION NAME { $<vWord>$ = lua_findsymbol($2); } ':' NAME
274 { 274 {
275 init_function(); 275 init_function();
276 pc=0; basepc=code; maxcurr=maxcode; 276 pc=0; basepc=funcCode; maxcurr=maxcode;
277 nlocalvar=0; 277 nlocalvar=0;
278 localvar[nlocalvar]=lua_findsymbol("self"); /* self param. */ 278 localvar[nlocalvar]=lua_findsymbol("self"); /* self param. */
279 add_nlocalvar(1); 279 add_nlocalvar(1);
@@ -298,9 +298,9 @@ method : FUNCTION NAME { $<vWord>$ = lua_findsymbol($2); } ':' NAME
298 if (b == NULL) 298 if (b == NULL)
299 lua_error("not enough memory"); 299 lua_error("not enough memory");
300 memcpy (b, basepc, pc*sizeof(Byte)); 300 memcpy (b, basepc, pc*sizeof(Byte));
301 code = basepc; maxcode=maxcurr; 301 funcCode = basepc; maxcode=maxcurr;
302#if LISTING 302#if LISTING
303 PrintCode(code,code+pc); 303 PrintCode(funcCode,funcCode+pc);
304#endif 304#endif
305 /* assign function to table field */ 305 /* assign function to table field */
306 pc=maincode; basepc=*initcode; maxcurr=maxmain; 306 pc=maincode; basepc=*initcode; maxcurr=maxmain;