MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / setrandfunc

Function setrandfunc

3rd/lua-5.4.3/src/lmathlib.c:642–647  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

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

Callers 1

luaopen_mathFunction · 0.85

Calls 3

lua_newuserdatauvFunction · 0.85
randseedFunction · 0.85
luaL_setfuncsFunction · 0.85

Tested by

no test coverage detected