lua

A copy of the Lua development repository
Log | Files | Refs | README

commit 8a1a512c6484b93e8a4ad81f0bffe818a585c1ee
parent 6b0c38c2e7da04c6bb1eb670cf45cf430881c9f9
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date:   Tue,  5 Mar 2002 09:42:25 -0300

lu_byte is enough for those fields (maxstack < 256)

Diffstat:
Mlcode.c | 4++--
Mlfunc.c | 6+++---
Mlobject.h | 12++++++------
3 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/lcode.c b/lcode.c @@ -1,5 +1,5 @@ /* -** $Id: lcode.c,v 1.1 2001/11/29 22:14:34 rieru Exp rieru $ +** $Id: lcode.c,v 1.89 2002/02/05 22:39:12 roberto Exp roberto $ ** Code generator for Lua ** See Copyright Notice in lua.h */ @@ -176,7 +176,7 @@ void luaK_reserveregs (FuncState *fs, int n) { if (fs->freereg > fs->f->maxstacksize) { if (fs->freereg >= MAXSTACK) luaK_error(fs->ls, "function or expression too complex"); - fs->f->maxstacksize = cast(short, fs->freereg); + fs->f->maxstacksize = cast(lu_byte, fs->freereg); } } diff --git a/lfunc.c b/lfunc.c @@ -1,5 +1,5 @@ /* -** $Id: lfunc.c,v 1.1 2001/11/29 22:14:34 rieru Exp rieru $ +** $Id: lfunc.c,v 1.53 2001/12/21 17:31:35 roberto Exp roberto $ ** Auxiliary functions to manipulate prototypes and closures ** See Copyright Notice in lua.h */ @@ -29,7 +29,7 @@ Closure *luaF_newCclosure (lua_State *L, int nelems) { c->c.next = G(L)->rootcl; G(L)->rootcl = c; c->c.marked = 0; - c->c.nupvalues = cast(short, nelems); + c->c.nupvalues = cast(lu_byte, nelems); return c; } @@ -40,7 +40,7 @@ Closure *luaF_newLclosure (lua_State *L, int nelems) { c->c.next = G(L)->rootcl; G(L)->rootcl = c; c->l.marked = 0; - c->l.nupvalues = cast(short, nelems); + c->l.nupvalues = cast(lu_byte, nelems); return c; } diff --git a/lobject.h b/lobject.h @@ -1,5 +1,5 @@ /* -** $Id: lobject.h,v 1.1 2001/11/29 22:14:34 rieru Exp rieru $ +** $Id: lobject.h,v 1.124 2002/02/08 22:42:41 roberto Exp roberto $ ** Type definitions for Lua objects ** See Copyright Notice in lua.h */ @@ -147,11 +147,11 @@ typedef struct Proto { int sizelineinfo; /* size of `lineinfo' */ int sizelocvars; int lineDefined; - short nupvalues; - short numparams; - short is_vararg; - short maxstacksize; - short marked; + lu_byte nupvalues; + lu_byte numparams; + lu_byte is_vararg; + lu_byte maxstacksize; + lu_byte marked; } Proto;