aboutsummaryrefslogtreecommitdiff
path: root/lref.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2000-03-03 11:58:26 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2000-03-03 11:58:26 -0300
commit3c9d999424520c809e05bee11d81788b488434f6 (patch)
tree7556d9ea10bda42b226aec4dd956753467cc0864 /lref.c
parentf7840a3e0bc07813246b2bad6bf4579848187908 (diff)
downloadlua-3c9d999424520c809e05bee11d81788b488434f6.tar.gz
lua-3c9d999424520c809e05bee11d81788b488434f6.tar.bz2
lua-3c9d999424520c809e05bee11d81788b488434f6.zip
many details (most by lhf).
Diffstat (limited to 'lref.c')
-rw-r--r--lref.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/lref.c b/lref.c
index 2bfa773f..eeb720a2 100644
--- a/lref.c
+++ b/lref.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lref.c,v 1.6 1999/12/27 17:33:22 roberto Exp roberto $ 2** $Id: lref.c,v 1.7 2000/02/08 16:34:31 roberto Exp roberto $
3** reference mechanism 3** reference mechanism
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -16,7 +16,7 @@
16 16
17int lua_ref (lua_State *L, int lock) { 17int lua_ref (lua_State *L, int lock) {
18 int ref; 18 int ref;
19 luaA_checkCparams(L, 1); 19 luaA_checkCargs(L, 1);
20 if (ttype(L->top-1) == LUA_T_NIL) 20 if (ttype(L->top-1) == LUA_T_NIL)
21 ref = LUA_REFNIL; 21 ref = LUA_REFNIL;
22 else { 22 else {
@@ -39,7 +39,8 @@ int lua_ref (lua_State *L, int lock) {
39void lua_unref (lua_State *L, int ref) { 39void lua_unref (lua_State *L, int ref) {
40 if (ref >= 0) { 40 if (ref >= 0) {
41 if (ref >= L->refSize || L->refArray[ref].st >= 0) 41 if (ref >= L->refSize || L->refArray[ref].st >= 0)
42 lua_error(L, "API error - invalid parameter for function `lua_unref'"); 42 lua_error(L, "Lua API error - "
43 "invalid argument for function `lua_unref'");
43 L->refArray[ref].st = L->refFree; 44 L->refArray[ref].st = L->refFree;
44 L->refFree = ref; 45 L->refFree = ref;
45 } 46 }
@@ -67,7 +68,7 @@ void lua_beginblock (lua_State *L) {
67 68
68void lua_endblock (lua_State *L) { 69void lua_endblock (lua_State *L) {
69 if (L->numCblocks <= 0) 70 if (L->numCblocks <= 0)
70 lua_error(L, "API error - no block to end"); 71 lua_error(L, "Lua API error - no block to end");
71 --L->numCblocks; 72 --L->numCblocks;
72 L->Cstack = L->Cblocks[L->numCblocks]; 73 L->Cstack = L->Cblocks[L->numCblocks];
73 L->top = L->Cstack.base; 74 L->top = L->Cstack.base;