MCPcopy Create free account
hub / github.com/danomatika/ofxLua / b_replace

Function b_replace

libs/lua/lbitlib.c:190–199  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

188
189
190static 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
202static const luaL_Reg bitlib[] = {

Callers

nothing calls this directly

Calls 1

fieldargsFunction · 0.85

Tested by

no test coverage detected