diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1994-11-13 12:54:18 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1994-11-13 12:54:18 -0200 |
commit | 5e60b961deb0d70935c6b1ec6e92eb7b9f9be75b (patch) | |
tree | 9314a6ccf89fdf0dcfbd0d870967f61c45c3e565 | |
parent | e4645c835d2b2e49f0d39eb3069638f60da388cd (diff) | |
download | lua-5e60b961deb0d70935c6b1ec6e92eb7b9f9be75b.tar.gz lua-5e60b961deb0d70935c6b1ec6e92eb7b9f9be75b.tar.bz2 lua-5e60b961deb0d70935c6b1ec6e92eb7b9f9be75b.zip |
small changes to avoid shadowing
-rw-r--r-- | iolib.c | 12 | ||||
-rw-r--r-- | lua.stx | 22 |
2 files changed, 17 insertions, 17 deletions
@@ -3,7 +3,7 @@ | |||
3 | ** Input/output library to LUA | 3 | ** Input/output library to LUA |
4 | */ | 4 | */ |
5 | 5 | ||
6 | char *rcs_iolib="$Id: iolib.c,v 1.13 1994/10/18 18:34:47 roberto Exp celes $"; | 6 | char *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: |
@@ -1,6 +1,6 @@ | |||
1 | %{ | 1 | %{ |
2 | 2 | ||
3 | char *rcs_luastx = "$Id: lua.stx,v 3.3 1994/11/06 15:35:04 roberto Exp roberto $"; | 3 | char *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 $ | |||
22 | static Long maxcode; | 22 | static Long maxcode; |
23 | static Long maxmain; | 23 | static Long maxmain; |
24 | static Long maxcurr ; | 24 | static Long maxcurr ; |
25 | static Byte *code = NULL; | 25 | static Byte *funcCode = NULL; |
26 | static Byte **initcode; | 26 | static Byte **initcode; |
27 | static Byte *basepc; | 27 | static Byte *basepc; |
28 | static Long maincode; | 28 | static Long maincode; |
@@ -166,10 +166,10 @@ static void code_number (float f) | |||
166 | 166 | ||
167 | static void init_function (void) | 167 | static 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 */ | |||
240 | function : FUNCTION NAME | 240 | function : 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 | |||
273 | method : FUNCTION NAME { $<vWord>$ = lua_findsymbol($2); } ':' NAME | 273 | method : 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; |