| 81 | |
| 82 | |
| 83 | static lua_Integer intarith (lua_State *L, int op, lua_Integer v1, |
| 84 | lua_Integer v2) { |
| 85 | switch (op) { |
| 86 | case LUA_OPADD: return intop(+, v1, v2); |
| 87 | case LUA_OPSUB:return intop(-, v1, v2); |
| 88 | case LUA_OPMUL:return intop(*, v1, v2); |
| 89 | case LUA_OPMOD: return luaV_mod(L, v1, v2); |
| 90 | case LUA_OPIDIV: return luaV_div(L, v1, v2); |
| 91 | case LUA_OPBAND: return intop(&, v1, v2); |
| 92 | case LUA_OPBOR: return intop(|, v1, v2); |
| 93 | case LUA_OPBXOR: return intop(^, v1, v2); |
| 94 | case LUA_OPSHL: return luaV_shiftl(v1, v2); |
| 95 | case LUA_OPSHR: return luaV_shiftl(v1, -v2); |
| 96 | case LUA_OPUNM: return intop(-, 0, v1); |
| 97 | case LUA_OPBNOT: return intop(^, ~l_castS2U(0), v1); |
| 98 | default: lua_assert(0); return 0; |
| 99 | } |
| 100 | } |
| 101 | |
| 102 | |
| 103 | static lua_Number numarith (lua_State *L, int op, lua_Number v1, |
no test coverage detected