| 188 | |
| 189 | |
| 190 | static int b_replace (lua_State *L) { |
| 191 | int w; |
| 192 | lua_Unsigned r = trim(checkunsigned(L, 1)); |
| 193 | lua_Unsigned v = trim(checkunsigned(L, 2)); |
| 194 | int f = fieldargs(L, 3, &w); |
| 195 | lua_Unsigned m = mask(w); |
| 196 | r = (r & ~(m << f)) | ((v & m) << f); |
| 197 | pushunsigned(L, r); |
| 198 | return 1; |
| 199 | } |
| 200 | |
| 201 | |
| 202 | static const luaL_Reg bitlib[] = { |
nothing calls this directly
no test coverage detected