diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1999-09-20 11:57:29 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1999-09-20 11:57:29 -0300 |
| commit | 04265655a8cda2d3402c339fc388f0b225c142fb (patch) | |
| tree | 5439f3216fd9d2738c3343f443d839a0059c1628 /lbuiltin.c | |
| parent | e10788b2ff735916bbf6b4ba0e040a4568658ca3 (diff) | |
| download | lua-04265655a8cda2d3402c339fc388f0b225c142fb.tar.gz lua-04265655a8cda2d3402c339fc388f0b225c142fb.tar.bz2 lua-04265655a8cda2d3402c339fc388f0b225c142fb.zip | |
compatibility with old fallback system now provided by external module
Diffstat (limited to 'lbuiltin.c')
| -rw-r--r-- | lbuiltin.c | 12 |
1 files changed, 5 insertions, 7 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lbuiltin.c,v 1.61 1999/08/16 20:52:00 roberto Exp roberto $ | 2 | ** $Id: lbuiltin.c,v 1.62 1999/09/08 20:45:18 roberto Exp roberto $ |
| 3 | ** Built-in functions | 3 | ** Built-in functions |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -44,13 +44,14 @@ static void pushtagstring (TaggedString *s) { | |||
| 44 | 44 | ||
| 45 | static real getsize (const Hash *h) { | 45 | static real getsize (const Hash *h) { |
| 46 | real max = 0; | 46 | real max = 0; |
| 47 | int i; | 47 | int i = nhash(h); |
| 48 | for (i = 0; i<nhash(h); i++) { | 48 | Node *n = h->node; |
| 49 | Node *n = h->node+i; | 49 | while (i--) { |
| 50 | if (ttype(ref(n)) == LUA_T_NUMBER && | 50 | if (ttype(ref(n)) == LUA_T_NUMBER && |
| 51 | ttype(val(n)) != LUA_T_NIL && | 51 | ttype(val(n)) != LUA_T_NIL && |
| 52 | nvalue(ref(n)) > max) | 52 | nvalue(ref(n)) > max) |
| 53 | max = nvalue(ref(n)); | 53 | max = nvalue(ref(n)); |
| 54 | n++; | ||
| 54 | } | 55 | } |
| 55 | return max; | 56 | return max; |
| 56 | } | 57 | } |
| @@ -677,9 +678,6 @@ static void testC (void) { | |||
| 677 | 678 | ||
| 678 | 679 | ||
| 679 | static const struct luaL_reg builtin_funcs[] = { | 680 | static const struct luaL_reg builtin_funcs[] = { |
| 680 | #ifdef LUA_COMPAT2_5 | ||
| 681 | {"setfallback", luaT_setfallback}, | ||
| 682 | #endif | ||
| 683 | #ifdef DEBUG | 681 | #ifdef DEBUG |
| 684 | {"testC", testC}, | 682 | {"testC", testC}, |
| 685 | {"totalmem", mem_query}, | 683 | {"totalmem", mem_query}, |
