aboutsummaryrefslogtreecommitdiff
path: root/lobject.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2018-11-05 16:10:42 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2018-11-05 16:10:42 -0200
commit5e76a4fd313a8690d300085c4e8fcb9dca50c01a (patch)
tree3f4c0be6c09659d01eb14aadec1652d6428e29fa /lobject.c
parente8c779736f3029df353038352c14c8ab63728811 (diff)
downloadlua-5e76a4fd313a8690d300085c4e8fcb9dca50c01a.tar.gz
lua-5e76a4fd313a8690d300085c4e8fcb9dca50c01a.tar.bz2
lua-5e76a4fd313a8690d300085c4e8fcb9dca50c01a.zip
New macros for arithmetic/bitwise operations in 'luaV_execute'
The repetitive code of the arithmetic and bitwise operators in the main iterpreter loop was moved to appropriate macros. (As a detail, the function 'luaV_div' was renamed 'luaV_idiv', as it does an "integer division" (floor division).
Diffstat (limited to 'lobject.c')
-rw-r--r--lobject.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lobject.c b/lobject.c
index d011c85f..3ce052c2 100644
--- a/lobject.c
+++ b/lobject.c
@@ -83,7 +83,7 @@ static lua_Integer intarith (lua_State *L, int op, lua_Integer v1,
83 case LUA_OPSUB:return intop(-, v1, v2); 83 case LUA_OPSUB:return intop(-, v1, v2);
84 case LUA_OPMUL:return intop(*, v1, v2); 84 case LUA_OPMUL:return intop(*, v1, v2);
85 case LUA_OPMOD: return luaV_mod(L, v1, v2); 85 case LUA_OPMOD: return luaV_mod(L, v1, v2);
86 case LUA_OPIDIV: return luaV_div(L, v1, v2); 86 case LUA_OPIDIV: return luaV_idiv(L, v1, v2);
87 case LUA_OPBAND: return intop(&, v1, v2); 87 case LUA_OPBAND: return intop(&, v1, v2);
88 case LUA_OPBOR: return intop(|, v1, v2); 88 case LUA_OPBOR: return intop(|, v1, v2);
89 case LUA_OPBXOR: return intop(^, v1, v2); 89 case LUA_OPBXOR: return intop(^, v1, v2);