diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2010-10-25 18:31:11 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2010-10-25 18:31:11 -0200 |
commit | c6b64ffe65549b179bfa565e8329430857e335ee (patch) | |
tree | 9fa644de3c5dc2e4edf42aac7249b42264f2f6e5 /lmathlib.c | |
parent | 4590a89b32b62c75fca7ced96c282c7793b8885c (diff) | |
download | lua-c6b64ffe65549b179bfa565e8329430857e335ee.tar.gz lua-c6b64ffe65549b179bfa565e8329430857e335ee.tar.bz2 lua-c6b64ffe65549b179bfa565e8329430857e335ee.zip |
new type lua_Unsigned and corresponding projection/injection functions
Diffstat (limited to 'lmathlib.c')
-rw-r--r-- | lmathlib.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lmathlib.c,v 1.74 2009/11/24 12:05:44 roberto Exp roberto $ | 2 | ** $Id: lmathlib.c,v 1.75 2010/07/02 11:38:13 roberto Exp roberto $ |
3 | ** Standard mathematical library | 3 | ** Standard mathematical library |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -220,7 +220,7 @@ static int math_random (lua_State *L) { | |||
220 | 220 | ||
221 | 221 | ||
222 | static int math_randomseed (lua_State *L) { | 222 | static int math_randomseed (lua_State *L) { |
223 | srand(luaL_checkint(L, 1)); | 223 | srand(luaL_checkunsigned(L, 1)); |
224 | (void)rand(); /* discard first value to avoid undesirable correlations */ | 224 | (void)rand(); /* discard first value to avoid undesirable correlations */ |
225 | return 0; | 225 | return 0; |
226 | } | 226 | } |