diff options
-rw-r--r-- | lapi.c | 6 | ||||
-rw-r--r-- | ldblib.c | 4 | ||||
-rw-r--r-- | ldebug.c | 4 | ||||
-rw-r--r-- | ldo.c | 4 | ||||
-rw-r--r-- | ldump.c | 4 | ||||
-rw-r--r-- | lgc.c | 8 | ||||
-rw-r--r-- | llimits.h | 6 | ||||
-rw-r--r-- | loadlib.c | 6 | ||||
-rw-r--r-- | lobject.h | 4 | ||||
-rw-r--r-- | lopcodes.c | 4 | ||||
-rw-r--r-- | lopcodes.h | 18 | ||||
-rw-r--r-- | lstate.c | 4 | ||||
-rw-r--r-- | lstrlib.c | 6 | ||||
-rw-r--r-- | ltable.c | 16 | ||||
-rw-r--r-- | ltests.c | 8 | ||||
-rw-r--r-- | lua.c | 6 | ||||
-rw-r--r-- | lua.h | 6 | ||||
-rw-r--r-- | lualib.h | 4 | ||||
-rw-r--r-- | lundump.c | 6 | ||||
-rw-r--r-- | lvm.c | 6 |
20 files changed, 65 insertions, 65 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lapi.c,v 2.55 2006/06/07 12:37:17 roberto Exp roberto $ | 2 | ** $Id: lapi.c,v 2.56 2006/07/11 15:53:29 roberto Exp roberto $ |
3 | ** Lua API | 3 | ** Lua API |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -185,7 +185,7 @@ LUA_API void lua_replace (lua_State *L, int idx) { | |||
185 | api_checkvalidindex(L, o); | 185 | api_checkvalidindex(L, o); |
186 | if (idx == LUA_ENVIRONINDEX) { | 186 | if (idx == LUA_ENVIRONINDEX) { |
187 | Closure *func = curr_func(L); | 187 | Closure *func = curr_func(L); |
188 | api_check(L, ttistable(L->top - 1)); | 188 | api_check(L, ttistable(L->top - 1)); |
189 | func->c.env = hvalue(L->top - 1); | 189 | func->c.env = hvalue(L->top - 1); |
190 | luaC_barrier(L, func, L->top - 1); | 190 | luaC_barrier(L, func, L->top - 1); |
191 | } | 191 | } |
@@ -747,7 +747,7 @@ LUA_API int lua_setfenv (lua_State *L, int idx) { | |||
747 | 747 | ||
748 | #define checkresults(L,na,nr) \ | 748 | #define checkresults(L,na,nr) \ |
749 | api_check(L, (nr) == LUA_MULTRET || (L->ci->top - L->top >= (nr) - (na))) | 749 | api_check(L, (nr) == LUA_MULTRET || (L->ci->top - L->top >= (nr) - (na))) |
750 | 750 | ||
751 | 751 | ||
752 | LUA_API void lua_call (lua_State *L, int nargs, int nresults) { | 752 | LUA_API void lua_call (lua_State *L, int nargs, int nresults) { |
753 | StkId func; | 753 | StkId func; |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ldblib.c,v 1.103 2005/11/01 16:08:32 roberto Exp roberto $ | 2 | ** $Id: ldblib.c,v 1.104 2005/12/29 15:32:11 roberto Exp roberto $ |
3 | ** Interface from Lua to its debug API | 3 | ** Interface from Lua to its debug API |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -138,7 +138,7 @@ static int db_getinfo (lua_State *L) { | |||
138 | treatstackoption(L, L1, "func"); | 138 | treatstackoption(L, L1, "func"); |
139 | return 1; /* return table */ | 139 | return 1; /* return table */ |
140 | } | 140 | } |
141 | 141 | ||
142 | 142 | ||
143 | static int db_getlocal (lua_State *L) { | 143 | static int db_getlocal (lua_State *L) { |
144 | int arg; | 144 | int arg; |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ldebug.c,v 2.30 2006/07/11 15:53:29 roberto Exp roberto $ | 2 | ** $Id: ldebug.c,v 2.31 2006/08/07 19:04:06 roberto Exp roberto $ |
3 | ** Debug Interface | 3 | ** Debug Interface |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -185,7 +185,7 @@ static void collectvalidlines (lua_State *L, Closure *f) { | |||
185 | int i; | 185 | int i; |
186 | int *lineinfo = f->l.p->lineinfo; | 186 | int *lineinfo = f->l.p->lineinfo; |
187 | Table *t = luaH_new(L); | 187 | Table *t = luaH_new(L); |
188 | sethvalue(L, L->top, t); | 188 | sethvalue(L, L->top, t); |
189 | incr_top(L); | 189 | incr_top(L); |
190 | for (i=0; i<f->l.p->sizelineinfo; i++) | 190 | for (i=0; i<f->l.p->sizelineinfo; i++) |
191 | setbvalue(luaH_setnum(L, t, lineinfo[i]), 1); | 191 | setbvalue(luaH_setnum(L, t, lineinfo[i]), 1); |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ldo.c,v 2.40 2006/08/15 19:59:20 roberto Exp roberto $ | 2 | ** $Id: ldo.c,v 2.41 2006/09/11 12:44:56 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 | */ |
@@ -368,7 +368,7 @@ int luaD_poscall (lua_State *L, StkId firstResult) { | |||
368 | ** The arguments are on the stack, right after the function. | 368 | ** The arguments are on the stack, right after the function. |
369 | ** When returns, all the results are on the stack, starting at the original | 369 | ** When returns, all the results are on the stack, starting at the original |
370 | ** function position. | 370 | ** function position. |
371 | */ | 371 | */ |
372 | void luaD_call (lua_State *L, StkId func, int nResults) { | 372 | void luaD_call (lua_State *L, StkId func, int nResults) { |
373 | global_State *g = G(L); | 373 | global_State *g = G(L); |
374 | lua_assert(g->nCcalls >= L->baseCcalls); | 374 | lua_assert(g->nCcalls >= L->baseCcalls); |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ldump.c,v 1.15 2006/02/16 15:53:49 lhf Exp $ | 2 | ** $Id: ldump.c,v 2.8 2006/02/17 15:51:03 roberto Exp roberto $ |
3 | ** save precompiled Lua chunks | 3 | ** save precompiled Lua chunks |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -24,7 +24,7 @@ typedef struct { | |||
24 | } DumpState; | 24 | } DumpState; |
25 | 25 | ||
26 | #define DumpMem(b,n,size,D) DumpBlock(b,(n)*(size),D) | 26 | #define DumpMem(b,n,size,D) DumpBlock(b,(n)*(size),D) |
27 | #define DumpVar(x,D) DumpMem(&x,1,sizeof(x),D) | 27 | #define DumpVar(x,D) DumpMem(&x,1,sizeof(x),D) |
28 | 28 | ||
29 | static void DumpBlock(const void* b, size_t size, DumpState* D) | 29 | static void DumpBlock(const void* b, size_t size, DumpState* D) |
30 | { | 30 | { |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lgc.c,v 2.38 2006/05/24 14:34:06 roberto Exp roberto $ | 2 | ** $Id: lgc.c,v 2.39 2006/07/11 15:53:29 roberto Exp roberto $ |
3 | ** Garbage Collector | 3 | ** Garbage Collector |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -310,7 +310,7 @@ static l_mem propagatemark (global_State *g) { | |||
310 | traverseproto(g, p); | 310 | traverseproto(g, p); |
311 | return sizeof(Proto) + sizeof(Instruction) * p->sizecode + | 311 | return sizeof(Proto) + sizeof(Instruction) * p->sizecode + |
312 | sizeof(Proto *) * p->sizep + | 312 | sizeof(Proto *) * p->sizep + |
313 | sizeof(TValue) * p->sizek + | 313 | sizeof(TValue) * p->sizek + |
314 | sizeof(int) * p->sizelineinfo + | 314 | sizeof(int) * p->sizelineinfo + |
315 | sizeof(LocVar) * p->sizelocvars + | 315 | sizeof(LocVar) * p->sizelocvars + |
316 | sizeof(TString *) * p->sizeupvalues; | 316 | sizeof(TString *) * p->sizeupvalues; |
@@ -569,7 +569,7 @@ static void atomic (lua_State *L) { | |||
569 | 569 | ||
570 | #define correctestimate(g,s) {lu_mem old = g->totalbytes; s; \ | 570 | #define correctestimate(g,s) {lu_mem old = g->totalbytes; s; \ |
571 | lua_assert(old >= g->totalbytes); g->estimate -= old - g->totalbytes;} | 571 | lua_assert(old >= g->totalbytes); g->estimate -= old - g->totalbytes;} |
572 | 572 | ||
573 | 573 | ||
574 | static l_mem singlestep (lua_State *L) { | 574 | static l_mem singlestep (lua_State *L) { |
575 | global_State *g = G(L); | 575 | global_State *g = G(L); |
@@ -713,7 +713,7 @@ void luaC_linkupval (lua_State *L, UpVal *uv) { | |||
713 | GCObject *o = obj2gco(uv); | 713 | GCObject *o = obj2gco(uv); |
714 | o->gch.next = g->rootgc; /* link upvalue into `rootgc' list */ | 714 | o->gch.next = g->rootgc; /* link upvalue into `rootgc' list */ |
715 | g->rootgc = o; | 715 | g->rootgc = o; |
716 | if (isgray(o)) { | 716 | if (isgray(o)) { |
717 | if (g->gcstate == GCSpropagate) { | 717 | if (g->gcstate == GCSpropagate) { |
718 | gray2black(o); /* closed upvalues need barrier */ | 718 | gray2black(o); /* closed upvalues need barrier */ |
719 | luaC_barrier(L, uv, uv->v); | 719 | luaC_barrier(L, uv, uv->v); |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: llimits.h,v 1.68 2005/12/22 16:19:56 roberto Exp roberto $ | 2 | ** $Id: llimits.h,v 1.69 2005/12/27 17:12:00 roberto Exp roberto $ |
3 | ** Limits, basic types, and some other `installation-dependent' definitions | 3 | ** Limits, basic types, and some other `installation-dependent' definitions |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -107,7 +107,7 @@ typedef lu_int32 Instruction; | |||
107 | 107 | ||
108 | 108 | ||
109 | #ifndef lua_lock | 109 | #ifndef lua_lock |
110 | #define lua_lock(L) ((void) 0) | 110 | #define lua_lock(L) ((void) 0) |
111 | #define lua_unlock(L) ((void) 0) | 111 | #define lua_unlock(L) ((void) 0) |
112 | #endif | 112 | #endif |
113 | 113 | ||
@@ -118,7 +118,7 @@ typedef lu_int32 Instruction; | |||
118 | 118 | ||
119 | /* | 119 | /* |
120 | ** macro to control inclusion of some hard tests on stack reallocation | 120 | ** macro to control inclusion of some hard tests on stack reallocation |
121 | */ | 121 | */ |
122 | #ifndef HARDSTACKTESTS | 122 | #ifndef HARDSTACKTESTS |
123 | #define condhardstacktests(x) ((void)0) | 123 | #define condhardstacktests(x) ((void)0) |
124 | #else | 124 | #else |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: loadlib.c,v 1.53 2006/06/22 16:12:59 roberto Exp roberto $ | 2 | ** $Id: loadlib.c,v 1.54 2006/07/03 20:16:49 roberto Exp roberto $ |
3 | ** Dynamic library loader for Lua | 3 | ** Dynamic library loader for Lua |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | ** | 5 | ** |
@@ -502,7 +502,7 @@ static int ll_require (lua_State *L) { | |||
502 | ** 'module' function | 502 | ** 'module' function |
503 | ** ======================================================= | 503 | ** ======================================================= |
504 | */ | 504 | */ |
505 | 505 | ||
506 | 506 | ||
507 | static void setfenv (lua_State *L) { | 507 | static void setfenv (lua_State *L) { |
508 | lua_Debug ar; | 508 | lua_Debug ar; |
@@ -630,7 +630,7 @@ LUALIB_API int luaopen_package (lua_State *L) { | |||
630 | lua_setfield(L, -2, "__gc"); | 630 | lua_setfield(L, -2, "__gc"); |
631 | /* create `package' table */ | 631 | /* create `package' table */ |
632 | luaL_register(L, LUA_LOADLIBNAME, pk_funcs); | 632 | luaL_register(L, LUA_LOADLIBNAME, pk_funcs); |
633 | #if defined(LUA_COMPAT_LOADLIB) | 633 | #if defined(LUA_COMPAT_LOADLIB) |
634 | lua_getfield(L, -1, "loadlib"); | 634 | lua_getfield(L, -1, "loadlib"); |
635 | lua_setfield(L, LUA_GLOBALSINDEX, "loadlib"); | 635 | lua_setfield(L, LUA_GLOBALSINDEX, "loadlib"); |
636 | #endif | 636 | #endif |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lobject.h,v 2.19 2006/01/10 12:51:53 roberto Exp roberto $ | 2 | ** $Id: lobject.h,v 2.20 2006/01/18 11:37:34 roberto Exp roberto $ |
3 | ** Type definitions for Lua objects | 3 | ** Type definitions for Lua objects |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -337,7 +337,7 @@ typedef struct Node { | |||
337 | 337 | ||
338 | typedef struct Table { | 338 | typedef struct Table { |
339 | CommonHeader; | 339 | CommonHeader; |
340 | lu_byte flags; /* 1<<p means tagmethod(p) is not present */ | 340 | lu_byte flags; /* 1<<p means tagmethod(p) is not present */ |
341 | lu_byte lsizenode; /* log2 of size of `node' array */ | 341 | lu_byte lsizenode; /* log2 of size of `node' array */ |
342 | struct Table *metatable; | 342 | struct Table *metatable; |
343 | TValue *array; /* array part */ | 343 | TValue *array; /* array part */ |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lopcodes.c,v 1.36 2005/10/13 12:22:05 roberto Exp roberto $ | 2 | ** $Id: lopcodes.c,v 1.37 2005/11/08 19:45:36 roberto Exp roberto $ |
3 | ** See Copyright Notice in lua.h | 3 | ** See Copyright Notice in lua.h |
4 | */ | 4 | */ |
5 | 5 | ||
@@ -60,7 +60,7 @@ const char *const luaP_opnames[NUM_OPCODES+1] = { | |||
60 | 60 | ||
61 | const lu_byte luaP_opmodes[NUM_OPCODES] = { | 61 | const lu_byte luaP_opmodes[NUM_OPCODES] = { |
62 | /* T A B C mode opcode */ | 62 | /* T A B C mode opcode */ |
63 | opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_MOVE */ | 63 | opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_MOVE */ |
64 | ,opmode(0, 1, OpArgK, OpArgN, iABx) /* OP_LOADK */ | 64 | ,opmode(0, 1, OpArgK, OpArgN, iABx) /* OP_LOADK */ |
65 | ,opmode(0, 1, OpArgU, OpArgU, iABC) /* OP_LOADBOOL */ | 65 | ,opmode(0, 1, OpArgU, OpArgU, iABC) /* OP_LOADBOOL */ |
66 | ,opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_LOADNIL */ | 66 | ,opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_LOADNIL */ |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lopcodes.h,v 1.124 2005/12/02 18:42:08 roberto Exp roberto $ | 2 | ** $Id: lopcodes.h,v 1.125 2006/03/14 19:04:44 roberto Exp roberto $ |
3 | ** Opcodes for Lua virtual machine | 3 | ** Opcodes for Lua virtual machine |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -183,11 +183,11 @@ OP_CONCAT,/* A B C R(A) := R(B).. ... ..R(C) */ | |||
183 | OP_JMP,/* sBx pc+=sBx */ | 183 | OP_JMP,/* sBx pc+=sBx */ |
184 | 184 | ||
185 | OP_EQ,/* A B C if ((RK(B) == RK(C)) ~= A) then pc++ */ | 185 | OP_EQ,/* A B C if ((RK(B) == RK(C)) ~= A) then pc++ */ |
186 | OP_LT,/* A B C if ((RK(B) < RK(C)) ~= A) then pc++ */ | 186 | OP_LT,/* A B C if ((RK(B) < RK(C)) ~= A) then pc++ */ |
187 | OP_LE,/* A B C if ((RK(B) <= RK(C)) ~= A) then pc++ */ | 187 | OP_LE,/* A B C if ((RK(B) <= RK(C)) ~= A) then pc++ */ |
188 | 188 | ||
189 | OP_TEST,/* A C if not (R(A) <=> C) then pc++ */ | 189 | OP_TEST,/* A C if not (R(A) <=> C) then pc++ */ |
190 | OP_TESTSET,/* A B C if (R(B) <=> C) then R(A) := R(B) else pc++ */ | 190 | OP_TESTSET,/* A B C if (R(B) <=> C) then R(A) := R(B) else pc++ */ |
191 | 191 | ||
192 | OP_CALL,/* A B C R(A), ... ,R(A+C-2) := R(A)(R(A+1), ... ,R(A+B-1)) */ | 192 | OP_CALL,/* A B C R(A), ... ,R(A+C-2) := R(A)(R(A+1), ... ,R(A+B-1)) */ |
193 | OP_TAILCALL,/* A B C return R(A)(R(A+1), ... ,R(A+B-1)) */ | 193 | OP_TAILCALL,/* A B C return R(A)(R(A+1), ... ,R(A+B-1)) */ |
@@ -197,11 +197,11 @@ OP_FORLOOP,/* A sBx R(A)+=R(A+2); | |||
197 | if R(A) <?= R(A+1) then { pc+=sBx; R(A+3)=R(A) }*/ | 197 | if R(A) <?= R(A+1) then { pc+=sBx; R(A+3)=R(A) }*/ |
198 | OP_FORPREP,/* A sBx R(A)-=R(A+2); pc+=sBx */ | 198 | OP_FORPREP,/* A sBx R(A)-=R(A+2); pc+=sBx */ |
199 | 199 | ||
200 | OP_TFORLOOP,/* A C R(A+3), ... ,R(A+2+C) := R(A)(R(A+1), R(A+2)); | 200 | OP_TFORLOOP,/* A C R(A+3), ... ,R(A+2+C) := R(A)(R(A+1), R(A+2)); |
201 | if R(A+3) ~= nil then R(A+2)=R(A+3) else pc++ */ | 201 | if R(A+3) ~= nil then R(A+2)=R(A+3) else pc++ */ |
202 | OP_SETLIST,/* A B C R(A)[(C-1)*FPF+i] := R(A+i), 1 <= i <= B */ | 202 | OP_SETLIST,/* A B C R(A)[(C-1)*FPF+i] := R(A+i), 1 <= i <= B */ |
203 | 203 | ||
204 | OP_CLOSE,/* A close all variables in the stack up to (>=) R(A)*/ | 204 | OP_CLOSE,/* A close all variables in the stack up to (>=) R(A)*/ |
205 | OP_CLOSURE,/* A Bx R(A) := closure(KPROTO[Bx], R(A), ... ,R(A+n)) */ | 205 | OP_CLOSURE,/* A Bx R(A) := closure(KPROTO[Bx], R(A), ... ,R(A+n)) */ |
206 | 206 | ||
207 | OP_VARARG/* A B R(A), R(A+1), ..., R(A+B-1) = vararg */ | 207 | OP_VARARG/* A B R(A), R(A+1), ..., R(A+B-1) = vararg */ |
@@ -240,7 +240,7 @@ OP_VARARG/* A B R(A), R(A+1), ..., R(A+B-1) = vararg */ | |||
240 | ** bits 4-5: B arg mode | 240 | ** bits 4-5: B arg mode |
241 | ** bit 6: instruction set register A | 241 | ** bit 6: instruction set register A |
242 | ** bit 7: operator is a test | 242 | ** bit 7: operator is a test |
243 | */ | 243 | */ |
244 | 244 | ||
245 | enum OpArgMask { | 245 | enum OpArgMask { |
246 | OpArgN, /* argument is not used */ | 246 | OpArgN, /* argument is not used */ |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lstate.c,v 2.37 2006/07/11 15:53:29 roberto Exp roberto $ | 2 | ** $Id: lstate.c,v 2.38 2006/08/15 19:59:20 roberto Exp roberto $ |
3 | ** Global State | 3 | ** Global State |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -37,7 +37,7 @@ typedef struct LG { | |||
37 | lua_State l; | 37 | lua_State l; |
38 | global_State g; | 38 | global_State g; |
39 | } LG; | 39 | } LG; |
40 | 40 | ||
41 | 41 | ||
42 | 42 | ||
43 | static void stack_init (lua_State *L1, lua_State *L) { | 43 | static void stack_init (lua_State *L1, lua_State *L) { |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lstrlib.c,v 1.132 2006/04/26 20:41:19 roberto Exp roberto $ | 2 | ** $Id: lstrlib.c,v 1.133 2006/06/22 16:12:59 roberto Exp roberto $ |
3 | ** Standard library for string operations and pattern-matching | 3 | ** Standard library for string operations and pattern-matching |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -630,7 +630,7 @@ static void add_value (MatchState *ms, luaL_Buffer *b, const char *s, | |||
630 | break; | 630 | break; |
631 | } | 631 | } |
632 | default: { | 632 | default: { |
633 | luaL_argerror(L, 3, "string/function/table expected"); | 633 | luaL_argerror(L, 3, "string/function/table expected"); |
634 | return; | 634 | return; |
635 | } | 635 | } |
636 | } | 636 | } |
@@ -639,7 +639,7 @@ static void add_value (MatchState *ms, luaL_Buffer *b, const char *s, | |||
639 | lua_pushlstring(L, s, e - s); /* keep original text */ | 639 | lua_pushlstring(L, s, e - s); /* keep original text */ |
640 | } | 640 | } |
641 | else if (!lua_isstring(L, -1)) | 641 | else if (!lua_isstring(L, -1)) |
642 | luaL_error(L, "invalid replacement value (a %s)", luaL_typename(L, -1)); | 642 | luaL_error(L, "invalid replacement value (a %s)", luaL_typename(L, -1)); |
643 | luaL_addvalue(b); /* add result to accumulator */ | 643 | luaL_addvalue(b); /* add result to accumulator */ |
644 | } | 644 | } |
645 | 645 | ||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ltable.c,v 2.33 2006/07/11 15:53:29 roberto Exp roberto $ | 2 | ** $Id: ltable.c,v 2.34 2006/08/07 19:14:30 roberto Exp roberto $ |
3 | ** Lua tables (hash) | 3 | ** Lua tables (hash) |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -48,7 +48,7 @@ | |||
48 | 48 | ||
49 | 49 | ||
50 | #define hashpow2(t,n) (gnode(t, lmod((n), sizenode(t)))) | 50 | #define hashpow2(t,n) (gnode(t, lmod((n), sizenode(t)))) |
51 | 51 | ||
52 | #define hashstr(t,str) hashpow2(t, (str)->tsv.hash) | 52 | #define hashstr(t,str) hashpow2(t, (str)->tsv.hash) |
53 | #define hashboolean(t,p) hashpow2(t, p) | 53 | #define hashboolean(t,p) hashpow2(t, p) |
54 | 54 | ||
@@ -302,7 +302,7 @@ void luaH_resize (lua_State *L, Table *t, int nasize, int nhsize) { | |||
302 | if (nasize > oldasize) /* array part must grow? */ | 302 | if (nasize > oldasize) /* array part must grow? */ |
303 | setarrayvector(L, t, nasize); | 303 | setarrayvector(L, t, nasize); |
304 | /* create new hash part with appropriate size */ | 304 | /* create new hash part with appropriate size */ |
305 | setnodevector(L, t, nhsize); | 305 | setnodevector(L, t, nhsize); |
306 | if (nasize < oldasize) { /* array part must shrink? */ | 306 | if (nasize < oldasize) { /* array part must shrink? */ |
307 | t->sizearray = nasize; | 307 | t->sizearray = nasize; |
308 | /* re-insert elements from vanishing slice */ | 308 | /* re-insert elements from vanishing slice */ |
@@ -386,11 +386,11 @@ static Node *getfreepos (Table *t) { | |||
386 | 386 | ||
387 | 387 | ||
388 | /* | 388 | /* |
389 | ** inserts a new key into a hash table; first, check whether key's main | 389 | ** inserts a new key into a hash table; first, check whether key's main |
390 | ** position is free. If not, check whether colliding node is in its main | 390 | ** position is free. If not, check whether colliding node is in its main |
391 | ** position or not: if it is not, move colliding node to an empty place and | 391 | ** position or not: if it is not, move colliding node to an empty place and |
392 | ** put new key in its main position; otherwise (colliding node is in its main | 392 | ** put new key in its main position; otherwise (colliding node is in its main |
393 | ** position), new key goes to an empty position. | 393 | ** position), new key goes to an empty position. |
394 | */ | 394 | */ |
395 | static TValue *newkey (lua_State *L, Table *t, const TValue *key) { | 395 | static TValue *newkey (lua_State *L, Table *t, const TValue *key) { |
396 | Node *mp = mainposition(t, key); | 396 | Node *mp = mainposition(t, key); |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ltests.c,v 2.37 2006/06/05 19:35:57 roberto Exp roberto $ | 2 | ** $Id: ltests.c,v 2.38 2006/07/11 15:53:29 roberto Exp roberto $ |
3 | ** Internal Module for Debugging of the Lua Implementation | 3 | ** Internal Module for Debugging of the Lua Implementation |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -399,7 +399,7 @@ static char *buildop (Proto *p, int pc, char *buff) { | |||
399 | const char *name = luaP_opnames[o]; | 399 | const char *name = luaP_opnames[o]; |
400 | int line = getline(p, pc); | 400 | int line = getline(p, pc); |
401 | sprintf(buff, "(%4d) %4d - ", line, pc); | 401 | sprintf(buff, "(%4d) %4d - ", line, pc); |
402 | switch (getOpMode(o)) { | 402 | switch (getOpMode(o)) { |
403 | case iABC: | 403 | case iABC: |
404 | sprintf(buff+strlen(buff), "%-12s%4d %4d %4d", name, | 404 | sprintf(buff+strlen(buff), "%-12s%4d %4d %4d", name, |
405 | GETARG_A(i), GETARG_B(i), GETARG_C(i)); | 405 | GETARG_A(i), GETARG_B(i), GETARG_C(i)); |
@@ -581,7 +581,7 @@ static int table_query (lua_State *L) { | |||
581 | else if (i < t->sizearray) { | 581 | else if (i < t->sizearray) { |
582 | lua_pushinteger(L, i); | 582 | lua_pushinteger(L, i); |
583 | pushobject(L, &t->array[i]); | 583 | pushobject(L, &t->array[i]); |
584 | lua_pushnil(L); | 584 | lua_pushnil(L); |
585 | } | 585 | } |
586 | else if ((i -= t->sizearray) < sizenode(t)) { | 586 | else if ((i -= t->sizearray) < sizenode(t)) { |
587 | if (!ttisnil(gval(gnode(t, i))) || | 587 | if (!ttisnil(gval(gnode(t, i))) || |
@@ -821,7 +821,7 @@ static int getnum_aux (lua_State *L, const char **pc) { | |||
821 | while (isdigit(cast_int(**pc))) res = res*10 + (*(*pc)++) - '0'; | 821 | while (isdigit(cast_int(**pc))) res = res*10 + (*(*pc)++) - '0'; |
822 | return sig*res; | 822 | return sig*res; |
823 | } | 823 | } |
824 | 824 | ||
825 | static const char *getname_aux (char *buff, const char **pc) { | 825 | static const char *getname_aux (char *buff, const char **pc) { |
826 | int i = 0; | 826 | int i = 0; |
827 | skip(pc); | 827 | skip(pc); |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lua.c,v 1.160 2006/06/02 15:34:00 roberto Exp roberto $ | 2 | ** $Id: lua.c,v 1.161 2006/06/23 16:09:15 roberto Exp roberto $ |
3 | ** Lua stand-alone interpreter | 3 | ** Lua stand-alone interpreter |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -242,14 +242,14 @@ static int handle_script (lua_State *L, char **argv, int n) { | |||
242 | int narg = getargs(L, argv, n); /* collect arguments */ | 242 | int narg = getargs(L, argv, n); /* collect arguments */ |
243 | lua_setglobal(L, "arg"); | 243 | lua_setglobal(L, "arg"); |
244 | fname = argv[n]; | 244 | fname = argv[n]; |
245 | if (strcmp(fname, "-") == 0 && strcmp(argv[n-1], "--") != 0) | 245 | if (strcmp(fname, "-") == 0 && strcmp(argv[n-1], "--") != 0) |
246 | fname = NULL; /* stdin */ | 246 | fname = NULL; /* stdin */ |
247 | status = luaL_loadfile(L, fname); | 247 | status = luaL_loadfile(L, fname); |
248 | lua_insert(L, -(narg+1)); | 248 | lua_insert(L, -(narg+1)); |
249 | if (status == 0) | 249 | if (status == 0) |
250 | status = docall(L, narg, 0); | 250 | status = docall(L, narg, 0); |
251 | else | 251 | else |
252 | lua_pop(L, narg); | 252 | lua_pop(L, narg); |
253 | return report(L, status); | 253 | return report(L, status); |
254 | } | 254 | } |
255 | 255 | ||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lua.h,v 1.217 2006/05/31 16:50:40 roberto Exp roberto $ | 2 | ** $Id: lua.h,v 1.218 2006/06/02 15:34:00 roberto Exp roberto $ |
3 | ** Lua - An Extensible Extension Language | 3 | ** Lua - An Extensible Extension Language |
4 | ** Lua.org, PUC-Rio, Brazil (http://www.lua.org) | 4 | ** Lua.org, PUC-Rio, Brazil (http://www.lua.org) |
5 | ** See Copyright Notice at the end of this file | 5 | ** See Copyright Notice at the end of this file |
@@ -20,7 +20,7 @@ | |||
20 | #define LUA_RELEASE "Lua 5.1.1" | 20 | #define LUA_RELEASE "Lua 5.1.1" |
21 | #define LUA_VERSION_NUM 501 | 21 | #define LUA_VERSION_NUM 501 |
22 | #define LUA_COPYRIGHT "Copyright (C) 1994-2006 Lua.org, PUC-Rio" | 22 | #define LUA_COPYRIGHT "Copyright (C) 1994-2006 Lua.org, PUC-Rio" |
23 | #define LUA_AUTHORS "R. Ierusalimschy, L. H. de Figueiredo & W. Celes" | 23 | #define LUA_AUTHORS "R. Ierusalimschy, L. H. de Figueiredo & W. Celes" |
24 | 24 | ||
25 | 25 | ||
26 | /* mark for precompiled code (`<esc>Lua') */ | 26 | /* mark for precompiled code (`<esc>Lua') */ |
@@ -245,7 +245,7 @@ LUA_API void lua_setallocf (lua_State *L, lua_Alloc f, void *ud); | |||
245 | 245 | ||
246 | 246 | ||
247 | 247 | ||
248 | /* | 248 | /* |
249 | ** =============================================================== | 249 | ** =============================================================== |
250 | ** some useful macros | 250 | ** some useful macros |
251 | ** =============================================================== | 251 | ** =============================================================== |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lualib.h,v 1.35 2005/08/10 18:06:58 roberto Exp roberto $ | 2 | ** $Id: lualib.h,v 1.36 2005/12/27 17:12:00 roberto Exp roberto $ |
3 | ** Lua standard libraries | 3 | ** Lua standard libraries |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -41,7 +41,7 @@ LUALIB_API int (luaopen_package) (lua_State *L); | |||
41 | 41 | ||
42 | 42 | ||
43 | /* open all previous libraries */ | 43 | /* open all previous libraries */ |
44 | LUALIB_API void (luaL_openlibs) (lua_State *L); | 44 | LUALIB_API void (luaL_openlibs) (lua_State *L); |
45 | 45 | ||
46 | 46 | ||
47 | 47 | ||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lundump.c,v 1.60 2006/02/16 15:53:49 lhf Exp $ | 2 | ** $Id: lundump.c,v 2.7 2006/02/17 15:51:03 roberto Exp roberto $ |
3 | ** load precompiled Lua chunks | 3 | ** load precompiled Lua chunks |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -110,10 +110,10 @@ static void LoadConstants(LoadState* S, Proto* f) | |||
110 | switch (t) | 110 | switch (t) |
111 | { | 111 | { |
112 | case LUA_TNIL: | 112 | case LUA_TNIL: |
113 | setnilvalue(o); | 113 | setnilvalue(o); |
114 | break; | 114 | break; |
115 | case LUA_TBOOLEAN: | 115 | case LUA_TBOOLEAN: |
116 | setbvalue(o,LoadChar(S)); | 116 | setbvalue(o,LoadChar(S)); |
117 | break; | 117 | break; |
118 | case LUA_TNUMBER: | 118 | case LUA_TNUMBER: |
119 | setnvalue(o,LoadNumber(S)); | 119 | setnvalue(o,LoadNumber(S)); |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lvm.c,v 2.65 2006/07/14 16:22:24 roberto Exp roberto $ | 2 | ** $Id: lvm.c,v 2.66 2006/08/07 19:14:30 roberto Exp roberto $ |
3 | ** Lua virtual machine | 3 | ** Lua virtual machine |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -127,7 +127,7 @@ void luaV_gettable (lua_State *L, const TValue *t, TValue *key, StkId val) { | |||
127 | callTMres(L, val, tm, t, key); | 127 | callTMres(L, val, tm, t, key); |
128 | return; | 128 | return; |
129 | } | 129 | } |
130 | t = tm; /* else repeat with `tm' */ | 130 | t = tm; /* else repeat with `tm' */ |
131 | } | 131 | } |
132 | luaG_runerror(L, "loop in gettable"); | 132 | luaG_runerror(L, "loop in gettable"); |
133 | } | 133 | } |
@@ -154,7 +154,7 @@ void luaV_settable (lua_State *L, const TValue *t, TValue *key, StkId val) { | |||
154 | callTM(L, tm, t, key, val); | 154 | callTM(L, tm, t, key, val); |
155 | return; | 155 | return; |
156 | } | 156 | } |
157 | t = tm; /* else repeat with `tm' */ | 157 | t = tm; /* else repeat with `tm' */ |
158 | } | 158 | } |
159 | luaG_runerror(L, "loop in settable"); | 159 | luaG_runerror(L, "loop in settable"); |
160 | } | 160 | } |