** Set a "random" seed. To get some randomness, use the current time ** and the address of 'L' (in case the machine does address space layout ** randomization). */
| 626 | ** randomization). |
| 627 | */ |
| 628 | static void randseed (lua_State *L, RanState *state) { |
| 629 | lua_Unsigned seed1 = (lua_Unsigned)time(NULL); |
| 630 | lua_Unsigned seed2 = (lua_Unsigned)(size_t)L; |
| 631 | setseed(L, state->s, seed1, seed2); |
| 632 | } |
| 633 | |
| 634 | |
| 635 | static int math_randomseed (lua_State *L) { |
no test coverage detected