diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-06-05 17:15:33 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-06-05 17:15:33 -0300 |
| commit | 292c9530183a8e9939cff9a7d30fc50e85031698 (patch) | |
| tree | 20dc1c90af03ef60396d6a8df737369fb8238f21 /lbuiltin.c | |
| parent | c542aac0b935a65203244c130cdfa700113f0bc8 (diff) | |
| download | lua-292c9530183a8e9939cff9a7d30fc50e85031698.tar.gz lua-292c9530183a8e9939cff9a7d30fc50e85031698.tar.bz2 lua-292c9530183a8e9939cff9a7d30fc50e85031698.zip | |
new auxiliar function `luaH_setstr'
Diffstat (limited to 'lbuiltin.c')
| -rw-r--r-- | lbuiltin.c | 9 |
1 files changed, 2 insertions, 7 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lbuiltin.c,v 1.111 2000/05/26 19:17:57 roberto Exp roberto $ | 2 | ** $Id: lbuiltin.c,v 1.112 2000/06/02 19:08:56 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 | */ |
| @@ -68,12 +68,7 @@ static Number getsize (const Hash *h) { | |||
| 68 | 68 | ||
| 69 | 69 | ||
| 70 | static Number getnarg (lua_State *L, const Hash *a) { | 70 | static Number getnarg (lua_State *L, const Hash *a) { |
| 71 | TObject index; | 71 | const TObject *value = luaH_getstr(a, luaS_new(L, "n")); /* value = a.n */ |
| 72 | const TObject *value; | ||
| 73 | /* value = table.n */ | ||
| 74 | ttype(&index) = TAG_STRING; | ||
| 75 | tsvalue(&index) = luaS_new(L, "n"); | ||
| 76 | value = luaH_get(L, a, &index); | ||
| 77 | return (ttype(value) == TAG_NUMBER) ? nvalue(value) : getsize(a); | 72 | return (ttype(value) == TAG_NUMBER) ? nvalue(value) : getsize(a); |
| 78 | } | 73 | } |
| 79 | 74 | ||
