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

Function b_arshift

third-party/lua-5.3.5/src/lbitlib.c:126–138  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

124
125
126static int b_arshift (lua_State *L) {
127 lua_Unsigned r = checkunsigned(L, 1);
128 lua_Integer i = luaL_checkinteger(L, 2);
129 if (i < 0 || !(r & ((lua_Unsigned)1 << (LUA_NBITS - 1))))
130 return b_shift(L, r, -i);
131 else { /* arithmetic shift for 'negative' number */
132 if (i >= LUA_NBITS) r = ALLONES;
133 else
134 r = trim((r >> i) | ~(trim(~(lua_Unsigned)0) >> i)); /* add signal bit */
135 pushunsigned(L, r);
136 return 1;
137 }
138}
139
140
141static int b_rot (lua_State *L, lua_Integer d) {

Callers

nothing calls this directly

Calls 2

luaL_checkintegerFunction · 0.70
b_shiftFunction · 0.70

Tested by

no test coverage detected