aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1999-10-14 17:46:57 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1999-10-14 17:46:57 -0200
commit8e7451512f01a89b4230be65cf086f7c1d41d2e2 (patch)
tree2679a6305b6d7612ca9705142e3d4dbdcf32d676
parent4e9f2d13d5b6fa71ca480394e0b7e75463d4aeec (diff)
downloadlua-8e7451512f01a89b4230be65cf086f7c1d41d2e2.tar.gz
lua-8e7451512f01a89b4230be65cf086f7c1d41d2e2.tar.bz2
lua-8e7451512f01a89b4230be65cf086f7c1d41d2e2.zip
some more `const's
-rw-r--r--ldo.c7
-rw-r--r--ldo.h4
-rw-r--r--lfunc.c5
-rw-r--r--lfunc.h5
-rw-r--r--lvm.c6
-rw-r--r--lvm.h4
6 files changed, 17 insertions, 14 deletions
diff --git a/ldo.c b/ldo.c
index 788cfedb..2bbfdd5f 100644
--- a/ldo.c
+++ b/ldo.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ldo.c,v 1.48 1999/10/04 17:51:04 roberto Exp roberto $ 2** $Id: ldo.c,v 1.49 1999/10/14 17:53:35 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*/
@@ -101,7 +101,7 @@ void luaD_lineHook (int line) {
101} 101}
102 102
103 103
104void luaD_callHook (StkId base, TProtoFunc *tf, int isreturn) { 104void luaD_callHook (StkId base, const TProtoFunc *tf, int isreturn) {
105 struct C_Lua_Stack oldCLS = L->Cstack; 105 struct C_Lua_Stack oldCLS = L->Cstack;
106 StkId old_top = L->Cstack.lua2C = L->Cstack.base = L->stack.top-L->stack.stack; 106 StkId old_top = L->Cstack.lua2C = L->Cstack.base = L->stack.top-L->stack.stack;
107 L->Cstack.num = 0; 107 L->Cstack.num = 0;
@@ -143,7 +143,8 @@ static StkId callC (lua_CFunction f, StkId base) {
143} 143}
144 144
145 145
146static StkId callCclosure (struct Closure *cl, lua_CFunction f, StkId base) { 146static StkId callCclosure (const struct Closure *cl,
147 lua_CFunction f, StkId base) {
147 TObject *pbase; 148 TObject *pbase;
148 int nup = cl->nelems; /* number of upvalues */ 149 int nup = cl->nelems; /* number of upvalues */
149 luaD_checkstack(nup); 150 luaD_checkstack(nup);
diff --git a/ldo.h b/ldo.h
index 5deb5005..f3f19cd8 100644
--- a/ldo.h
+++ b/ldo.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ldo.h,v 1.7 1999/08/16 20:52:00 roberto Exp roberto $ 2** $Id: ldo.h,v 1.8 1999/10/04 17:51:04 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*/
@@ -34,7 +34,7 @@ void luaD_init (void);
34void luaD_adjusttop (StkId newtop); 34void luaD_adjusttop (StkId newtop);
35void luaD_openstack (int nelems); 35void luaD_openstack (int nelems);
36void luaD_lineHook (int line); 36void luaD_lineHook (int line);
37void luaD_callHook (StkId base, TProtoFunc *tf, int isreturn); 37void luaD_callHook (StkId base, const TProtoFunc *tf, int isreturn);
38void luaD_calln (int nArgs, int nResults); 38void luaD_calln (int nArgs, int nResults);
39void luaD_callTM (const TObject *f, int nParams, int nResults); 39void luaD_callTM (const TObject *f, int nParams, int nResults);
40int luaD_protectedrun (void); 40int luaD_protectedrun (void);
diff --git a/lfunc.c b/lfunc.c
index ea8a9a42..fc97c0a3 100644
--- a/lfunc.c
+++ b/lfunc.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lfunc.c,v 1.11 1999/08/16 20:52:00 roberto Exp roberto $ 2** $Id: lfunc.c,v 1.12 1999/10/04 17:51:04 roberto Exp roberto $
3** Auxiliary functions to manipulate prototypes and closures 3** Auxiliary functions to manipulate prototypes and closures
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -62,7 +62,8 @@ void luaF_freeclosure (Closure *c) {
62** Look for n-th local variable at line "line" in function "func". 62** Look for n-th local variable at line "line" in function "func".
63** Returns NULL if not found. 63** Returns NULL if not found.
64*/ 64*/
65const char *luaF_getlocalname (TProtoFunc *func, int local_number, int line) { 65const char *luaF_getlocalname (const TProtoFunc *func,
66 int local_number, int line) {
66 int count = 0; 67 int count = 0;
67 const char *varname = NULL; 68 const char *varname = NULL;
68 LocVar *lv = func->locvars; 69 LocVar *lv = func->locvars;
diff --git a/lfunc.h b/lfunc.h
index f4109dc1..5681db43 100644
--- a/lfunc.h
+++ b/lfunc.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lfunc.h,v 1.6 1999/08/16 20:52:00 roberto Exp roberto $ 2** $Id: lfunc.h,v 1.7 1999/10/04 17:51:04 roberto Exp roberto $
3** Lua Function structures 3** Lua Function structures
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -17,7 +17,8 @@ Closure *luaF_newclosure (int nelems);
17void luaF_freeproto (TProtoFunc *f); 17void luaF_freeproto (TProtoFunc *f);
18void luaF_freeclosure (Closure *c); 18void luaF_freeclosure (Closure *c);
19 19
20const char *luaF_getlocalname (TProtoFunc *func, int local_number, int line); 20const char *luaF_getlocalname (const TProtoFunc *func,
21 int local_number, int line);
21 22
22 23
23#endif 24#endif
diff --git a/lvm.c b/lvm.c
index 69044464..a2bb09e4 100644
--- a/lvm.c
+++ b/lvm.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lvm.c,v 1.62 1999/09/17 16:53:54 roberto Exp roberto $ 2** $Id: lvm.c,v 1.63 1999/10/14 19:13:31 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*/
@@ -35,7 +35,7 @@
35 35
36 36
37 37
38static TaggedString *strconc (TaggedString *l, TaggedString *r) { 38static TaggedString *strconc (const TaggedString *l, const TaggedString *r) {
39 long nl = l->u.s.len; 39 long nl = l->u.s.len;
40 long nr = r->u.s.len; 40 long nr = r->u.s.len;
41 char *buffer = luaL_openspace(nl+nr); 41 char *buffer = luaL_openspace(nl+nr);
@@ -296,7 +296,7 @@ static void adjust_varargs (StkId first_extra_arg) {
296** [stack+base,top). Returns n such that the the results are between 296** [stack+base,top). Returns n such that the the results are between
297** [stack+n,top). 297** [stack+n,top).
298*/ 298*/
299StkId luaV_execute (Closure *cl, TProtoFunc *tf, StkId base) { 299StkId luaV_execute (const Closure *cl, const TProtoFunc *tf, StkId base) {
300 struct Stack *S = &L->stack; /* to optimize */ 300 struct Stack *S = &L->stack; /* to optimize */
301 register const Byte *pc = tf->code; 301 register const Byte *pc = tf->code;
302 const TObject *consts = tf->consts; 302 const TObject *consts = tf->consts;
diff --git a/lvm.h b/lvm.h
index a0a3fc51..bef28ba8 100644
--- a/lvm.h
+++ b/lvm.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lvm.h,v 1.8 1999/02/08 17:07:59 roberto Exp roberto $ 2** $Id: lvm.h,v 1.9 1999/08/16 20:52:00 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*/
@@ -26,7 +26,7 @@ void luaV_settable (const TObject *t);
26void luaV_rawsettable (const TObject *t); 26void luaV_rawsettable (const TObject *t);
27void luaV_getglobal (TaggedString *ts); 27void luaV_getglobal (TaggedString *ts);
28void luaV_setglobal (TaggedString *ts); 28void luaV_setglobal (TaggedString *ts);
29StkId luaV_execute (Closure *cl, TProtoFunc *tf, StkId base); 29StkId luaV_execute (const Closure *cl, const TProtoFunc *tf, StkId base);
30void luaV_closure (int nelems); 30void luaV_closure (int nelems);
31void luaV_comparison (lua_Type ttype_less, lua_Type ttype_equal, 31void luaV_comparison (lua_Type ttype_less, lua_Type ttype_equal,
32 lua_Type ttype_great, IMS op); 32 lua_Type ttype_great, IMS op);