MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / setrandfunc

Function setrandfunc

third-party/lua-5.5.0/src/lmathlib.c:657–662  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

655** Register the random functions and initialize their state.
656*/
657static void setrandfunc (lua_State *L) {
658 RanState *state = (RanState *)lua_newuserdatauv(L, sizeof(RanState), 0);
659 setseed(L, state->s, luaL_makeseed(L), 0); /* initialize with random seed */
660 lua_pop(L, 2); /* remove pushed seeds */
661 luaL_setfuncs(L, randfuncs, 1);
662}
663
664/* }================================================================== */
665

Callers 1

luaopen_mathFunction · 0.70

Calls 4

luaL_makeseedFunction · 0.85
lua_newuserdatauvFunction · 0.70
setseedFunction · 0.70
luaL_setfuncsFunction · 0.70

Tested by

no test coverage detected