From e1d072571ec6f9d830e575a2ecdc95fd43428e53 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 31 Aug 2001 16:46:07 -0300 Subject: better syntax for type casts --- lparser.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lparser.c') diff --git a/lparser.c b/lparser.c index 58b3bcba..aa79a86a 100644 --- a/lparser.c +++ b/lparser.c @@ -1,5 +1,5 @@ /* -** $Id: lparser.c,v 1.153 2001/08/10 20:53:03 roberto Exp roberto $ +** $Id: lparser.c,v 1.154 2001/08/27 15:16:28 roberto Exp $ ** Lua Parser ** See Copyright Notice in lua.h */ @@ -266,7 +266,7 @@ static void code_params (LexState *ls, int nparams, short dots) { FuncState *fs = ls->fs; adjustlocalvars(ls, nparams); luaX_checklimit(ls, fs->nactloc, MAXPARAMS, l_s("parameters")); - fs->f->numparams = (short)fs->nactloc; /* `self' could be there already */ + fs->f->numparams = cast(short, fs->nactloc); /* `self' could be there already */ fs->f->is_vararg = dots; if (dots) { new_localvarstr(ls, l_s("arg"), 0); @@ -758,13 +758,13 @@ static BinOpr subexpr (LexState *ls, expdesc *v, int limit) { else simpleexp(ls, v); /* expand while operators have priorities higher than `limit' */ op = getbinopr(ls->t.token); - while (op != OPR_NOBINOPR && (int)priority[op].left > limit) { + while (op != OPR_NOBINOPR && cast(int, priority[op].left) > limit) { expdesc v2; BinOpr nextop; next(ls); luaK_infix(ls->fs, op, v); /* read sub-expression with higher priority */ - nextop = subexpr(ls, &v2, (int)priority[op].right); + nextop = subexpr(ls, &v2, cast(int, priority[op].right)); luaK_posfix(ls->fs, op, v, &v2); op = nextop; } -- cgit v1.2.3-55-g6feb