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

Function math_randomseed

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

Source from the content-addressed store, hash-verified

616
617
618static int math_randomseed (lua_State *L) {
619 RanState *state = (RanState *)lua_touserdata(L, lua_upvalueindex(1));
620 if (lua_isnone(L, 1)) {
621 randseed(L, state);
622 }
623 else {
624 lua_Integer n1 = luaL_checkinteger(L, 1);
625 lua_Integer n2 = luaL_optinteger(L, 2, 0);
626 setseed(L, state->s, n1, n2);
627 }
628 return 2; /* return seeds */
629}
630
631
632static const luaL_Reg randfuncs[] = {

Callers

nothing calls this directly

Calls 5

lua_touserdataFunction · 0.85
randseedFunction · 0.85
luaL_checkintegerFunction · 0.85
luaL_optintegerFunction · 0.85
setseedFunction · 0.85

Tested by

no test coverage detected