diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2003-02-27 09:33:07 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2003-02-27 09:33:07 -0300 |
commit | e1a424e8a35738bf56ecdad01155fb45b3001660 (patch) | |
tree | 34c232ea0cb15e410a161ee0f65bd9bdb73838d7 /lvm.c | |
parent | 59ce42dbd5a2dd2dd8bfbbf3e856742a535afc5b (diff) | |
download | lua-e1a424e8a35738bf56ecdad01155fb45b3001660.tar.gz lua-e1a424e8a35738bf56ecdad01155fb45b3001660.tar.bz2 lua-e1a424e8a35738bf56ecdad01155fb45b3001660.zip |
avoid the identifier `index' (clashes with BSD `index' function)
Diffstat (limited to 'lvm.c')
-rw-r--r-- | lvm.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lvm.c,v 1.276 2003/02/18 16:02:56 roberto Exp roberto $ | 2 | ** $Id: lvm.c,v 1.277 2003/02/27 11:52:30 roberto Exp roberto $ |
3 | ** Lua virtual machine | 3 | ** Lua virtual machine |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -680,7 +680,7 @@ StkId luaV_execute (lua_State *L) { | |||
680 | } | 680 | } |
681 | } | 681 | } |
682 | case OP_FORLOOP: { | 682 | case OP_FORLOOP: { |
683 | lua_Number step, index, limit; | 683 | lua_Number step, idx, limit; |
684 | const TObject *plimit = ra+1; | 684 | const TObject *plimit = ra+1; |
685 | const TObject *pstep = ra+2; | 685 | const TObject *pstep = ra+2; |
686 | if (!ttisnumber(ra)) | 686 | if (!ttisnumber(ra)) |
@@ -690,11 +690,11 @@ StkId luaV_execute (lua_State *L) { | |||
690 | if (!tonumber(pstep, ra+2)) | 690 | if (!tonumber(pstep, ra+2)) |
691 | luaG_runerror(L, "`for' step must be a number"); | 691 | luaG_runerror(L, "`for' step must be a number"); |
692 | step = nvalue(pstep); | 692 | step = nvalue(pstep); |
693 | index = nvalue(ra) + step; /* increment index */ | 693 | idx = nvalue(ra) + step; /* increment index */ |
694 | limit = nvalue(plimit); | 694 | limit = nvalue(plimit); |
695 | if (step > 0 ? index <= limit : index >= limit) { | 695 | if (step > 0 ? idx <= limit : idx >= limit) { |
696 | dojump(pc, GETARG_sBx(i)); /* jump back */ | 696 | dojump(pc, GETARG_sBx(i)); /* jump back */ |
697 | chgnvalue(ra, index); /* update index */ | 697 | chgnvalue(ra, idx); /* update index */ |
698 | } | 698 | } |
699 | break; | 699 | break; |
700 | } | 700 | } |