diff options
-rw-r--r-- | lapi.c | 4 | ||||
-rw-r--r-- | lcode.c | 4 | ||||
-rw-r--r-- | ldo.c | 24 | ||||
-rw-r--r-- | lgc.c | 4 | ||||
-rw-r--r-- | llimits.h | 14 | ||||
-rw-r--r-- | loadlib.c | 8 | ||||
-rw-r--r-- | lobject.c | 4 | ||||
-rw-r--r-- | lopcodes.h | 6 | ||||
-rw-r--r-- | loslib.c | 4 | ||||
-rw-r--r-- | lparser.c | 12 | ||||
-rw-r--r-- | lparser.h | 6 | ||||
-rw-r--r-- | ltable.c | 14 | ||||
-rw-r--r-- | luaconf.h | 106 | ||||
-rw-r--r-- | lvm.c | 42 |
14 files changed, 126 insertions, 126 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lapi.c,v 2.29 2005/03/08 18:09:16 roberto Exp roberto $ | 2 | ** $Id: lapi.c,v 2.30 2005/03/08 20:10:05 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 | */ |
@@ -95,7 +95,7 @@ void luaA_pushobject (lua_State *L, const TValue *o) { | |||
95 | LUA_API int lua_checkstack (lua_State *L, int size) { | 95 | LUA_API int lua_checkstack (lua_State *L, int size) { |
96 | int res; | 96 | int res; |
97 | lua_lock(L); | 97 | lua_lock(L); |
98 | if ((L->top - L->base + size) > LUAC_MAXCSTACK) | 98 | if ((L->top - L->base + size) > LUAI_MAXCSTACK) |
99 | res = 0; /* stack overflow */ | 99 | res = 0; /* stack overflow */ |
100 | else { | 100 | else { |
101 | luaD_checkstack(L, size); | 101 | luaD_checkstack(L, size); |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lcode.c,v 2.9 2005/01/10 18:17:39 roberto Exp roberto $ | 2 | ** $Id: lcode.c,v 2.10 2005/03/08 20:10:05 roberto Exp roberto $ |
3 | ** Code generator for Lua | 3 | ** Code generator for Lua |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -606,7 +606,7 @@ void luaK_prefix (FuncState *fs, UnOpr op, expdesc *e) { | |||
606 | if (op == OPR_MINUS) { | 606 | if (op == OPR_MINUS) { |
607 | luaK_exp2val(fs, e); | 607 | luaK_exp2val(fs, e); |
608 | if (e->k == VK && ttisnumber(&fs->f->k[e->info])) | 608 | if (e->k == VK && ttisnumber(&fs->f->k[e->info])) |
609 | e->info = luaK_numberK(fs, luac_numunm(nvalue(&fs->f->k[e->info]))); | 609 | e->info = luaK_numberK(fs, luai_numunm(nvalue(&fs->f->k[e->info]))); |
610 | else { | 610 | else { |
611 | luaK_exp2anyreg(fs, e); | 611 | luaK_exp2anyreg(fs, e); |
612 | freeexp(fs, e); | 612 | freeexp(fs, e); |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ldo.c,v 2.15 2005/03/08 18:09:16 roberto Exp roberto $ | 2 | ** $Id: ldo.c,v 2.16 2005/03/08 20:10:05 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 */ |
44 | struct lua_longjmp { | 44 | struct lua_longjmp { |
45 | struct lua_longjmp *previous; | 45 | struct lua_longjmp *previous; |
46 | luac_jmpbuf b; | 46 | luai_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) { | |||
71 | void luaD_throw (lua_State *L, int errcode) { | 71 | void 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 | LUAC_THROW(L, L->errorJmp); | 74 | LUAI_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 | LUAC_TRY(L, &lj, | 88 | LUAI_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 | ||
96 | static void restore_stack_limit (lua_State *L) { | 96 | static 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 > LUAC_MAXCALLS) { /* there was an overflow? */ | 98 | if (L->size_ci > LUAI_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 < LUAC_MAXCALLS) /* can `undo' overflow? */ | 100 | if (inuse + 1 < LUAI_MAXCALLS) /* can `undo' overflow? */ |
101 | luaD_reallocCI(L, LUAC_MAXCALLS); | 101 | luaD_reallocCI(L, LUAI_MAXCALLS); |
102 | } | 102 | } |
103 | } | 103 | } |
104 | 104 | ||
@@ -149,11 +149,11 @@ void luaD_growstack (lua_State *L, int n) { | |||
149 | 149 | ||
150 | 150 | ||
151 | static CallInfo *growCI (lua_State *L) { | 151 | static CallInfo *growCI (lua_State *L) { |
152 | if (L->size_ci > LUAC_MAXCALLS) /* overflow while handling overflow? */ | 152 | if (L->size_ci > LUAI_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 > LUAC_MAXCALLS) | 156 | if (L->size_ci > LUAI_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 | */ |
342 | void luaD_call (lua_State *L, StkId func, int nResults) { | 342 | void luaD_call (lua_State *L, StkId func, int nResults) { |
343 | if (++L->nCcalls >= LUAC_MAXCCALLS) { | 343 | if (++L->nCcalls >= LUAI_MAXCCALLS) { |
344 | if (L->nCcalls == LUAC_MAXCCALLS) | 344 | if (L->nCcalls == LUAI_MAXCCALLS) |
345 | luaG_runerror(L, "C stack overflow"); | 345 | luaG_runerror(L, "C stack overflow"); |
346 | else if (L->nCcalls >= (LUAC_MAXCCALLS + (LUAC_MAXCCALLS>>3))) | 346 | else if (L->nCcalls >= (LUAI_MAXCCALLS + (LUAI_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? */ |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lgc.c,v 2.27 2005/02/23 17:30:22 roberto Exp roberto $ | 2 | ** $Id: lgc.c,v 2.28 2005/03/08 20:10:05 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 | */ |
@@ -242,7 +242,7 @@ static void traverseclosure (global_State *g, Closure *cl) { | |||
242 | static void checkstacksizes (lua_State *L, StkId max) { | 242 | static void checkstacksizes (lua_State *L, StkId max) { |
243 | int ci_used = L->ci - L->base_ci; /* number of `ci' in use */ | 243 | int ci_used = L->ci - L->base_ci; /* number of `ci' in use */ |
244 | int s_used = max - L->stack; /* part of stack in use */ | 244 | int s_used = max - L->stack; /* part of stack in use */ |
245 | if (L->size_ci > LUAC_MAXCALLS) /* handling overflow? */ | 245 | if (L->size_ci > LUAI_MAXCALLS) /* handling overflow? */ |
246 | return; /* do not touch the stacks */ | 246 | return; /* do not touch the stacks */ |
247 | if (4*ci_used < L->size_ci && 2*BASIC_CI_SIZE < L->size_ci) | 247 | if (4*ci_used < L->size_ci && 2*BASIC_CI_SIZE < L->size_ci) |
248 | luaD_reallocCI(L, L->size_ci/2); /* still big enough... */ | 248 | luaD_reallocCI(L, L->size_ci/2); /* still big enough... */ |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: llimits.h,v 1.63 2005/01/14 14:19:42 roberto Exp roberto $ | 2 | ** $Id: llimits.h,v 1.64 2005/03/08 20:10:05 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 | */ |
@@ -15,14 +15,14 @@ | |||
15 | #include "lua.h" | 15 | #include "lua.h" |
16 | 16 | ||
17 | 17 | ||
18 | #define api_check luac_apicheck | 18 | #define api_check luai_apicheck |
19 | 19 | ||
20 | 20 | ||
21 | typedef LUAC_UINT32 lu_int32; | 21 | typedef LUAI_UINT32 lu_int32; |
22 | 22 | ||
23 | typedef LUAC_UMEM lu_mem; | 23 | typedef LUAI_UMEM lu_mem; |
24 | 24 | ||
25 | typedef LUAC_MEM l_mem; | 25 | typedef LUAI_MEM l_mem; |
26 | 26 | ||
27 | 27 | ||
28 | 28 | ||
@@ -47,11 +47,11 @@ typedef unsigned char lu_byte; | |||
47 | 47 | ||
48 | 48 | ||
49 | /* type to ensure maximum alignment */ | 49 | /* type to ensure maximum alignment */ |
50 | typedef LUAC_USER_ALIGNMENT_T L_Umaxalign; | 50 | typedef LUAI_USER_ALIGNMENT_T L_Umaxalign; |
51 | 51 | ||
52 | 52 | ||
53 | /* result of a `usual argument conversion' over lua_Number */ | 53 | /* result of a `usual argument conversion' over lua_Number */ |
54 | typedef LUAC_UACNUMBER l_uacNumber; | 54 | typedef LUAI_UACNUMBER l_uacNumber; |
55 | 55 | ||
56 | 56 | ||
57 | #define check_exp(c,e) (lua_assert(c), (e)) | 57 | #define check_exp(c,e) (lua_assert(c), (e)) |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: loadlib.c,v 1.19 2005/03/07 18:07:34 roberto Exp roberto $ | 2 | ** $Id: loadlib.c,v 1.20 2005/03/08 20:10:05 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 | * |
@@ -33,7 +33,7 @@ static lua_CFunction ll_sym (lua_State *L, void *lib, const char *sym); | |||
33 | 33 | ||
34 | 34 | ||
35 | 35 | ||
36 | #if defined(LUA_USEDLOPEN) | 36 | #if defined(LUA_USE_DLOPEN) |
37 | /* | 37 | /* |
38 | ** {======================================================================== | 38 | ** {======================================================================== |
39 | ** This is an implementation of loadlib based on the dlfcn interface. | 39 | ** This is an implementation of loadlib based on the dlfcn interface. |
@@ -67,7 +67,7 @@ static lua_CFunction ll_sym (lua_State *L, void *lib, const char *sym) { | |||
67 | 67 | ||
68 | 68 | ||
69 | 69 | ||
70 | #elif defined(LUA_USEDLL) | 70 | #elif defined(LUA_USE_DLL) |
71 | /* | 71 | /* |
72 | ** {====================================================================== | 72 | ** {====================================================================== |
73 | ** This is an implementation of loadlib for Windows using native functions. | 73 | ** This is an implementation of loadlib for Windows using native functions. |
@@ -109,7 +109,7 @@ static lua_CFunction ll_sym (lua_State *L, void *lib, const char *sym) { | |||
109 | 109 | ||
110 | 110 | ||
111 | 111 | ||
112 | #elif defined(LUA_USEDYLD) | 112 | #elif defined(LUA_USE_DYLD) |
113 | /* | 113 | /* |
114 | ** {====================================================================== | 114 | ** {====================================================================== |
115 | ** Native Mac OS X / Darwin Implementation | 115 | ** Native Mac OS X / Darwin Implementation |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lobject.c,v 2.9 2005/03/08 18:09:16 roberto Exp roberto $ | 2 | ** $Id: lobject.c,v 2.10 2005/03/08 20:10:05 roberto Exp roberto $ |
3 | ** Some generic functions over Lua objects | 3 | ** Some generic functions over Lua objects |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -74,7 +74,7 @@ int luaO_rawequalObj (const TValue *t1, const TValue *t2) { | |||
74 | case LUA_TNIL: | 74 | case LUA_TNIL: |
75 | return 1; | 75 | return 1; |
76 | case LUA_TNUMBER: | 76 | case LUA_TNUMBER: |
77 | return luac_numeq(nvalue(t1), nvalue(t2)); | 77 | return luai_numeq(nvalue(t1), nvalue(t2)); |
78 | case LUA_TBOOLEAN: | 78 | case LUA_TBOOLEAN: |
79 | return bvalue(t1) == bvalue(t2); /* boolean true must be 1 !! */ | 79 | return bvalue(t1) == bvalue(t2); /* boolean true must be 1 !! */ |
80 | case LUA_TLIGHTUSERDATA: | 80 | case LUA_TLIGHTUSERDATA: |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lopcodes.h,v 1.115 2005/03/08 18:00:16 roberto Exp roberto $ | 2 | ** $Id: lopcodes.h,v 1.116 2005/03/08 20:10:05 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 | */ |
@@ -51,9 +51,9 @@ enum OpMode {iABC, iABx, iAsBx}; /* basic instruction format */ | |||
51 | /* | 51 | /* |
52 | ** limits for opcode arguments. | 52 | ** limits for opcode arguments. |
53 | ** we use (signed) int to manipulate most arguments, | 53 | ** we use (signed) int to manipulate most arguments, |
54 | ** so they must fit in LUAC_BITSINT-1 bits (-1 for sign) | 54 | ** so they must fit in LUAI_BITSINT-1 bits (-1 for sign) |
55 | */ | 55 | */ |
56 | #if SIZE_Bx < LUAC_BITSINT-1 | 56 | #if SIZE_Bx < LUAI_BITSINT-1 |
57 | #define MAXARG_Bx ((1<<SIZE_Bx)-1) | 57 | #define MAXARG_Bx ((1<<SIZE_Bx)-1) |
58 | #define MAXARG_sBx (MAXARG_Bx>>1) /* `sBx' is signed */ | 58 | #define MAXARG_sBx (MAXARG_Bx>>1) /* `sBx' is signed */ |
59 | #else | 59 | #else |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: loslib.c,v 1.4 2005/01/10 19:16:29 roberto Exp roberto $ | 2 | ** $Id: loslib.c,v 1.5 2005/03/08 20:10:05 roberto Exp roberto $ |
3 | ** Standard Operating System library | 3 | ** Standard Operating System library |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -57,7 +57,7 @@ static int io_rename (lua_State *L) { | |||
57 | 57 | ||
58 | 58 | ||
59 | static int io_tmpname (lua_State *L) { | 59 | static int io_tmpname (lua_State *L) { |
60 | #if !LUA_USETMPNAME | 60 | #if !LUA_USE_TMPNAME |
61 | luaL_error(L, "`tmpname' not supported"); | 61 | luaL_error(L, "`tmpname' not supported"); |
62 | return 0; | 62 | return 0; |
63 | #else | 63 | #else |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lparser.c,v 2.16 2005/03/08 18:16:45 roberto Exp roberto $ | 2 | ** $Id: lparser.c,v 2.17 2005/03/08 20:10:05 roberto Exp roberto $ |
3 | ** Lua Parser | 3 | ** Lua Parser |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -33,7 +33,7 @@ | |||
33 | 33 | ||
34 | #define luaY_checklimit(fs,v,l,m) if ((v)>(l)) errorlimit(fs,l,m) | 34 | #define luaY_checklimit(fs,v,l,m) if ((v)>(l)) errorlimit(fs,l,m) |
35 | 35 | ||
36 | #define enterlevel(ls) if (++(ls)->nestlevel > LUAC_MAXPARSERLEVEL) \ | 36 | #define enterlevel(ls) if (++(ls)->nestlevel > LUAI_MAXPARSERLEVEL) \ |
37 | luaX_lexerror(ls, "chunk has too many syntax levels", 0) | 37 | luaX_lexerror(ls, "chunk has too many syntax levels", 0) |
38 | #define leavelevel(ls) ((ls)->nestlevel--) | 38 | #define leavelevel(ls) ((ls)->nestlevel--) |
39 | 39 | ||
@@ -181,7 +181,7 @@ static int registerlocalvar (LexState *ls, TString *varname) { | |||
181 | 181 | ||
182 | static void new_localvar (LexState *ls, TString *name, int n) { | 182 | static void new_localvar (LexState *ls, TString *name, int n) { |
183 | FuncState *fs = ls->fs; | 183 | FuncState *fs = ls->fs; |
184 | luaY_checklimit(fs, fs->nactvar+n+1, LUAC_MAXVARS, "local variables"); | 184 | luaY_checklimit(fs, fs->nactvar+n+1, LUAI_MAXVARS, "local variables"); |
185 | fs->actvar[fs->nactvar+n] = cast(unsigned short, registerlocalvar(ls, name)); | 185 | fs->actvar[fs->nactvar+n] = cast(unsigned short, registerlocalvar(ls, name)); |
186 | } | 186 | } |
187 | 187 | ||
@@ -213,7 +213,7 @@ static int indexupvalue (FuncState *fs, TString *name, expdesc *v) { | |||
213 | } | 213 | } |
214 | } | 214 | } |
215 | /* new one */ | 215 | /* new one */ |
216 | luaY_checklimit(fs, f->nups + 1, LUAC_MAXUPVALUES, "upvalues"); | 216 | luaY_checklimit(fs, f->nups + 1, LUAI_MAXUPVALUES, "upvalues"); |
217 | luaM_growvector(fs->L, f->upvalues, f->nups, f->sizeupvalues, | 217 | luaM_growvector(fs->L, f->upvalues, f->nups, f->sizeupvalues, |
218 | TString *, MAX_INT, ""); | 218 | TString *, MAX_INT, ""); |
219 | while (oldsize < f->sizeupvalues) f->upvalues[oldsize++] = NULL; | 219 | while (oldsize < f->sizeupvalues) f->upvalues[oldsize++] = NULL; |
@@ -993,7 +993,7 @@ static int cond (LexState *ls) { | |||
993 | 993 | ||
994 | static void whilestat (LexState *ls, int line) { | 994 | static void whilestat (LexState *ls, int line) { |
995 | /* whilestat -> WHILE cond DO block END */ | 995 | /* whilestat -> WHILE cond DO block END */ |
996 | Instruction codeexp[LUAC_MAXEXPWHILE + EXTRAEXP]; | 996 | Instruction codeexp[LUAI_MAXEXPWHILE + EXTRAEXP]; |
997 | int lineexp; | 997 | int lineexp; |
998 | int i; | 998 | int i; |
999 | int sizeexp; | 999 | int sizeexp; |
@@ -1011,7 +1011,7 @@ static void whilestat (LexState *ls, int line) { | |||
1011 | luaK_concat(fs, &v.f, fs->jpc); | 1011 | luaK_concat(fs, &v.f, fs->jpc); |
1012 | fs->jpc = NO_JUMP; | 1012 | fs->jpc = NO_JUMP; |
1013 | sizeexp = fs->pc - expinit; /* size of expression code */ | 1013 | sizeexp = fs->pc - expinit; /* size of expression code */ |
1014 | if (sizeexp > LUAC_MAXEXPWHILE) | 1014 | if (sizeexp > LUAI_MAXEXPWHILE) |
1015 | luaX_syntaxerror(ls, "`while' condition too complex"); | 1015 | luaX_syntaxerror(ls, "`while' condition too complex"); |
1016 | for (i = 0; i < sizeexp; i++) /* save `exp' code */ | 1016 | for (i = 0; i < sizeexp; i++) /* save `exp' code */ |
1017 | codeexp[i] = fs->f->code[expinit + i]; | 1017 | codeexp[i] = fs->f->code[expinit + i]; |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lparser.h,v 1.52 2005/03/07 16:58:27 roberto Exp roberto $ | 2 | ** $Id: lparser.h,v 1.53 2005/03/08 20:10:05 roberto Exp roberto $ |
3 | ** Lua Parser | 3 | ** Lua Parser |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -67,8 +67,8 @@ typedef struct FuncState { | |||
67 | int np; /* number of elements in `p' */ | 67 | int np; /* number of elements in `p' */ |
68 | short nlocvars; /* number of elements in `locvars' */ | 68 | short nlocvars; /* number of elements in `locvars' */ |
69 | lu_byte nactvar; /* number of active local variables */ | 69 | lu_byte nactvar; /* number of active local variables */ |
70 | upvaldesc upvalues[LUAC_MAXUPVALUES]; /* upvalues */ | 70 | upvaldesc upvalues[LUAI_MAXUPVALUES]; /* upvalues */ |
71 | unsigned short actvar[LUAC_MAXVARS]; /* declared-variable stack */ | 71 | unsigned short actvar[LUAI_MAXVARS]; /* declared-variable stack */ |
72 | } FuncState; | 72 | } FuncState; |
73 | 73 | ||
74 | 74 | ||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ltable.c,v 2.16 2005/03/08 18:09:16 roberto Exp roberto $ | 2 | ** $Id: ltable.c,v 2.17 2005/03/08 20:10:05 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 | */ |
@@ -38,10 +38,10 @@ | |||
38 | /* | 38 | /* |
39 | ** max size of array part is 2^MAXBITS | 39 | ** max size of array part is 2^MAXBITS |
40 | */ | 40 | */ |
41 | #if LUAC_BITSINT > 26 | 41 | #if LUAI_BITSINT > 26 |
42 | #define MAXBITS 26 | 42 | #define MAXBITS 26 |
43 | #else | 43 | #else |
44 | #define MAXBITS (LUAC_BITSINT-2) | 44 | #define MAXBITS (LUAI_BITSINT-2) |
45 | #endif | 45 | #endif |
46 | 46 | ||
47 | #define MAXASIZE (1 << MAXBITS) | 47 | #define MAXASIZE (1 << MAXBITS) |
@@ -120,7 +120,7 @@ static int arrayindex (const TValue *key) { | |||
120 | lua_Number n = nvalue(key); | 120 | lua_Number n = nvalue(key); |
121 | int k; | 121 | int k; |
122 | lua_number2int(k, n); | 122 | lua_number2int(k, n); |
123 | if (luac_numeq(cast(lua_Number, k), nvalue(key))) | 123 | if (luai_numeq(cast(lua_Number, k), nvalue(key))) |
124 | return k; | 124 | return k; |
125 | } | 125 | } |
126 | return -1; /* `key' did not match some condition */ | 126 | return -1; /* `key' did not match some condition */ |
@@ -437,7 +437,7 @@ const TValue *luaH_getnum (Table *t, int key) { | |||
437 | lua_Number nk = cast(lua_Number, key); | 437 | lua_Number nk = cast(lua_Number, key); |
438 | Node *n = hashnum(t, nk); | 438 | Node *n = hashnum(t, nk); |
439 | do { /* check whether `key' is somewhere in the chain */ | 439 | do { /* check whether `key' is somewhere in the chain */ |
440 | if (ttisnumber(gkey(n)) && luac_numeq(nvalue(gkey(n)), nk)) | 440 | if (ttisnumber(gkey(n)) && luai_numeq(nvalue(gkey(n)), nk)) |
441 | return gval(n); /* that's it */ | 441 | return gval(n); /* that's it */ |
442 | else n = gnext(n); | 442 | else n = gnext(n); |
443 | } while (n); | 443 | } while (n); |
@@ -470,7 +470,7 @@ const TValue *luaH_get (Table *t, const TValue *key) { | |||
470 | case LUA_TNUMBER: { | 470 | case LUA_TNUMBER: { |
471 | int k; | 471 | int k; |
472 | lua_number2int(k, (nvalue(key))); | 472 | lua_number2int(k, (nvalue(key))); |
473 | if (luac_numeq(cast(lua_Number, k), nvalue(key))) /* index is integer? */ | 473 | if (luai_numeq(cast(lua_Number, k), nvalue(key))) /* index is integer? */ |
474 | return luaH_getnum(t, k); /* use specialized version */ | 474 | return luaH_getnum(t, k); /* use specialized version */ |
475 | /* else go through */ | 475 | /* else go through */ |
476 | } | 476 | } |
@@ -494,7 +494,7 @@ TValue *luaH_set (lua_State *L, Table *t, const TValue *key) { | |||
494 | return cast(TValue *, p); | 494 | return cast(TValue *, p); |
495 | else { | 495 | else { |
496 | if (ttisnil(key)) luaG_runerror(L, "table index is nil"); | 496 | if (ttisnil(key)) luaG_runerror(L, "table index is nil"); |
497 | else if (ttisnumber(key) && !luac_numeq(nvalue(key), nvalue(key))) | 497 | else if (ttisnumber(key) && !luai_numeq(nvalue(key), nvalue(key))) |
498 | luaG_runerror(L, "table index is NaN"); | 498 | luaG_runerror(L, "table index is NaN"); |
499 | return newkey(L, t, key); | 499 | return newkey(L, t, key); |
500 | } | 500 | } |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: luaconf.h,v 1.33 2005/03/08 18:09:16 roberto Exp roberto $ | 2 | ** $Id: luaconf.h,v 1.34 2005/03/08 20:10:05 roberto Exp roberto $ |
3 | ** Configuration file for Lua | 3 | ** Configuration file for Lua |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -152,16 +152,16 @@ | |||
152 | 152 | ||
153 | 153 | ||
154 | /* CONFIG: LUA-C API assertions */ | 154 | /* CONFIG: LUA-C API assertions */ |
155 | #define luac_apicheck(L,o) lua_assert(o) | 155 | #define luai_apicheck(L,o) lua_assert(o) |
156 | 156 | ||
157 | 157 | ||
158 | /* number of bits in an `int' */ | 158 | /* number of bits in an `int' */ |
159 | /* avoid overflows in comparison */ | 159 | /* avoid overflows in comparison */ |
160 | #if INT_MAX-20 < 32760 | 160 | #if INT_MAX-20 < 32760 |
161 | #define LUAC_BITSINT 16 | 161 | #define LUAI_BITSINT 16 |
162 | #elif INT_MAX > 2147483640L | 162 | #elif INT_MAX > 2147483640L |
163 | /* `int' has at least 32 bits */ | 163 | /* `int' has at least 32 bits */ |
164 | #define LUAC_BITSINT 32 | 164 | #define LUAI_BITSINT 32 |
165 | #else | 165 | #else |
166 | #error "you must define LUA_BITSINT with number of bits in an integer" | 166 | #error "you must define LUA_BITSINT with number of bits in an integer" |
167 | #endif | 167 | #endif |
@@ -169,59 +169,59 @@ | |||
169 | 169 | ||
170 | /* | 170 | /* |
171 | ** CONFIG: | 171 | ** CONFIG: |
172 | ** LUAC_UINT32: unsigned integer with at least 32 bits | 172 | ** LUAI_UINT32: unsigned integer with at least 32 bits |
173 | ** LUAC_INT32: signed integer with at least 32 bits | 173 | ** LUAI_INT32: signed integer with at least 32 bits |
174 | ** LUAC_UMEM: an unsigned integer big enough to count the total memory | 174 | ** LUAI_UMEM: an unsigned integer big enough to count the total memory |
175 | ** used by Lua | 175 | ** used by Lua |
176 | ** LUAC_MEM: a signed integer big enough to count the total memory used by Lua | 176 | ** LUAI_MEM: a signed integer big enough to count the total memory used by Lua |
177 | */ | 177 | */ |
178 | #if LUAC_BITSINT >= 32 | 178 | #if LUAI_BITSINT >= 32 |
179 | #define LUAC_UINT32 unsigned int | 179 | #define LUAI_UINT32 unsigned int |
180 | #define LUAC_INT32 int | 180 | #define LUAI_INT32 int |
181 | #define LUAC_MAXINT32 INT_MAX | 181 | #define LUAI_MAXINT32 INT_MAX |
182 | #define LUAC_UMEM size_t | 182 | #define LUAI_UMEM size_t |
183 | #define LUAC_MEM ptrdiff_t | 183 | #define LUAI_MEM ptrdiff_t |
184 | #else | 184 | #else |
185 | /* 16-bit ints */ | 185 | /* 16-bit ints */ |
186 | #define LUAC_UINT32 unsigned long | 186 | #define LUAI_UINT32 unsigned long |
187 | #define LUAC_INT32 long | 187 | #define LUAI_INT32 long |
188 | #define LUAC_MAXINT32 LONG_MAX | 188 | #define LUAI_MAXINT32 LONG_MAX |
189 | #define LUAC_UMEM LUAC_UINT32 | 189 | #define LUAI_UMEM LUAI_UINT32 |
190 | #define LUAC_MEM ptrdiff_t | 190 | #define LUAI_MEM ptrdiff_t |
191 | #endif | 191 | #endif |
192 | 192 | ||
193 | 193 | ||
194 | /* CONFIG: maximum depth for calls (unsigned short) */ | 194 | /* CONFIG: maximum depth for calls (unsigned short) */ |
195 | #define LUAC_MAXCALLS 10000 | 195 | #define LUAI_MAXCALLS 10000 |
196 | 196 | ||
197 | /* | 197 | /* |
198 | ** CONFIG: maximum depth for C calls (unsigned short): Not too big, or may | 198 | ** CONFIG: maximum depth for C calls (unsigned short): Not too big, or may |
199 | ** overflow the C stack... | 199 | ** overflow the C stack... |
200 | */ | 200 | */ |
201 | #define LUAC_MAXCCALLS 200 | 201 | #define LUAI_MAXCCALLS 200 |
202 | 202 | ||
203 | 203 | ||
204 | /* CONFIG: maximum size for the virtual stack of a C function */ | 204 | /* CONFIG: maximum size for the virtual stack of a C function */ |
205 | #define LUAC_MAXCSTACK 2048 | 205 | #define LUAI_MAXCSTACK 2048 |
206 | 206 | ||
207 | 207 | ||
208 | /* | 208 | /* |
209 | ** CONFIG: maximum number of syntactical nested non-terminals: Not too big, | 209 | ** CONFIG: maximum number of syntactical nested non-terminals: Not too big, |
210 | ** or may overflow the C stack... | 210 | ** or may overflow the C stack... |
211 | */ | 211 | */ |
212 | #define LUAC_MAXPARSERLEVEL 200 | 212 | #define LUAI_MAXPARSERLEVEL 200 |
213 | 213 | ||
214 | 214 | ||
215 | /* CONFIG: maximum number of variables declared in a function */ | 215 | /* CONFIG: maximum number of variables declared in a function */ |
216 | #define LUAC_MAXVARS 200 /* <MAXSTACK */ | 216 | #define LUAI_MAXVARS 200 /* <MAXSTACK */ |
217 | 217 | ||
218 | 218 | ||
219 | /* CONFIG: maximum number of upvalues per function */ | 219 | /* CONFIG: maximum number of upvalues per function */ |
220 | #define LUAC_MAXUPVALUES 60 /* <MAXSTACK */ | 220 | #define LUAI_MAXUPVALUES 60 /* <MAXSTACK */ |
221 | 221 | ||
222 | 222 | ||
223 | /* CONFIG: maximum size of expressions for optimizing `while' code */ | 223 | /* CONFIG: maximum size of expressions for optimizing `while' code */ |
224 | #define LUAC_MAXEXPWHILE 100 | 224 | #define LUAI_MAXEXPWHILE 100 |
225 | 225 | ||
226 | 226 | ||
227 | /* CONFIG: function to convert a lua_Number to int (with any rounding method) */ | 227 | /* CONFIG: function to convert a lua_Number to int (with any rounding method) */ |
@@ -257,7 +257,7 @@ __inline int l_lrint (double flt) | |||
257 | /* CONFIG: function to convert a lua_Number to a string */ | 257 | /* CONFIG: function to convert a lua_Number to a string */ |
258 | #define lua_number2str(s,n) sprintf((s), LUA_NUMBER_FMT, (n)) | 258 | #define lua_number2str(s,n) sprintf((s), LUA_NUMBER_FMT, (n)) |
259 | /* maximum size of previous conversion */ | 259 | /* maximum size of previous conversion */ |
260 | #define LUAC_MAXNUMBER2STR 32 /* 16 digits, sign, point, and \0 */ | 260 | #define LUAI_MAXNUMBER2STR 32 /* 16 digits, sign, point, and \0 */ |
261 | 261 | ||
262 | /* CONFIG: function to convert a string to a lua_Number */ | 262 | /* CONFIG: function to convert a string to a lua_Number */ |
263 | #define lua_str2number(s,p) strtod((s), (p)) | 263 | #define lua_str2number(s,p) strtod((s), (p)) |
@@ -265,25 +265,25 @@ __inline int l_lrint (double flt) | |||
265 | 265 | ||
266 | 266 | ||
267 | /* CONFIG: result of a `usual argument conversion' over lua_Number */ | 267 | /* CONFIG: result of a `usual argument conversion' over lua_Number */ |
268 | #define LUAC_UACNUMBER double | 268 | #define LUAI_UACNUMBER double |
269 | 269 | ||
270 | 270 | ||
271 | /* CONFIG: primitive operators for numbers */ | 271 | /* CONFIG: primitive operators for numbers */ |
272 | #define luac_numadd(a,b) ((a)+(b)) | 272 | #define luai_numadd(a,b) ((a)+(b)) |
273 | #define luac_numsub(a,b) ((a)-(b)) | 273 | #define luai_numsub(a,b) ((a)-(b)) |
274 | #define luac_nummul(a,b) ((a)*(b)) | 274 | #define luai_nummul(a,b) ((a)*(b)) |
275 | #define luac_numdiv(a,b) ((a)/(b)) | 275 | #define luai_numdiv(a,b) ((a)/(b)) |
276 | #define luac_numunm(a) (-(a)) | 276 | #define luai_numunm(a) (-(a)) |
277 | #define luac_numeq(a,b) ((a)==(b)) | 277 | #define luai_numeq(a,b) ((a)==(b)) |
278 | #define luac_numlt(a,b) ((a)<(b)) | 278 | #define luai_numlt(a,b) ((a)<(b)) |
279 | #define luac_numle(a,b) ((a)<=(b)) | 279 | #define luai_numle(a,b) ((a)<=(b)) |
280 | #define luac_nummod(a,b) ((a) - floor((a)/(b))*(b)) | 280 | #define luai_nummod(a,b) ((a) - floor((a)/(b))*(b)) |
281 | #define luac_numpow(a,b) pow(a,b) | 281 | #define luai_numpow(a,b) pow(a,b) |
282 | 282 | ||
283 | 283 | ||
284 | 284 | ||
285 | /* CONFIG: type to ensure maximum alignment */ | 285 | /* CONFIG: type to ensure maximum alignment */ |
286 | #define LUAC_USER_ALIGNMENT_T union { double u; void *s; long l; } | 286 | #define LUAI_USER_ALIGNMENT_T union { double u; void *s; long l; } |
287 | 287 | ||
288 | 288 | ||
289 | /* | 289 | /* |
@@ -294,16 +294,16 @@ __inline int l_lrint (double flt) | |||
294 | */ | 294 | */ |
295 | #ifndef __cplusplus | 295 | #ifndef __cplusplus |
296 | /* default handling with long jumps */ | 296 | /* default handling with long jumps */ |
297 | #define LUAC_THROW(L,c) longjmp((c)->b, 1) | 297 | #define LUAI_THROW(L,c) longjmp((c)->b, 1) |
298 | #define LUAC_TRY(L,c,a) if (setjmp((c)->b) == 0) { a } | 298 | #define LUAI_TRY(L,c,a) if (setjmp((c)->b) == 0) { a } |
299 | #define luac_jmpbuf jmp_buf | 299 | #define luai_jmpbuf jmp_buf |
300 | 300 | ||
301 | #else | 301 | #else |
302 | /* C++ exceptions */ | 302 | /* C++ exceptions */ |
303 | #define LUAC_THROW(L,c) throw(c) | 303 | #define LUAI_THROW(L,c) throw(c) |
304 | #define LUAC_TRY(L,c,a) try { a } catch(...) \ | 304 | #define LUAI_TRY(L,c,a) try { a } catch(...) \ |
305 | { if ((c)->status == 0) (c)->status = -1; } | 305 | { if ((c)->status == 0) (c)->status = -1; } |
306 | #define luac_jmpbuf int /* dummy variable */ | 306 | #define luai_jmpbuf int /* dummy variable */ |
307 | #endif | 307 | #endif |
308 | 308 | ||
309 | 309 | ||
@@ -349,9 +349,9 @@ __inline int l_lrint (double flt) | |||
349 | ** want (or do not want) `os.tmpname' available. | 349 | ** want (or do not want) `os.tmpname' available. |
350 | */ | 350 | */ |
351 | #ifdef __GNUC__ | 351 | #ifdef __GNUC__ |
352 | #define LUA_USETMPNAME 0 | 352 | #define LUA_USE_TMPNAME 0 |
353 | #else | 353 | #else |
354 | #define LUA_USETMPNAME 1 | 354 | #define LUA_USE_TMPNAME 1 |
355 | #endif | 355 | #endif |
356 | 356 | ||
357 | 357 | ||
@@ -359,15 +359,15 @@ __inline int l_lrint (double flt) | |||
359 | ** CONFIG: Configuration for loadlib: Lua tries to guess the | 359 | ** CONFIG: Configuration for loadlib: Lua tries to guess the |
360 | ** dynamic-library system that your platform uses (either Windows' DLL, | 360 | ** dynamic-library system that your platform uses (either Windows' DLL, |
361 | ** Mac's dyld, or dlopen). If your system is some kind of Unix, there is | 361 | ** Mac's dyld, or dlopen). If your system is some kind of Unix, there is |
362 | ** a good chance that LUA_USEDLOPEN will work for it. You may need to adapt | 362 | ** a good chance that LUA_USE_DLOPEN will work for it. You may need to adapt |
363 | ** also the makefile. | 363 | ** also the makefile. |
364 | */ | 364 | */ |
365 | #if defined(_WIN32) | 365 | #if defined(_WIN32) |
366 | #define LUA_USEDLL | 366 | #define LUA_USE_DLL |
367 | #elif defined(__APPLE__) && defined(__MACH__) | 367 | #elif defined(__APPLE__) && defined(__MACH__) |
368 | #define LUA_USEDYLD | 368 | #define LUA_USE_DYLD |
369 | #elif defined(__linux) || defined(sun) || defined(sgi) || defined(BSD) | 369 | #elif defined(__linux) || defined(sun) || defined(sgi) || defined(BSD) |
370 | #define LUA_USEDLOPEN | 370 | #define LUA_USE_DLOPEN |
371 | #endif | 371 | #endif |
372 | 372 | ||
373 | 373 | ||
@@ -376,7 +376,7 @@ __inline int l_lrint (double flt) | |||
376 | 376 | ||
377 | /* Local configuration */ | 377 | /* Local configuration */ |
378 | 378 | ||
379 | #undef LUA_USETMPNAME | 379 | #undef LUA_USE_TMPNAME |
380 | #define LUA_USETMPNAME 1 | 380 | #define LUA_USE_TMPNAME 1 |
381 | 381 | ||
382 | #endif | 382 | #endif |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lvm.c,v 2.30 2005/03/08 18:09:16 roberto Exp roberto $ | 2 | ** $Id: lvm.c,v 2.31 2005/03/08 20:10:05 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 | */ |
@@ -49,7 +49,7 @@ int luaV_tostring (lua_State *L, StkId obj) { | |||
49 | if (!ttisnumber(obj)) | 49 | if (!ttisnumber(obj)) |
50 | return 0; | 50 | return 0; |
51 | else { | 51 | else { |
52 | char s[LUAC_MAXNUMBER2STR]; | 52 | char s[LUAI_MAXNUMBER2STR]; |
53 | lua_number2str(s, nvalue(obj)); | 53 | lua_number2str(s, nvalue(obj)); |
54 | setsvalue2s(L, obj, luaS_new(L, s)); | 54 | setsvalue2s(L, obj, luaS_new(L, s)); |
55 | return 1; | 55 | return 1; |
@@ -243,7 +243,7 @@ int luaV_lessthan (lua_State *L, const TValue *l, const TValue *r) { | |||
243 | if (ttype(l) != ttype(r)) | 243 | if (ttype(l) != ttype(r)) |
244 | return luaG_ordererror(L, l, r); | 244 | return luaG_ordererror(L, l, r); |
245 | else if (ttisnumber(l)) | 245 | else if (ttisnumber(l)) |
246 | return luac_numlt(nvalue(l), nvalue(r)); | 246 | return luai_numlt(nvalue(l), nvalue(r)); |
247 | else if (ttisstring(l)) | 247 | else if (ttisstring(l)) |
248 | return l_strcmp(rawtsvalue(l), rawtsvalue(r)) < 0; | 248 | return l_strcmp(rawtsvalue(l), rawtsvalue(r)) < 0; |
249 | else if ((res = call_orderTM(L, l, r, TM_LT)) != -1) | 249 | else if ((res = call_orderTM(L, l, r, TM_LT)) != -1) |
@@ -257,7 +257,7 @@ static int lessequal (lua_State *L, const TValue *l, const TValue *r) { | |||
257 | if (ttype(l) != ttype(r)) | 257 | if (ttype(l) != ttype(r)) |
258 | return luaG_ordererror(L, l, r); | 258 | return luaG_ordererror(L, l, r); |
259 | else if (ttisnumber(l)) | 259 | else if (ttisnumber(l)) |
260 | return luac_numle(nvalue(l), nvalue(r)); | 260 | return luai_numle(nvalue(l), nvalue(r)); |
261 | else if (ttisstring(l)) | 261 | else if (ttisstring(l)) |
262 | return l_strcmp(rawtsvalue(l), rawtsvalue(r)) <= 0; | 262 | return l_strcmp(rawtsvalue(l), rawtsvalue(r)) <= 0; |
263 | else if ((res = call_orderTM(L, l, r, TM_LE)) != -1) /* first try `le' */ | 263 | else if ((res = call_orderTM(L, l, r, TM_LE)) != -1) /* first try `le' */ |
@@ -273,7 +273,7 @@ int luaV_equalval (lua_State *L, const TValue *t1, const TValue *t2) { | |||
273 | lua_assert(ttype(t1) == ttype(t2)); | 273 | lua_assert(ttype(t1) == ttype(t2)); |
274 | switch (ttype(t1)) { | 274 | switch (ttype(t1)) { |
275 | case LUA_TNIL: return 1; | 275 | case LUA_TNIL: return 1; |
276 | case LUA_TNUMBER: return luac_numeq(nvalue(t1), nvalue(t2)); | 276 | case LUA_TNUMBER: return luai_numeq(nvalue(t1), nvalue(t2)); |
277 | case LUA_TBOOLEAN: return bvalue(t1) == bvalue(t2); /* true must be 1 !! */ | 277 | case LUA_TBOOLEAN: return bvalue(t1) == bvalue(t2); /* true must be 1 !! */ |
278 | case LUA_TLIGHTUSERDATA: return pvalue(t1) == pvalue(t2); | 278 | case LUA_TLIGHTUSERDATA: return pvalue(t1) == pvalue(t2); |
279 | case LUA_TUSERDATA: { | 279 | case LUA_TUSERDATA: { |
@@ -338,12 +338,12 @@ static StkId Arith (lua_State *L, StkId ra, const TValue *rb, | |||
338 | (c = luaV_tonumber(rc, &tempc)) != NULL) { | 338 | (c = luaV_tonumber(rc, &tempc)) != NULL) { |
339 | lua_Number nb = nvalue(b), nc = nvalue(c); | 339 | lua_Number nb = nvalue(b), nc = nvalue(c); |
340 | switch (op) { | 340 | switch (op) { |
341 | case TM_ADD: setnvalue(ra, luac_numadd(nb, nc)); break; | 341 | case TM_ADD: setnvalue(ra, luai_numadd(nb, nc)); break; |
342 | case TM_SUB: setnvalue(ra, luac_numsub(nb, nc)); break; | 342 | case TM_SUB: setnvalue(ra, luai_numsub(nb, nc)); break; |
343 | case TM_MUL: setnvalue(ra, luac_nummul(nb, nc)); break; | 343 | case TM_MUL: setnvalue(ra, luai_nummul(nb, nc)); break; |
344 | case TM_DIV: setnvalue(ra, luac_numdiv(nb, nc)); break; | 344 | case TM_DIV: setnvalue(ra, luai_numdiv(nb, nc)); break; |
345 | case TM_MOD: setnvalue(ra, luac_nummod(nb, nc)); break; | 345 | case TM_MOD: setnvalue(ra, luai_nummod(nb, nc)); break; |
346 | case TM_POW: setnvalue(ra, luac_numpow(nb, nc)); break; | 346 | case TM_POW: setnvalue(ra, luai_numpow(nb, nc)); break; |
347 | default: lua_assert(0); break; | 347 | default: lua_assert(0); break; |
348 | } | 348 | } |
349 | } | 349 | } |
@@ -480,7 +480,7 @@ StkId luaV_execute (lua_State *L, int nexeccalls) { | |||
480 | TValue *rc = RKC(i); | 480 | TValue *rc = RKC(i); |
481 | if (ttisnumber(rb) && ttisnumber(rc)) { | 481 | if (ttisnumber(rb) && ttisnumber(rc)) { |
482 | lua_Number nb = nvalue(rb), nc = nvalue(rc); | 482 | lua_Number nb = nvalue(rb), nc = nvalue(rc); |
483 | setnvalue(ra, luac_numadd(nb, nc)); | 483 | setnvalue(ra, luai_numadd(nb, nc)); |
484 | } | 484 | } |
485 | else | 485 | else |
486 | base = Arith(L, ra, rb, rc, TM_ADD, pc); /***/ | 486 | base = Arith(L, ra, rb, rc, TM_ADD, pc); /***/ |
@@ -491,7 +491,7 @@ StkId luaV_execute (lua_State *L, int nexeccalls) { | |||
491 | TValue *rc = RKC(i); | 491 | TValue *rc = RKC(i); |
492 | if (ttisnumber(rb) && ttisnumber(rc)) { | 492 | if (ttisnumber(rb) && ttisnumber(rc)) { |
493 | lua_Number nb = nvalue(rb), nc = nvalue(rc); | 493 | lua_Number nb = nvalue(rb), nc = nvalue(rc); |
494 | setnvalue(ra, luac_numsub(nb, nc)); | 494 | setnvalue(ra, luai_numsub(nb, nc)); |
495 | } | 495 | } |
496 | else | 496 | else |
497 | base = Arith(L, ra, rb, rc, TM_SUB, pc); /***/ | 497 | base = Arith(L, ra, rb, rc, TM_SUB, pc); /***/ |
@@ -502,7 +502,7 @@ StkId luaV_execute (lua_State *L, int nexeccalls) { | |||
502 | TValue *rc = RKC(i); | 502 | TValue *rc = RKC(i); |
503 | if (ttisnumber(rb) && ttisnumber(rc)) { | 503 | if (ttisnumber(rb) && ttisnumber(rc)) { |
504 | lua_Number nb = nvalue(rb), nc = nvalue(rc); | 504 | lua_Number nb = nvalue(rb), nc = nvalue(rc); |
505 | setnvalue(ra, luac_nummul(nb, nc)); | 505 | setnvalue(ra, luai_nummul(nb, nc)); |
506 | } | 506 | } |
507 | else | 507 | else |
508 | base = Arith(L, ra, rb, rc, TM_MUL, pc); /***/ | 508 | base = Arith(L, ra, rb, rc, TM_MUL, pc); /***/ |
@@ -513,7 +513,7 @@ StkId luaV_execute (lua_State *L, int nexeccalls) { | |||
513 | TValue *rc = RKC(i); | 513 | TValue *rc = RKC(i); |
514 | if (ttisnumber(rb) && ttisnumber(rc)) { | 514 | if (ttisnumber(rb) && ttisnumber(rc)) { |
515 | lua_Number nb = nvalue(rb), nc = nvalue(rc); | 515 | lua_Number nb = nvalue(rb), nc = nvalue(rc); |
516 | setnvalue(ra, luac_numdiv(nb, nc)); | 516 | setnvalue(ra, luai_numdiv(nb, nc)); |
517 | } | 517 | } |
518 | else | 518 | else |
519 | base = Arith(L, ra, rb, rc, TM_DIV, pc); /***/ | 519 | base = Arith(L, ra, rb, rc, TM_DIV, pc); /***/ |
@@ -524,7 +524,7 @@ StkId luaV_execute (lua_State *L, int nexeccalls) { | |||
524 | TValue *rc = RKC(i); | 524 | TValue *rc = RKC(i); |
525 | if (ttisnumber(rb) && ttisnumber(rc)) { | 525 | if (ttisnumber(rb) && ttisnumber(rc)) { |
526 | lua_Number nb = nvalue(rb), nc = nvalue(rc); | 526 | lua_Number nb = nvalue(rb), nc = nvalue(rc); |
527 | setnvalue(ra, luac_nummod(nb, nc)); | 527 | setnvalue(ra, luai_nummod(nb, nc)); |
528 | } | 528 | } |
529 | else | 529 | else |
530 | base = Arith(L, ra, rb, rc, TM_MOD, pc); /***/ | 530 | base = Arith(L, ra, rb, rc, TM_MOD, pc); /***/ |
@@ -535,7 +535,7 @@ StkId luaV_execute (lua_State *L, int nexeccalls) { | |||
535 | TValue *rc = RKC(i); | 535 | TValue *rc = RKC(i); |
536 | if (ttisnumber(rb) && ttisnumber(rc)) { | 536 | if (ttisnumber(rb) && ttisnumber(rc)) { |
537 | lua_Number nb = nvalue(rb), nc = nvalue(rc); | 537 | lua_Number nb = nvalue(rb), nc = nvalue(rc); |
538 | setnvalue(ra, luac_numpow(nb, nc)); | 538 | setnvalue(ra, luai_numpow(nb, nc)); |
539 | } | 539 | } |
540 | else | 540 | else |
541 | base = Arith(L, ra, rb, rc, TM_POW, pc); /***/ | 541 | base = Arith(L, ra, rb, rc, TM_POW, pc); /***/ |
@@ -546,7 +546,7 @@ StkId luaV_execute (lua_State *L, int nexeccalls) { | |||
546 | TValue temp; | 546 | TValue temp; |
547 | if (tonumber(rb, &temp)) { | 547 | if (tonumber(rb, &temp)) { |
548 | lua_Number nb = nvalue(rb); | 548 | lua_Number nb = nvalue(rb); |
549 | setnvalue(ra, luac_numunm(nb)); | 549 | setnvalue(ra, luai_numunm(nb)); |
550 | } | 550 | } |
551 | else { | 551 | else { |
552 | setnilvalue(&temp); | 552 | setnilvalue(&temp); |
@@ -682,9 +682,9 @@ StkId luaV_execute (lua_State *L, int nexeccalls) { | |||
682 | } | 682 | } |
683 | case OP_FORLOOP: { | 683 | case OP_FORLOOP: { |
684 | lua_Number step = nvalue(ra+2); | 684 | lua_Number step = nvalue(ra+2); |
685 | lua_Number idx = luac_numadd(nvalue(ra), step); /* increment index */ | 685 | lua_Number idx = luai_numadd(nvalue(ra), step); /* increment index */ |
686 | lua_Number limit = nvalue(ra+1); | 686 | lua_Number limit = nvalue(ra+1); |
687 | if (step > 0 ? luac_numle(idx, limit) : luac_numle(limit, idx)) { | 687 | if (step > 0 ? luai_numle(idx, limit) : luai_numle(limit, idx)) { |
688 | dojump(L, pc, GETARG_sBx(i)); /* jump back */ | 688 | dojump(L, pc, GETARG_sBx(i)); /* jump back */ |
689 | setnvalue(ra, idx); /* update internal index... */ | 689 | setnvalue(ra, idx); /* update internal index... */ |
690 | setnvalue(ra+3, idx); /* ...and external index */ | 690 | setnvalue(ra+3, idx); /* ...and external index */ |
@@ -702,7 +702,7 @@ StkId luaV_execute (lua_State *L, int nexeccalls) { | |||
702 | luaG_runerror(L, "`for' limit must be a number"); | 702 | luaG_runerror(L, "`for' limit must be a number"); |
703 | else if (!tonumber(pstep, ra+2)) | 703 | else if (!tonumber(pstep, ra+2)) |
704 | luaG_runerror(L, "`for' step must be a number"); | 704 | luaG_runerror(L, "`for' step must be a number"); |
705 | setnvalue(ra, luac_numsub(nvalue(ra), nvalue(pstep))); | 705 | setnvalue(ra, luai_numsub(nvalue(ra), nvalue(pstep))); |
706 | dojump(L, pc, GETARG_sBx(i)); | 706 | dojump(L, pc, GETARG_sBx(i)); |
707 | continue; | 707 | continue; |
708 | } | 708 | } |