summaryrefslogtreecommitdiff
path: root/lbaselib.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2001-06-06 15:00:19 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2001-06-06 15:00:19 -0300
commitd5b83ead90fba27faa344c72406d85987d2460a4 (patch)
tree96d73c1b872b6b01a28c0586b871d37185034ba9 /lbaselib.c
parentda673d31aaa05e8dff60c0b601b9f15c4f9182a8 (diff)
downloadlua-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.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lbaselib.c b/lbaselib.c
index 78fd6795..2c41aae1 100644
--- a/lbaselib.c
+++ b/lbaselib.c
@@ -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
172static int luaB_weakmode (lua_State *L) { 172static 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 }