| 126 | |
| 127 | |
| 128 | static 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 | |
| 139 | static int b_lrot (lua_State *L) { |
no test coverage detected