aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2014-02-06 17:55:55 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2014-02-06 17:55:55 -0200
commit19ad78d713081e422bd6e70c05837ba9034a49a4 (patch)
treea7b27b2bdb929e6fb56ddc0f006d5fcc6c8f7ce2
parent6ccf1500396efffeb38ed54ac78d2f2d41a9b762 (diff)
downloadlua-19ad78d713081e422bd6e70c05837ba9034a49a4.tar.gz
lua-19ad78d713081e422bd6e70c05837ba9034a49a4.tar.bz2
lua-19ad78d713081e422bd6e70c05837ba9034a49a4.zip
C++ needs casts for arithmetic with enums
-rw-r--r--lcode.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lcode.c b/lcode.c
index f582b7dc..235a0a91 100644
--- a/lcode.c
+++ b/lcode.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lcode.c,v 2.77 2013/12/30 20:47:58 roberto Exp roberto $ 2** $Id: lcode.c,v 2.78 2014/01/27 13:34:32 roberto Exp $
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*/
@@ -836,7 +836,7 @@ void luaK_prefix (FuncState *fs, UnOpr op, expdesc *e, int line) {
836 e2.t = e2.f = NO_JUMP; e2.k = VKINT; e2.u.ival = 0; 836 e2.t = e2.f = NO_JUMP; e2.k = VKINT; e2.u.ival = 0;
837 switch (op) { 837 switch (op) {
838 case OPR_MINUS: case OPR_BNOT: case OPR_LEN: { 838 case OPR_MINUS: case OPR_BNOT: case OPR_LEN: {
839 codearith(fs, op - OPR_MINUS + OP_UNM, e, &e2, line); 839 codearith(fs, cast(OpCode, (op - OPR_MINUS) + OP_UNM), e, &e2, line);
840 break; 840 break;
841 } 841 }
842 case OPR_NOT: codenot(fs, e); break; 842 case OPR_NOT: codenot(fs, e); break;
@@ -910,7 +910,7 @@ void luaK_posfix (FuncState *fs, BinOpr op,
910 case OPR_IDIV: case OPR_MOD: case OPR_POW: 910 case OPR_IDIV: case OPR_MOD: case OPR_POW:
911 case OPR_BAND: case OPR_BOR: case OPR_BXOR: 911 case OPR_BAND: case OPR_BOR: case OPR_BXOR:
912 case OPR_SHL: case OPR_SHR: { 912 case OPR_SHL: case OPR_SHR: {
913 codearith(fs, cast(OpCode, op - OPR_ADD + OP_ADD), e1, e2, line); 913 codearith(fs, cast(OpCode, (op - OPR_ADD) + OP_ADD), e1, e2, line);
914 break; 914 break;
915 } 915 }
916 case OPR_EQ: case OPR_LT: case OPR_LE: { 916 case OPR_EQ: case OPR_LT: case OPR_LE: {