diff options
author | Mark A. Hershberger <mah@debian.(none)> | 2009-03-25 00:39:08 -0400 |
---|---|---|
committer | Mark A. Hershberger <mah@debian.(none)> | 2009-03-25 00:39:08 -0400 |
commit | 993e1866df547532a05ab6db76c9ff5aefc9a3df (patch) | |
tree | 169d3bde0974235d3cde164786ef6f381a4749a7 /ext/standard/php_rand.h | |
parent | 1f589a2bd44ba835ad1b009a5d83abd453724829 (diff) | |
download | php-993e1866df547532a05ab6db76c9ff5aefc9a3df.tar.gz |
Imported Upstream version 5.2.6upstream/5.2.6
Diffstat (limited to 'ext/standard/php_rand.h')
-rw-r--r-- | ext/standard/php_rand.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/standard/php_rand.h b/ext/standard/php_rand.h index b6bb2c348..7a12d2466 100644 --- a/ext/standard/php_rand.h +++ b/ext/standard/php_rand.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2007 The PHP Group | + | Copyright (c) 1997-2008 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -20,7 +20,7 @@ | Based on code from: Shawn Cokus <Cokus@math.washington.edu> | +----------------------------------------------------------------------+ */ -/* $Id: php_rand.h,v 1.28.2.1.2.1 2007/01/01 09:36:08 sebastian Exp $ */ +/* $Id: php_rand.h,v 1.28.2.1.2.4 2008/03/07 08:56:45 tony2001 Exp $ */ #ifndef PHP_RAND_H #define PHP_RAND_H @@ -47,9 +47,9 @@ #define PHP_MT_RAND_MAX ((long) (0x7FFFFFFF)) /* (1<<31) - 1 */ #ifdef PHP_WIN32 -#define GENERATE_SEED() ((long) (time(0) * GetCurrentProcessId() * 1000000 * php_combined_lcg(TSRMLS_C))) +#define GENERATE_SEED() (((long) (time(0) * GetCurrentProcessId())) ^ ((long) (1000000.0 * php_combined_lcg(TSRMLS_C)))) #else -#define GENERATE_SEED() ((long) (time(0) * getpid() * 1000000 * php_combined_lcg(TSRMLS_C))) +#define GENERATE_SEED() (((long) (time(0) * getpid())) ^ ((long) (1000000.0 * php_combined_lcg(TSRMLS_C)))) #endif PHPAPI void php_srand(long seed TSRMLS_DC); |