diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-03-03 11:58:26 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-03-03 11:58:26 -0300 |
commit | 3c9d999424520c809e05bee11d81788b488434f6 (patch) | |
tree | 7556d9ea10bda42b226aec4dd956753467cc0864 /lref.c | |
parent | f7840a3e0bc07813246b2bad6bf4579848187908 (diff) | |
download | lua-3c9d999424520c809e05bee11d81788b488434f6.tar.gz lua-3c9d999424520c809e05bee11d81788b488434f6.tar.bz2 lua-3c9d999424520c809e05bee11d81788b488434f6.zip |
many details (most by lhf).
Diffstat (limited to 'lref.c')
-rw-r--r-- | lref.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -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 | ||
17 | int lua_ref (lua_State *L, int lock) { | 17 | int 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) { | |||
39 | void lua_unref (lua_State *L, int ref) { | 39 | void 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 | ||
68 | void lua_endblock (lua_State *L) { | 69 | void 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; |