From 1a343814d8da9f9c2067d6ca3d82d57c84f91f10 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Sun, 31 Jul 2005 14:12:32 -0300 Subject: [PATCH] details --- lapi.c | 10 +++++----- lobject.c | 7 +++---- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/lapi.c b/lapi.c index e401b7b1..6efdb505 100644 --- a/lapi.c +++ b/lapi.c @@ -1,5 +1,5 @@ /* -** $Id: lapi.c,v 2.44 2005/07/05 14:30:31 roberto Exp roberto $ +** $Id: lapi.c,v 2.45 2005/07/06 18:07:30 roberto Exp roberto $ ** Lua API ** See Copyright Notice in lua.h */ @@ -113,11 +113,11 @@ LUA_API void lua_xmove (lua_State *from, lua_State *to, int n) { if (from == to) return; lua_lock(to); api_checknelems(from, n); - api_check(L, G(from) == G(to)); + api_check(from, G(from) == G(to)); + api_check(from, to->ci->top - to->top >= n); from->top -= n; for (i = 0; i < n; i++) { - setobj2s(to, to->top, from->top + i); - api_incr_top(to); + setobj2s(to, to->top++, from->top + i); } lua_unlock(to); } @@ -975,9 +975,9 @@ LUA_API int lua_next (lua_State *L, int idx) { LUA_API void lua_concat (lua_State *L, int n) { lua_lock(L); - luaC_checkGC(L); api_checknelems(L, n); if (n >= 2) { + luaC_checkGC(L); luaV_concat(L, n, cast(int, L->top - L->base) - 1); L->top -= (n-1); } diff --git a/lobject.c b/lobject.c index fd522394..1f8a018c 100644 --- a/lobject.c +++ b/lobject.c @@ -1,5 +1,5 @@ /* -** $Id: lobject.c,v 2.15 2005/05/31 14:25:18 roberto Exp roberto $ +** $Id: lobject.c,v 2.16 2005/07/11 14:00:14 roberto Exp roberto $ ** Some generic functions over Lua objects ** See Copyright Notice in lua.h */ @@ -89,11 +89,10 @@ int luaO_rawequalObj (const TValue *t1, const TValue *t2) { int luaO_str2d (const char *s, lua_Number *result) { char *endptr; - lua_Number res = lua_str2number(s, &endptr); - if (endptr == s) return 0; /* no conversion */ + *result = lua_str2number(s, &endptr); + if (endptr == s) return 0; /* conversion failed */ while (isspace(cast(unsigned char, *endptr))) endptr++; if (*endptr != '\0') return 0; /* invalid trailing characters? */ - *result = res; return 1; }