MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / setrandfunc

Function setrandfunc

extlibs/lua/src/lmathlib.c:641–646  ·  view source on GitHub ↗

** Register the random functions and initialize their state. */

Source from the content-addressed store, hash-verified

639** Register the random functions and initialize their state.
640*/
641static void setrandfunc (lua_State *L) {
642 RanState *state = (RanState *)lua_newuserdatauv(L, sizeof(RanState), 0);
643 randseed(L, state); /* initialize with a "random" seed */
644 lua_pop(L, 2); /* remove pushed seeds */
645 luaL_setfuncs(L, randfuncs, 1);
646}
647
648/* }================================================================== */
649

Callers 1

luaopen_mathFunction · 0.85

Calls 3

lua_newuserdatauvFunction · 0.85
randseedFunction · 0.85
luaL_setfuncsFunction · 0.70

Tested by

no test coverage detected