MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / b_shift

Function b_shift

third-party/lua-5.2.4/src/lbitlib.c:86–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

84
85
86static int b_shift (lua_State *L, b_uint r, int i) {
87 if (i < 0) { /* shift right? */
88 i = -i;
89 r = trim(r);
90 if (i >= LUA_NBITS) r = 0;
91 else r >>= i;
92 }
93 else { /* shift left */
94 if (i >= LUA_NBITS) r = 0;
95 else r <<= i;
96 r = trim(r);
97 }
98 lua_pushunsigned(L, r);
99 return 1;
100}
101
102
103static int b_lshift (lua_State *L) {

Callers 3

b_lshiftFunction · 0.70
b_rshiftFunction · 0.70
b_arshiftFunction · 0.70

Calls 1

lua_pushunsignedFunction · 0.85

Tested by

no test coverage detected