com php-src: Merge branch 'PHP-7.0': ext/standard/rand.c
| From: | Leigh | Date: | Thu, 18 Feb 2016 11:25:15 +0000 |
| Subject: | com php-src: Merge branch 'PHP-7.0': ext/standard/rand.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-91092@lists.php.net to get a copy of this message | ||
Commit: 50482d66e024c5f4beb8dbe04cc88d99f313a8f3
Author: Leigh <leigh@php.net> Thu, 18 Feb 2016 11:25:15 +0000
Parents: d051fbc1e5255d295c944c0fad097f3607e6127f a0724d30817600540946b41e40f4cfc2a0c30f80
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=50482d66e024c5f4beb8dbe04cc88d99f313a8f3
Log:
Merge branch 'PHP-7.0'
* PHP-7.0:
Revert "Fix #71152: mt_rand() returns the different values from original mt19937ar.c"
mt_rand() is seedable with mt_srand() which means it can be used to
(re)produce specific streams of numbers. All code (no matter how few instances that may be) that
previously depended on this behaviour will no longer produce the same results.
This kind of change needs to be discussed before being committed
Bugs:
https://bugs.php.net/71152
Changed paths:
MM ext/standard/rand.c
Diff:
diff --cc ext/standard/rand.c
index 13b3dcd,2dd05e7..50729f2
--- a/ext/standard/rand.c
+++ b/ext/standard/rand.c
@@@ -146,7 -146,7 +146,7 @@@ PHPAPI zend_long php_rand(void
#define loBits(u) ((u) & 0x7FFFFFFFU) /* mask the highest bit of u */
#define mixBits(u, v) (hiBit(u)|loBits(v)) /* move hi bit of u to hi bit of v */
- #define twist(m,u,v) (m ^ (mixBits(u,v)>>1) ^ ((uint32_t)(-(int32_t)(loBit(v))) &
0x9908b0dfU))
-#define twist(m,u,v) (m ^ (mixBits(u,v)>>1) ^ ((php_uint32)(-(php_int32)(loBit(u))) &
0x9908b0dfU))
++#define twist(m,u,v) (m ^ (mixBits(u,v)>>1) ^ ((uint32_t)(-(int32_t)(loBit(u))) &
0x9908b0dfU))
/* {{{ php_mt_initialize
*/