aboutsummaryrefslogtreecommitdiff
path: root/ldo.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2005-03-08 17:10:05 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2005-03-08 17:10:05 -0300
commitf8df21bd2071c4e3729d37d1552f54ca2742551a (patch)
tree6d85e7fd9f86bfb6879c0edd60780b1f40325027 /ldo.c
parentd3902cfa81021bca0a8c30b3ad79a1e2367f6621 (diff)
downloadlua-f8df21bd2071c4e3729d37d1552f54ca2742551a.tar.gz
lua-f8df21bd2071c4e3729d37d1552f54ca2742551a.tar.bz2
lua-f8df21bd2071c4e3729d37d1552f54ca2742551a.zip
`luaconf.h´ exports all its definitions always (so all of them
must have a lua/LUA prefix).
Diffstat (limited to 'ldo.c')
-rw-r--r--ldo.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/ldo.c b/ldo.c
index cf1bd65a..94a75ed0 100644
--- a/ldo.c
+++ b/ldo.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ldo.c,v 2.14 2005/02/18 12:40:02 roberto Exp roberto $ 2** $Id: ldo.c,v 2.15 2005/03/08 18:09:16 roberto Exp roberto $
3** Stack and Call structure of Lua 3** Stack and Call structure of Lua
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -43,7 +43,7 @@
43/* chain list of long jump buffers */ 43/* chain list of long jump buffers */
44struct lua_longjmp { 44struct lua_longjmp {
45 struct lua_longjmp *previous; 45 struct lua_longjmp *previous;
46 l_jmpbuf b; 46 luac_jmpbuf b;
47 volatile int status; /* error code */ 47 volatile int status; /* error code */
48}; 48};
49 49
@@ -71,7 +71,7 @@ static void seterrorobj (lua_State *L, int errcode, StkId oldtop) {
71void luaD_throw (lua_State *L, int errcode) { 71void luaD_throw (lua_State *L, int errcode) {
72 if (L->errorJmp) { 72 if (L->errorJmp) {
73 L->errorJmp->status = errcode; 73 L->errorJmp->status = errcode;
74 L_THROW(L, L->errorJmp); 74 LUAC_THROW(L, L->errorJmp);
75 } 75 }
76 else { 76 else {
77 if (G(L)->panic) G(L)->panic(L); 77 if (G(L)->panic) G(L)->panic(L);
@@ -85,7 +85,7 @@ int luaD_rawrunprotected (lua_State *L, Pfunc f, void *ud) {
85 lj.status = 0; 85 lj.status = 0;
86 lj.previous = L->errorJmp; /* chain new error handler */ 86 lj.previous = L->errorJmp; /* chain new error handler */
87 L->errorJmp = &lj; 87 L->errorJmp = &lj;
88 L_TRY(L, &lj, 88 LUAC_TRY(L, &lj,
89 (*f)(L, ud); 89 (*f)(L, ud);
90 ); 90 );
91 L->errorJmp = lj.previous; /* restore old error handler */ 91 L->errorJmp = lj.previous; /* restore old error handler */
@@ -95,10 +95,10 @@ int luaD_rawrunprotected (lua_State *L, Pfunc f, void *ud) {
95 95
96static void restore_stack_limit (lua_State *L) { 96static void restore_stack_limit (lua_State *L) {
97 lua_assert(L->stack_last - L->stack == L->stacksize - EXTRA_STACK - 1); 97 lua_assert(L->stack_last - L->stack == L->stacksize - EXTRA_STACK - 1);
98 if (L->size_ci > LUA_MAXCALLS) { /* there was an overflow? */ 98 if (L->size_ci > LUAC_MAXCALLS) { /* there was an overflow? */
99 int inuse = (L->ci - L->base_ci); 99 int inuse = (L->ci - L->base_ci);
100 if (inuse + 1 < LUA_MAXCALLS) /* can `undo' overflow? */ 100 if (inuse + 1 < LUAC_MAXCALLS) /* can `undo' overflow? */
101 luaD_reallocCI(L, LUA_MAXCALLS); 101 luaD_reallocCI(L, LUAC_MAXCALLS);
102 } 102 }
103} 103}
104 104
@@ -149,11 +149,11 @@ void luaD_growstack (lua_State *L, int n) {
149 149
150 150
151static CallInfo *growCI (lua_State *L) { 151static CallInfo *growCI (lua_State *L) {
152 if (L->size_ci > LUA_MAXCALLS) /* overflow while handling overflow? */ 152 if (L->size_ci > LUAC_MAXCALLS) /* overflow while handling overflow? */
153 luaD_throw(L, LUA_ERRERR); 153 luaD_throw(L, LUA_ERRERR);
154 else { 154 else {
155 luaD_reallocCI(L, 2*L->size_ci); 155 luaD_reallocCI(L, 2*L->size_ci);
156 if (L->size_ci > LUA_MAXCALLS) 156 if (L->size_ci > LUAC_MAXCALLS)
157 luaG_runerror(L, "stack overflow"); 157 luaG_runerror(L, "stack overflow");
158 } 158 }
159 return ++L->ci; 159 return ++L->ci;
@@ -340,10 +340,10 @@ void luaD_poscall (lua_State *L, int wanted, StkId firstResult) {
340** function position. 340** function position.
341*/ 341*/
342void luaD_call (lua_State *L, StkId func, int nResults) { 342void luaD_call (lua_State *L, StkId func, int nResults) {
343 if (++L->nCcalls >= LUA_MAXCCALLS) { 343 if (++L->nCcalls >= LUAC_MAXCCALLS) {
344 if (L->nCcalls == LUA_MAXCCALLS) 344 if (L->nCcalls == LUAC_MAXCCALLS)
345 luaG_runerror(L, "C stack overflow"); 345 luaG_runerror(L, "C stack overflow");
346 else if (L->nCcalls >= (LUA_MAXCCALLS + (LUA_MAXCCALLS>>3))) 346 else if (L->nCcalls >= (LUAC_MAXCCALLS + (LUAC_MAXCCALLS>>3)))
347 luaD_throw(L, LUA_ERRERR); /* error while handing stack error */ 347 luaD_throw(L, LUA_ERRERR); /* error while handing stack error */
348 } 348 }
349 if (luaD_precall(L, func, nResults) == PCRLUA) { /* is a Lua function? */ 349 if (luaD_precall(L, func, nResults) == PCRLUA) { /* is a Lua function? */