diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2005-03-09 13:28:07 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2005-03-09 13:28:07 -0300 |
commit | 370d31a5593220723d222dec6e3e4019decc3309 (patch) | |
tree | e04ad903d079da2feea0b1759e89b65d1a70815c /ltable.c | |
parent | f8df21bd2071c4e3729d37d1552f54ca2742551a (diff) | |
download | lua-370d31a5593220723d222dec6e3e4019decc3309.tar.gz lua-370d31a5593220723d222dec6e3e4019decc3309.tar.bz2 lua-370d31a5593220723d222dec6e3e4019decc3309.zip |
`luacĀ“ -> `luai' (to avoid confusion with other luac stuff)
Diffstat (limited to 'ltable.c')
-rw-r--r-- | ltable.c | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ltable.c,v 2.16 2005/03/08 18:09:16 roberto Exp roberto $ | 2 | ** $Id: ltable.c,v 2.17 2005/03/08 20:10:05 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 | */ |
@@ -38,10 +38,10 @@ | |||
38 | /* | 38 | /* |
39 | ** max size of array part is 2^MAXBITS | 39 | ** max size of array part is 2^MAXBITS |
40 | */ | 40 | */ |
41 | #if LUAC_BITSINT > 26 | 41 | #if LUAI_BITSINT > 26 |
42 | #define MAXBITS 26 | 42 | #define MAXBITS 26 |
43 | #else | 43 | #else |
44 | #define MAXBITS (LUAC_BITSINT-2) | 44 | #define MAXBITS (LUAI_BITSINT-2) |
45 | #endif | 45 | #endif |
46 | 46 | ||
47 | #define MAXASIZE (1 << MAXBITS) | 47 | #define MAXASIZE (1 << MAXBITS) |
@@ -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 (luac_numeq(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)) && luac_numeq(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); |
@@ -470,7 +470,7 @@ const TValue *luaH_get (Table *t, const TValue *key) { | |||
470 | case LUA_TNUMBER: { | 470 | case LUA_TNUMBER: { |
471 | int k; | 471 | int k; |
472 | lua_number2int(k, (nvalue(key))); | 472 | lua_number2int(k, (nvalue(key))); |
473 | if (luac_numeq(cast(lua_Number, k), nvalue(key))) /* index is integer? */ | 473 | if (luai_numeq(cast(lua_Number, k), nvalue(key))) /* index is integer? */ |
474 | return luaH_getnum(t, k); /* use specialized version */ | 474 | return luaH_getnum(t, k); /* use specialized version */ |
475 | /* else go through */ | 475 | /* else go through */ |
476 | } | 476 | } |
@@ -494,7 +494,7 @@ TValue *luaH_set (lua_State *L, Table *t, const TValue *key) { | |||
494 | return cast(TValue *, p); | 494 | return cast(TValue *, p); |
495 | else { | 495 | else { |
496 | if (ttisnil(key)) luaG_runerror(L, "table index is nil"); | 496 | if (ttisnil(key)) luaG_runerror(L, "table index is nil"); |
497 | else if (ttisnumber(key) && !luac_numeq(nvalue(key), nvalue(key))) | 497 | else if (ttisnumber(key) && !luai_numeq(nvalue(key), nvalue(key))) |
498 | luaG_runerror(L, "table index is NaN"); | 498 | luaG_runerror(L, "table index is NaN"); |
499 | return newkey(L, t, key); | 499 | return newkey(L, t, key); |
500 | } | 500 | } |