MCPcopy Create free account
hub / github.com/BigPig0/RelayLive / intarith

Function intarith

ThirdParty/lua/lua/lobject.c:76–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74
75
76static lua_Integer intarith (lua_State *L, int op, lua_Integer v1,
77 lua_Integer v2) {
78 switch (op) {
79 case LUA_OPADD: return intop(+, v1, v2);
80 case LUA_OPSUB:return intop(-, v1, v2);
81 case LUA_OPMUL:return intop(*, v1, v2);
82 case LUA_OPMOD: return luaV_mod(L, v1, v2);
83 case LUA_OPIDIV: return luaV_div(L, v1, v2);
84 case LUA_OPBAND: return intop(&, v1, v2);
85 case LUA_OPBOR: return intop(|, v1, v2);
86 case LUA_OPBXOR: return intop(^, v1, v2);
87 case LUA_OPSHL: return luaV_shiftl(v1, v2);
88 case LUA_OPSHR: return luaV_shiftl(v1, -v2);
89 case LUA_OPUNM: return intop(-, 0, v1);
90 case LUA_OPBNOT: return intop(^, ~l_castS2U(0), v1);
91 default: lua_assert(0); return 0;
92 }
93}
94
95
96static lua_Number numarith (lua_State *L, int op, lua_Number v1,

Callers 1

luaO_arithFunction · 0.85

Calls 3

luaV_modFunction · 0.85
luaV_divFunction · 0.85
luaV_shiftlFunction · 0.85

Tested by

no test coverage detected