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

Function b_rot

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

Source from the content-addressed store, hash-verified

126
127
128static int b_rot (lua_State *L, int i) {
129 b_uint r = luaL_checkunsigned(L, 1);
130 i &= (LUA_NBITS - 1); /* i = i % NBITS */
131 r = trim(r);
132 if (i != 0) /* avoid undefined shift of LUA_NBITS when i == 0 */
133 r = (r << i) | (r >> (LUA_NBITS - i));
134 lua_pushunsigned(L, trim(r));
135 return 1;
136}
137
138
139static int b_lrot (lua_State *L) {

Callers 2

b_lrotFunction · 0.70
b_rrotFunction · 0.70

Calls 2

luaL_checkunsignedFunction · 0.85
lua_pushunsignedFunction · 0.85

Tested by

no test coverage detected