diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-10-25 09:50:46 -0200 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-10-25 09:50:46 -0200 |
| commit | bdf566a8a32450c2eb6273c8c1a92e2181b6846e (patch) | |
| tree | b301da541fbad81034216a6e0465cc381082431e /lvm.c | |
| parent | c3c78030f79fdbbb06265d50645e408d60e7798e (diff) | |
| download | lua-bdf566a8a32450c2eb6273c8c1a92e2181b6846e.tar.gz lua-bdf566a8a32450c2eb6273c8c1a92e2181b6846e.tar.bz2 lua-bdf566a8a32450c2eb6273c8c1a92e2181b6846e.zip | |
`name' in comments changed to 'name'
Diffstat (limited to 'lvm.c')
| -rw-r--r-- | lvm.c | 18 |
1 files changed, 9 insertions, 9 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lvm.c,v 2.224 2014/10/17 16:28:21 roberto Exp roberto $ | 2 | ** $Id: lvm.c,v 2.225 2014/10/24 11:42:06 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 | */ |
| @@ -158,7 +158,7 @@ void luaV_gettable (lua_State *L, const TValue *t, TValue *key, StkId val) { | |||
| 158 | int loop; /* counter to avoid infinite loops */ | 158 | int loop; /* counter to avoid infinite loops */ |
| 159 | for (loop = 0; loop < MAXTAGLOOP; loop++) { | 159 | for (loop = 0; loop < MAXTAGLOOP; loop++) { |
| 160 | const TValue *tm; | 160 | const TValue *tm; |
| 161 | if (ttistable(t)) { /* `t' is a table? */ | 161 | if (ttistable(t)) { /* 't' is a table? */ |
| 162 | Table *h = hvalue(t); | 162 | Table *h = hvalue(t); |
| 163 | const TValue *res = luaH_get(h, key); /* do a primitive get */ | 163 | const TValue *res = luaH_get(h, key); /* do a primitive get */ |
| 164 | if (!ttisnil(res) || /* result is not nil? */ | 164 | if (!ttisnil(res) || /* result is not nil? */ |
| @@ -188,7 +188,7 @@ void luaV_settable (lua_State *L, const TValue *t, TValue *key, StkId val) { | |||
| 188 | int loop; /* counter to avoid infinite loops */ | 188 | int loop; /* counter to avoid infinite loops */ |
| 189 | for (loop = 0; loop < MAXTAGLOOP; loop++) { | 189 | for (loop = 0; loop < MAXTAGLOOP; loop++) { |
| 190 | const TValue *tm; | 190 | const TValue *tm; |
| 191 | if (ttistable(t)) { /* `t' is a table? */ | 191 | if (ttistable(t)) { /* 't' is a table? */ |
| 192 | Table *h = hvalue(t); | 192 | Table *h = hvalue(t); |
| 193 | TValue *oldval = cast(TValue *, luaH_get(h, key)); | 193 | TValue *oldval = cast(TValue *, luaH_get(h, key)); |
| 194 | /* if previous value is not nil, there must be a previous entry | 194 | /* if previous value is not nil, there must be a previous entry |
| @@ -240,12 +240,12 @@ static int l_strcmp (const TString *ls, const TString *rs) { | |||
| 240 | if (temp != 0) /* not equal? */ | 240 | if (temp != 0) /* not equal? */ |
| 241 | return temp; /* done */ | 241 | return temp; /* done */ |
| 242 | else { /* strings are equal up to a '\0' */ | 242 | else { /* strings are equal up to a '\0' */ |
| 243 | size_t len = strlen(l); /* index of first `\0' in both strings */ | 243 | size_t len = strlen(l); /* index of first '\0' in both strings */ |
| 244 | if (len == lr) /* 'rs' is finished? */ | 244 | if (len == lr) /* 'rs' is finished? */ |
| 245 | return (len == ll) ? 0 : 1; /* check 'ls' */ | 245 | return (len == ll) ? 0 : 1; /* check 'ls' */ |
| 246 | else if (len == ll) /* 'ls' is finished? */ | 246 | else if (len == ll) /* 'ls' is finished? */ |
| 247 | return -1; /* 'ls' is smaller than 'rs' ('rs' is not finished) */ | 247 | return -1; /* 'ls' is smaller than 'rs' ('rs' is not finished) */ |
| 248 | /* both strings longer than `len'; go on comparing after the '\0' */ | 248 | /* both strings longer than 'len'; go on comparing after the '\0' */ |
| 249 | len++; | 249 | len++; |
| 250 | l += len; ll -= len; r += len; lr -= len; | 250 | l += len; ll -= len; r += len; lr -= len; |
| 251 | } | 251 | } |
| @@ -283,9 +283,9 @@ int luaV_lessequal (lua_State *L, const TValue *l, const TValue *r) { | |||
| 283 | return luai_numle(nl, nr); | 283 | return luai_numle(nl, nr); |
| 284 | else if (ttisstring(l) && ttisstring(r)) /* both are strings? */ | 284 | else if (ttisstring(l) && ttisstring(r)) /* both are strings? */ |
| 285 | return l_strcmp(tsvalue(l), tsvalue(r)) <= 0; | 285 | return l_strcmp(tsvalue(l), tsvalue(r)) <= 0; |
| 286 | else if ((res = luaT_callorderTM(L, l, r, TM_LE)) >= 0) /* first try `le' */ | 286 | else if ((res = luaT_callorderTM(L, l, r, TM_LE)) >= 0) /* first try 'le' */ |
| 287 | return res; | 287 | return res; |
| 288 | else if ((res = luaT_callorderTM(L, r, l, TM_LT)) < 0) /* else try `lt' */ | 288 | else if ((res = luaT_callorderTM(L, r, l, TM_LT)) < 0) /* else try 'lt' */ |
| 289 | luaG_ordererror(L, l, r); | 289 | luaG_ordererror(L, l, r); |
| 290 | return !res; | 290 | return !res; |
| 291 | } | 291 | } |
| @@ -596,7 +596,7 @@ void luaV_finishOp (lua_State *L) { | |||
| 596 | 596 | ||
| 597 | 597 | ||
| 598 | /* | 598 | /* |
| 599 | ** some macros for common tasks in `luaV_execute' | 599 | ** some macros for common tasks in 'luaV_execute' |
| 600 | */ | 600 | */ |
| 601 | 601 | ||
| 602 | #if !defined luai_runtimecheck | 602 | #if !defined luai_runtimecheck |
| @@ -657,7 +657,7 @@ void luaV_execute (lua_State *L) { | |||
| 657 | (--L->hookcount == 0 || L->hookmask & LUA_MASKLINE)) { | 657 | (--L->hookcount == 0 || L->hookmask & LUA_MASKLINE)) { |
| 658 | Protect(luaG_traceexec(L)); | 658 | Protect(luaG_traceexec(L)); |
| 659 | } | 659 | } |
| 660 | /* WARNING: several calls may realloc the stack and invalidate `ra' */ | 660 | /* WARNING: several calls may realloc the stack and invalidate 'ra' */ |
| 661 | ra = RA(i); | 661 | ra = RA(i); |
| 662 | lua_assert(base == ci->u.l.base); | 662 | lua_assert(base == ci->u.l.base); |
| 663 | lua_assert(base <= L->top && L->top < L->stack + L->stacksize); | 663 | lua_assert(base <= L->top && L->top < L->stack + L->stacksize); |
