remove patch that causes math.randomseed() to not function
reported/debugged by M Joonas Pihlaja in pr 6176
This commit is contained in:
parent
f3ecf22e5b
commit
a6aaf1d4f3
@ -1,8 +1,9 @@
|
|||||||
# $OpenBSD: Makefile,v 1.35 2008/11/07 12:23:12 jsg Exp $
|
# $OpenBSD: Makefile,v 1.36 2009/06/24 14:19:06 jolan Exp $
|
||||||
|
|
||||||
COMMENT= powerful, light-weight programming language
|
COMMENT= powerful, light-weight programming language
|
||||||
|
|
||||||
DISTNAME= lua-5.1.4
|
DISTNAME= lua-5.1.4
|
||||||
|
PKGNAME= lua-5.1.4p0
|
||||||
CATEGORIES= lang
|
CATEGORIES= lang
|
||||||
|
|
||||||
MASTER_SITES= http://www.lua.org/ftp/ \
|
MASTER_SITES= http://www.lua.org/ftp/ \
|
||||||
|
@ -1,21 +0,0 @@
|
|||||||
$OpenBSD: patch-src_lmathlib_c,v 1.1 2007/03/15 22:03:37 pedro Exp $
|
|
||||||
--- src/lmathlib.c.orig Sun Mar 4 11:10:17 2007
|
|
||||||
+++ src/lmathlib.c Sun Mar 4 11:11:40 2007
|
|
||||||
@@ -181,7 +181,7 @@ static int math_max (lua_State *L) {
|
|
||||||
static int math_random (lua_State *L) {
|
|
||||||
/* the `%' avoids the (rare) case of r==1, and is needed also because on
|
|
||||||
some systems (SunOS!) `rand()' may return a value larger than RAND_MAX */
|
|
||||||
- lua_Number r = (lua_Number)(rand()%RAND_MAX) / (lua_Number)RAND_MAX;
|
|
||||||
+ lua_Number r = (lua_Number)(arc4random()%RAND_MAX) / (lua_Number)RAND_MAX;
|
|
||||||
switch (lua_gettop(L)) { /* check number of arguments */
|
|
||||||
case 0: { /* no arguments */
|
|
||||||
lua_pushnumber(L, r); /* Number between 0 and 1 */
|
|
||||||
@@ -207,7 +207,7 @@ static int math_random (lua_State *L) {
|
|
||||||
|
|
||||||
|
|
||||||
static int math_randomseed (lua_State *L) {
|
|
||||||
- srand(luaL_checkint(L, 1));
|
|
||||||
+ arc4random_stir();
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user