aboutsummaryrefslogtreecommitdiff
path: root/ltable.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2005-10-24 15:37:52 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2005-10-24 15:37:52 -0200
commit8e48ebb638594bdf38e992e042a256a713856c18 (patch)
treebe260052f1319450f084e67ea9bad716e01473da /ltable.c
parentc2bd68d2c368d748e262af18fe4dedfd6c2dd8a2 (diff)
downloadlua-8e48ebb638594bdf38e992e042a256a713856c18.tar.gz
lua-8e48ebb638594bdf38e992e042a256a713856c18.tar.bz2
lua-8e48ebb638594bdf38e992e042a256a713856c18.zip
no more L in numer-operator macros (some functions that use those macros
have no access to L)
Diffstat (limited to 'ltable.c')
-rw-r--r--ltable.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/ltable.c b/ltable.c
index 73b59328..b640a809 100644
--- a/ltable.c
+++ b/ltable.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ltable.c,v 2.25 2005/05/31 14:25:18 roberto Exp roberto $ 2** $Id: ltable.c,v 2.26 2005/07/11 14:01:37 roberto Exp roberto $
3** Lua tables (hash) 3** Lua tables (hash)
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -120,7 +120,7 @@ static int arrayindex (const TValue *key) {
120 lua_Number n = nvalue(key); 120 lua_Number n = nvalue(key);
121 int k; 121 int k;
122 lua_number2int(k, n); 122 lua_number2int(k, n);
123 if (luai_numeq(L, cast(lua_Number, k), nvalue(key))) 123 if (luai_numeq(cast(lua_Number, k), nvalue(key)))
124 return k; 124 return k;
125 } 125 }
126 return -1; /* `key' did not match some condition */ 126 return -1; /* `key' did not match some condition */
@@ -437,7 +437,7 @@ const TValue *luaH_getnum (Table *t, int key) {
437 lua_Number nk = cast(lua_Number, key); 437 lua_Number nk = cast(lua_Number, key);
438 Node *n = hashnum(t, nk); 438 Node *n = hashnum(t, nk);
439 do { /* check whether `key' is somewhere in the chain */ 439 do { /* check whether `key' is somewhere in the chain */
440 if (ttisnumber(gkey(n)) && luai_numeq(L, nvalue(gkey(n)), nk)) 440 if (ttisnumber(gkey(n)) && luai_numeq(nvalue(gkey(n)), nk))
441 return gval(n); /* that's it */ 441 return gval(n); /* that's it */
442 else n = gnext(n); 442 else n = gnext(n);
443 } while (n); 443 } while (n);
@@ -471,7 +471,7 @@ const TValue *luaH_get (Table *t, const TValue *key) {
471 int k; 471 int k;
472 lua_Number n = nvalue(key); 472 lua_Number n = nvalue(key);
473 lua_number2int(k, n); 473 lua_number2int(k, n);
474 if (luai_numeq(L, cast(lua_Number, k), nvalue(key))) /* index is int? */ 474 if (luai_numeq(cast(lua_Number, k), nvalue(key))) /* index is int? */
475 return luaH_getnum(t, k); /* use specialized version */ 475 return luaH_getnum(t, k); /* use specialized version */
476 /* else go through */ 476 /* else go through */
477 } 477 }
@@ -495,7 +495,7 @@ TValue *luaH_set (lua_State *L, Table *t, const TValue *key) {
495 return cast(TValue *, p); 495 return cast(TValue *, p);
496 else { 496 else {
497 if (ttisnil(key)) luaG_runerror(L, "table index is nil"); 497 if (ttisnil(key)) luaG_runerror(L, "table index is nil");
498 else if (ttisnumber(key) && !luai_numeq(L, nvalue(key), nvalue(key))) 498 else if (ttisnumber(key) && !luai_numeq(nvalue(key), nvalue(key)))
499 luaG_runerror(L, "table index is NaN"); 499 luaG_runerror(L, "table index is NaN");
500 return newkey(L, t, key); 500 return newkey(L, t, key);
501 } 501 }