From 01b00cc29261579600ce414b470c339510ac49d5 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Thu, 30 Nov 2000 16:50:47 -0200 Subject: better control over extensions of char/short to int --- lparser.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lparser.c') diff --git a/lparser.c b/lparser.c index b635a418..b07557b9 100644 --- a/lparser.c +++ b/lparser.c @@ -1,5 +1,5 @@ /* -** $Id: lparser.c,v 1.116 2000/10/27 11:39:52 roberto Exp roberto $ +** $Id: lparser.c,v 1.117 2000/11/29 11:57:42 roberto Exp roberto $ ** LL(1) Parser and code generator for Lua ** See Copyright Notice in lua.h */ @@ -690,8 +690,8 @@ static BinOpr getbinopr (int op) { static const struct { - char left; /* left priority for each binary operator */ - char right; /* right priority */ + unsigned char left; /* left priority for each binary operator */ + unsigned char right; /* right priority */ } priority[] = { /* ORDER OPR */ {5, 5}, {5, 5}, {6, 6}, {6, 6}, /* arithmetic */ {9, 8}, {4, 3}, /* power and concat (right associative) */ @@ -718,13 +718,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 && priority[op].left > limit) { + while (op != OPR_NOBINOPR && (int)priority[op].left > limit) { expdesc v2; BinOpr nextop; next(ls); luaK_infix(ls, op, v); /* read sub-expression with higher priority */ - nextop = subexpr(ls, &v2, priority[op].right); + nextop = subexpr(ls, &v2, (int)priority[op].right); luaK_posfix(ls, op, v, &v2); op = nextop; } -- cgit v1.2.3-55-g6feb