This commit is contained in:
Roberto Ierusalimschy 2006-01-10 10:50:00 -02:00
parent bfdcbbcd76
commit dd1221582b
5 changed files with 16 additions and 17 deletions

17
lapi.c
View File

@ -1,5 +1,5 @@
/*
** $Id: lapi.c,v 2.51 2005/10/20 11:35:50 roberto Exp roberto $
** $Id: lapi.c,v 2.52 2005/12/22 16:19:56 roberto Exp roberto $
** Lua API
** See Copyright Notice in lua.h
*/
@ -40,7 +40,7 @@ const char lua_ident[] =
#define api_checknelems(L, n) api_check(L, (n) <= (L->top - L->base))
#define api_checkvalidindex(L, i) api_check(L, (i) != &luaO_nilobject)
#define api_checkvalidindex(L, i) api_check(L, (i) != luaO_nilobject)
#define api_incr_top(L) {api_check(L, L->top < L->ci->top); L->top++;}
@ -50,7 +50,7 @@ static TValue *index2adr (lua_State *L, int idx) {
if (idx > 0) {
TValue *o = L->base + (idx - 1);
api_check(L, idx <= L->ci->top - L->base);
if (o >= L->top) return cast(TValue *, &luaO_nilobject);
if (o >= L->top) return cast(TValue *, luaO_nilobject);
else return o;
}
else if (idx > LUA_REGISTRYINDEX) {
@ -70,7 +70,7 @@ static TValue *index2adr (lua_State *L, int idx) {
idx = LUA_GLOBALSINDEX - idx;
return (idx <= func->c.nupvalues)
? &func->c.upvalue[idx-1]
: cast(TValue *, &luaO_nilobject);
: cast(TValue *, luaO_nilobject);
}
}
}
@ -234,7 +234,7 @@ LUA_API void lua_pushvalue (lua_State *L, int idx) {
LUA_API int lua_type (lua_State *L, int idx) {
StkId o = index2adr(L, idx);
return (o == &luaO_nilobject) ? LUA_TNONE : ttype(o);
return (o == luaO_nilobject) ? LUA_TNONE : ttype(o);
}
@ -272,7 +272,7 @@ LUA_API int lua_isuserdata (lua_State *L, int idx) {
LUA_API int lua_rawequal (lua_State *L, int index1, int index2) {
StkId o1 = index2adr(L, index1);
StkId o2 = index2adr(L, index2);
return (o1 == &luaO_nilobject || o2 == &luaO_nilobject) ? 0
return (o1 == luaO_nilobject || o2 == luaO_nilobject) ? 0
: luaO_rawequalObj(o1, o2);
}
@ -283,8 +283,7 @@ LUA_API int lua_equal (lua_State *L, int index1, int index2) {
lua_lock(L); /* may call tag method */
o1 = index2adr(L, index1);
o2 = index2adr(L, index2);
i = (o1 == &luaO_nilobject || o2 == &luaO_nilobject) ? 0
: equalobj(L, o1, o2);
i = (o1 == luaO_nilobject || o2 == luaO_nilobject) ? 0 : equalobj(L, o1, o2);
lua_unlock(L);
return i;
}
@ -296,7 +295,7 @@ LUA_API int lua_lessthan (lua_State *L, int index1, int index2) {
lua_lock(L); /* may call tag method */
o1 = index2adr(L, index1);
o2 = index2adr(L, index2);
i = (o1 == &luaO_nilobject || o2 == &luaO_nilobject) ? 0
i = (o1 == luaO_nilobject || o2 == luaO_nilobject) ? 0
: luaV_lessthan(L, o1, o2);
lua_unlock(L);
return i;

View File

@ -1,5 +1,5 @@
/*
** $Id: lobject.c,v 2.19 2005/10/24 17:37:52 roberto Exp roberto $
** $Id: lobject.c,v 2.20 2005/12/22 16:19:56 roberto Exp roberto $
** Some generic functions over Lua objects
** See Copyright Notice in lua.h
*/
@ -24,7 +24,7 @@
const TValue luaO_nilobject = {{NULL}, LUA_TNIL};
const TValue luaO_nilobject_ = {{NULL}, LUA_TNIL};
/*

View File

@ -1,5 +1,5 @@
/*
** $Id: ltests.c,v 2.33 2005/10/06 20:47:32 roberto Exp roberto $
** $Id: ltests.c,v 2.34 2005/12/22 16:19:56 roberto Exp roberto $
** Internal Module for Debugging of the Lua Implementation
** See Copyright Notice in lua.h
*/
@ -564,7 +564,7 @@ static int table_query (lua_State *L) {
t = hvalue(obj_at(L, 1));
if (i == -1) {
lua_pushinteger(L, t->sizearray);
lua_pushinteger(L, t->node == &luaH_dummynode ? 0 : sizenode(t));
lua_pushinteger(L, t->node == luaH_dummynode ? 0 : sizenode(t));
lua_pushinteger(L, t->lastfree - t->node);
}
else if (i < t->sizearray) {

4
ltm.c
View File

@ -1,5 +1,5 @@
/*
** $Id: ltm.c,v 2.6 2005/05/20 15:53:42 roberto Exp roberto $
** $Id: ltm.c,v 2.7 2005/12/22 16:19:56 roberto Exp roberto $
** Tag methods
** See Copyright Notice in lua.h
*/
@ -70,6 +70,6 @@ const TValue *luaT_gettmbyobj (lua_State *L, const TValue *o, TMS event) {
default:
mt = G(L)->mt[ttype(o)];
}
return (mt ? luaH_getstr(mt, G(L)->tmname[event]) : &luaO_nilobject);
return (mt ? luaH_getstr(mt, G(L)->tmname[event]) : luaO_nilobject);
}

4
lvm.c
View File

@ -1,5 +1,5 @@
/*
** $Id: lvm.c,v 2.59 2005/11/01 16:08:45 roberto Exp roberto $
** $Id: lvm.c,v 2.60 2005/12/22 16:19:56 roberto Exp roberto $
** Lua virtual machine
** See Copyright Notice in lua.h
*/
@ -518,7 +518,7 @@ void luaV_execute (lua_State *L, int nexeccalls) {
}
default: { /* try metamethod */
Protect(
if (!call_binTM(L, rb, &luaO_nilobject, ra, TM_LEN))
if (!call_binTM(L, rb, luaO_nilobject, ra, TM_LEN))
luaG_typeerror(L, rb, "get length of");
)
}