mirror of
https://github.com/lua/lua.git
synced 2025-01-14 05:43:00 +08:00
some more `const's
This commit is contained in:
parent
4e9f2d13d5
commit
8e7451512f
7
ldo.c
7
ldo.c
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
** $Id: ldo.c,v 1.48 1999/10/04 17:51:04 roberto Exp roberto $
|
** $Id: ldo.c,v 1.49 1999/10/14 17:53:35 roberto Exp roberto $
|
||||||
** Stack and Call structure of Lua
|
** Stack and Call structure of Lua
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
@ -101,7 +101,7 @@ void luaD_lineHook (int line) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void luaD_callHook (StkId base, TProtoFunc *tf, int isreturn) {
|
void luaD_callHook (StkId base, const TProtoFunc *tf, int isreturn) {
|
||||||
struct C_Lua_Stack oldCLS = L->Cstack;
|
struct C_Lua_Stack oldCLS = L->Cstack;
|
||||||
StkId old_top = L->Cstack.lua2C = L->Cstack.base = L->stack.top-L->stack.stack;
|
StkId old_top = L->Cstack.lua2C = L->Cstack.base = L->stack.top-L->stack.stack;
|
||||||
L->Cstack.num = 0;
|
L->Cstack.num = 0;
|
||||||
@ -143,7 +143,8 @@ static StkId callC (lua_CFunction f, StkId base) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static StkId callCclosure (struct Closure *cl, lua_CFunction f, StkId base) {
|
static StkId callCclosure (const struct Closure *cl,
|
||||||
|
lua_CFunction f, StkId base) {
|
||||||
TObject *pbase;
|
TObject *pbase;
|
||||||
int nup = cl->nelems; /* number of upvalues */
|
int nup = cl->nelems; /* number of upvalues */
|
||||||
luaD_checkstack(nup);
|
luaD_checkstack(nup);
|
||||||
|
4
ldo.h
4
ldo.h
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
** $Id: ldo.h,v 1.7 1999/08/16 20:52:00 roberto Exp roberto $
|
** $Id: ldo.h,v 1.8 1999/10/04 17:51:04 roberto Exp roberto $
|
||||||
** Stack and Call structure of Lua
|
** Stack and Call structure of Lua
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
@ -34,7 +34,7 @@ void luaD_init (void);
|
|||||||
void luaD_adjusttop (StkId newtop);
|
void luaD_adjusttop (StkId newtop);
|
||||||
void luaD_openstack (int nelems);
|
void luaD_openstack (int nelems);
|
||||||
void luaD_lineHook (int line);
|
void luaD_lineHook (int line);
|
||||||
void luaD_callHook (StkId base, TProtoFunc *tf, int isreturn);
|
void luaD_callHook (StkId base, const TProtoFunc *tf, int isreturn);
|
||||||
void luaD_calln (int nArgs, int nResults);
|
void luaD_calln (int nArgs, int nResults);
|
||||||
void luaD_callTM (const TObject *f, int nParams, int nResults);
|
void luaD_callTM (const TObject *f, int nParams, int nResults);
|
||||||
int luaD_protectedrun (void);
|
int luaD_protectedrun (void);
|
||||||
|
5
lfunc.c
5
lfunc.c
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
** $Id: lfunc.c,v 1.11 1999/08/16 20:52:00 roberto Exp roberto $
|
** $Id: lfunc.c,v 1.12 1999/10/04 17:51:04 roberto Exp roberto $
|
||||||
** Auxiliary functions to manipulate prototypes and closures
|
** Auxiliary functions to manipulate prototypes and closures
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
@ -62,7 +62,8 @@ void luaF_freeclosure (Closure *c) {
|
|||||||
** Look for n-th local variable at line "line" in function "func".
|
** Look for n-th local variable at line "line" in function "func".
|
||||||
** Returns NULL if not found.
|
** Returns NULL if not found.
|
||||||
*/
|
*/
|
||||||
const char *luaF_getlocalname (TProtoFunc *func, int local_number, int line) {
|
const char *luaF_getlocalname (const TProtoFunc *func,
|
||||||
|
int local_number, int line) {
|
||||||
int count = 0;
|
int count = 0;
|
||||||
const char *varname = NULL;
|
const char *varname = NULL;
|
||||||
LocVar *lv = func->locvars;
|
LocVar *lv = func->locvars;
|
||||||
|
5
lfunc.h
5
lfunc.h
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
** $Id: lfunc.h,v 1.6 1999/08/16 20:52:00 roberto Exp roberto $
|
** $Id: lfunc.h,v 1.7 1999/10/04 17:51:04 roberto Exp roberto $
|
||||||
** Lua Function structures
|
** Lua Function structures
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
@ -17,7 +17,8 @@ Closure *luaF_newclosure (int nelems);
|
|||||||
void luaF_freeproto (TProtoFunc *f);
|
void luaF_freeproto (TProtoFunc *f);
|
||||||
void luaF_freeclosure (Closure *c);
|
void luaF_freeclosure (Closure *c);
|
||||||
|
|
||||||
const char *luaF_getlocalname (TProtoFunc *func, int local_number, int line);
|
const char *luaF_getlocalname (const TProtoFunc *func,
|
||||||
|
int local_number, int line);
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
6
lvm.c
6
lvm.c
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
** $Id: lvm.c,v 1.62 1999/09/17 16:53:54 roberto Exp roberto $
|
** $Id: lvm.c,v 1.63 1999/10/14 19:13:31 roberto Exp roberto $
|
||||||
** Lua virtual machine
|
** Lua virtual machine
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
@ -35,7 +35,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
static TaggedString *strconc (TaggedString *l, TaggedString *r) {
|
static TaggedString *strconc (const TaggedString *l, const TaggedString *r) {
|
||||||
long nl = l->u.s.len;
|
long nl = l->u.s.len;
|
||||||
long nr = r->u.s.len;
|
long nr = r->u.s.len;
|
||||||
char *buffer = luaL_openspace(nl+nr);
|
char *buffer = luaL_openspace(nl+nr);
|
||||||
@ -296,7 +296,7 @@ static void adjust_varargs (StkId first_extra_arg) {
|
|||||||
** [stack+base,top). Returns n such that the the results are between
|
** [stack+base,top). Returns n such that the the results are between
|
||||||
** [stack+n,top).
|
** [stack+n,top).
|
||||||
*/
|
*/
|
||||||
StkId luaV_execute (Closure *cl, TProtoFunc *tf, StkId base) {
|
StkId luaV_execute (const Closure *cl, const TProtoFunc *tf, StkId base) {
|
||||||
struct Stack *S = &L->stack; /* to optimize */
|
struct Stack *S = &L->stack; /* to optimize */
|
||||||
register const Byte *pc = tf->code;
|
register const Byte *pc = tf->code;
|
||||||
const TObject *consts = tf->consts;
|
const TObject *consts = tf->consts;
|
||||||
|
4
lvm.h
4
lvm.h
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
** $Id: lvm.h,v 1.8 1999/02/08 17:07:59 roberto Exp roberto $
|
** $Id: lvm.h,v 1.9 1999/08/16 20:52:00 roberto Exp roberto $
|
||||||
** Lua virtual machine
|
** Lua virtual machine
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
@ -26,7 +26,7 @@ void luaV_settable (const TObject *t);
|
|||||||
void luaV_rawsettable (const TObject *t);
|
void luaV_rawsettable (const TObject *t);
|
||||||
void luaV_getglobal (TaggedString *ts);
|
void luaV_getglobal (TaggedString *ts);
|
||||||
void luaV_setglobal (TaggedString *ts);
|
void luaV_setglobal (TaggedString *ts);
|
||||||
StkId luaV_execute (Closure *cl, TProtoFunc *tf, StkId base);
|
StkId luaV_execute (const Closure *cl, const TProtoFunc *tf, StkId base);
|
||||||
void luaV_closure (int nelems);
|
void luaV_closure (int nelems);
|
||||||
void luaV_comparison (lua_Type ttype_less, lua_Type ttype_equal,
|
void luaV_comparison (lua_Type ttype_less, lua_Type ttype_equal,
|
||||||
lua_Type ttype_great, IMS op);
|
lua_Type ttype_great, IMS op);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user