aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2002-03-05 09:42:47 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2002-03-05 09:42:47 -0300
commit8a1a512c6484b93e8a4ad81f0bffe818a585c1ee (patch)
treefc3caaf321a560818ad1d15ea6fec8b00e708990
parent6b0c38c2e7da04c6bb1eb670cf45cf430881c9f9 (diff)
downloadlua-8a1a512c6484b93e8a4ad81f0bffe818a585c1ee.tar.gz
lua-8a1a512c6484b93e8a4ad81f0bffe818a585c1ee.tar.bz2
lua-8a1a512c6484b93e8a4ad81f0bffe818a585c1ee.zip
lu_byte is enough for those fields (maxstack < 256)
-rw-r--r--lcode.c4
-rw-r--r--lfunc.c6
-rw-r--r--lobject.h12
3 files changed, 11 insertions, 11 deletions
diff --git a/lcode.c b/lcode.c
index c50596fb..ffd77f2e 100644
--- a/lcode.c
+++ b/lcode.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lcode.c,v 1.1 2001/11/29 22:14:34 rieru Exp rieru $ 2** $Id: lcode.c,v 1.89 2002/02/05 22:39:12 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*/
@@ -176,7 +176,7 @@ void luaK_reserveregs (FuncState *fs, int n) {
176 if (fs->freereg > fs->f->maxstacksize) { 176 if (fs->freereg > fs->f->maxstacksize) {
177 if (fs->freereg >= MAXSTACK) 177 if (fs->freereg >= MAXSTACK)
178 luaK_error(fs->ls, "function or expression too complex"); 178 luaK_error(fs->ls, "function or expression too complex");
179 fs->f->maxstacksize = cast(short, fs->freereg); 179 fs->f->maxstacksize = cast(lu_byte, fs->freereg);
180 } 180 }
181} 181}
182 182
diff --git a/lfunc.c b/lfunc.c
index 72d9c863..2b79b8de 100644
--- a/lfunc.c
+++ b/lfunc.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lfunc.c,v 1.1 2001/11/29 22:14:34 rieru Exp rieru $ 2** $Id: lfunc.c,v 1.53 2001/12/21 17:31:35 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*/
@@ -29,7 +29,7 @@ Closure *luaF_newCclosure (lua_State *L, int nelems) {
29 c->c.next = G(L)->rootcl; 29 c->c.next = G(L)->rootcl;
30 G(L)->rootcl = c; 30 G(L)->rootcl = c;
31 c->c.marked = 0; 31 c->c.marked = 0;
32 c->c.nupvalues = cast(short, nelems); 32 c->c.nupvalues = cast(lu_byte, nelems);
33 return c; 33 return c;
34} 34}
35 35
@@ -40,7 +40,7 @@ Closure *luaF_newLclosure (lua_State *L, int nelems) {
40 c->c.next = G(L)->rootcl; 40 c->c.next = G(L)->rootcl;
41 G(L)->rootcl = c; 41 G(L)->rootcl = c;
42 c->l.marked = 0; 42 c->l.marked = 0;
43 c->l.nupvalues = cast(short, nelems); 43 c->l.nupvalues = cast(lu_byte, nelems);
44 return c; 44 return c;
45} 45}
46 46
diff --git a/lobject.h b/lobject.h
index 5b2a1bf3..873fdc93 100644
--- a/lobject.h
+++ b/lobject.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lobject.h,v 1.1 2001/11/29 22:14:34 rieru Exp rieru $ 2** $Id: lobject.h,v 1.124 2002/02/08 22:42:41 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*/
@@ -147,11 +147,11 @@ typedef struct Proto {
147 int sizelineinfo; /* size of `lineinfo' */ 147 int sizelineinfo; /* size of `lineinfo' */
148 int sizelocvars; 148 int sizelocvars;
149 int lineDefined; 149 int lineDefined;
150 short nupvalues; 150 lu_byte nupvalues;
151 short numparams; 151 lu_byte numparams;
152 short is_vararg; 152 lu_byte is_vararg;
153 short maxstacksize; 153 lu_byte maxstacksize;
154 short marked; 154 lu_byte marked;
155} Proto; 155} Proto;
156 156
157 157