diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-06-06 15:00:19 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-06-06 15:00:19 -0300 |
commit | d5b83ead90fba27faa344c72406d85987d2460a4 (patch) | |
tree | 96d73c1b872b6b01a28c0586b871d37185034ba9 /lbaselib.c | |
parent | da673d31aaa05e8dff60c0b601b9f15c4f9182a8 (diff) | |
download | lua-d5b83ead90fba27faa344c72406d85987d2460a4.tar.gz lua-d5b83ead90fba27faa344c72406d85987d2460a4.tar.bz2 lua-d5b83ead90fba27faa344c72406d85987d2460a4.zip |
new implementation for userdatas, without `keys'
Diffstat (limited to 'lbaselib.c')
-rw-r--r-- | lbaselib.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lbaselib.c,v 1.35 2001/04/23 16:35:45 roberto Exp roberto $ | 2 | ** $Id: lbaselib.c,v 1.36 2001/06/05 19:41:31 roberto Exp roberto $ |
3 | ** Basic library | 3 | ** Basic library |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -170,11 +170,11 @@ static int luaB_settag (lua_State *L) { | |||
170 | } | 170 | } |
171 | 171 | ||
172 | static int luaB_weakmode (lua_State *L) { | 172 | static int luaB_weakmode (lua_State *L) { |
173 | const char *mode = luaL_check_string(L, 2); | 173 | const l_char *mode = luaL_check_string(L, 2); |
174 | luaL_checktype(L, 1, LUA_TTABLE); | 174 | luaL_checktype(L, 1, LUA_TTABLE); |
175 | if (*mode == l_c('?')) { | 175 | if (*mode == l_c('?')) { |
176 | char buff[3]; | 176 | l_char buff[3]; |
177 | char *s = buff; | 177 | l_char *s = buff; |
178 | int imode = lua_getweakmode(L, 1); | 178 | int imode = lua_getweakmode(L, 1); |
179 | if (imode & LUA_WEAK_KEY) *s++ = 'k'; | 179 | if (imode & LUA_WEAK_KEY) *s++ = 'k'; |
180 | if (imode & LUA_WEAK_VALUE) *s++ = 'v'; | 180 | if (imode & LUA_WEAK_VALUE) *s++ = 'v'; |
@@ -300,7 +300,7 @@ static int passresults (lua_State *L, int status, int oldtop) { | |||
300 | if (nresults > 0) | 300 | if (nresults > 0) |
301 | return nresults; /* results are already on the stack */ | 301 | return nresults; /* results are already on the stack */ |
302 | else { | 302 | else { |
303 | lua_pushuserdata(L, NULL); /* at least one result to signal no errors */ | 303 | lua_newuserdatabox(L, NULL); /* at least one result to signal no errors */ |
304 | return 1; | 304 | return 1; |
305 | } | 305 | } |
306 | } | 306 | } |