From 19ad78d713081e422bd6e70c05837ba9034a49a4 Mon Sep 17 00:00:00 2001
From: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date: Thu, 6 Feb 2014 17:55:55 -0200
Subject: C++ needs casts for arithmetic with enums

---
 lcode.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

(limited to 'lcode.c')

diff --git a/lcode.c b/lcode.c
index f582b7dc..235a0a91 100644
--- a/lcode.c
+++ b/lcode.c
@@ -1,5 +1,5 @@
 /*
-** $Id: lcode.c,v 2.77 2013/12/30 20:47:58 roberto Exp roberto $
+** $Id: lcode.c,v 2.78 2014/01/27 13:34:32 roberto Exp $
 ** Code generator for Lua
 ** See Copyright Notice in lua.h
 */
@@ -836,7 +836,7 @@ void luaK_prefix (FuncState *fs, UnOpr op, expdesc *e, int line) {
   e2.t = e2.f = NO_JUMP; e2.k = VKINT; e2.u.ival = 0;
   switch (op) {
     case OPR_MINUS: case OPR_BNOT: case OPR_LEN: {
-      codearith(fs, op - OPR_MINUS + OP_UNM, e, &e2, line);
+      codearith(fs, cast(OpCode, (op - OPR_MINUS) + OP_UNM), e, &e2, line);
       break;
     }
     case OPR_NOT: codenot(fs, e); break;
@@ -910,7 +910,7 @@ void luaK_posfix (FuncState *fs, BinOpr op,
     case OPR_IDIV: case OPR_MOD: case OPR_POW:
     case OPR_BAND: case OPR_BOR: case OPR_BXOR:
     case OPR_SHL: case OPR_SHR: {
-      codearith(fs, cast(OpCode, op - OPR_ADD + OP_ADD), e1, e2, line);
+      codearith(fs, cast(OpCode, (op - OPR_ADD) + OP_ADD), e1, e2, line);
       break;
     }
     case OPR_EQ: case OPR_LT: case OPR_LE: {
-- 
cgit v1.2.3-55-g6feb