** 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). */
| 609 | ** randomization). |
| 610 | */ |
| 611 | static void randseed (lua_State *L, RanState *state) { |
| 612 | lua_Unsigned seed1 = (lua_Unsigned)time(NULL); |
| 613 | lua_Unsigned seed2 = (lua_Unsigned)(size_t)L; |
| 614 | setseed(L, state->s, seed1, seed2); |
| 615 | } |
| 616 | |
| 617 | |
| 618 | static int math_randomseed (lua_State *L) { |
no test coverage detected