summaryrefslogtreecommitdiff
path: root/execute_rnd.c
diff options
context:
space:
mode:
authorBen Fuhrmannek2016-10-12 14:57:47 +0200
committerBen Fuhrmannek2016-10-12 14:57:47 +0200
commit1a3fd5eeb9a5859aefedb9302adb6ecd6a1873a7 (patch)
treea8925768de344632ec89e051a3c71a3c7c61ffd3 /execute_rnd.c
parent2e4fbdbdd8ff3b1d1a0edb579392506ef3ed98e2 (diff)
comments and whitespace cleanup
Diffstat (limited to 'execute_rnd.c')
-rw-r--r--execute_rnd.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/execute_rnd.c b/execute_rnd.c
index e2f6016..10d7d5a 100644
--- a/execute_rnd.c
+++ b/execute_rnd.c
@@ -44,7 +44,7 @@
44 44
45 Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura, 45 Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,
46 Copyright (C) 2000 - 2003, Richard J. Wagner 46 Copyright (C) 2000 - 2003, Richard J. Wagner
47 All rights reserved. 47 All rights reserved.
48 48
49 Redistribution and use in source and binary forms, with or without 49 Redistribution and use in source and binary forms, with or without
50 modification, are permitted provided that the following conditions 50 modification, are permitted provided that the following conditions
@@ -57,8 +57,8 @@
57 notice, this list of conditions and the following disclaimer in the 57 notice, this list of conditions and the following disclaimer in the
58 documentation and/or other materials provided with the distribution. 58 documentation and/or other materials provided with the distribution.
59 59
60 3. The names of its contributors may not be used to endorse or promote 60 3. The names of its contributors may not be used to endorse or promote
61 products derived from this software without specific prior written 61 products derived from this software without specific prior written
62 permission. 62 permission.
63 63
64 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 64 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
@@ -187,14 +187,14 @@ static php_uint32 suhosin_mt_rand()
187{ 187{
188 /* Pull a 32-bit integer from the generator state 188 /* Pull a 32-bit integer from the generator state
189 Every other access function simply transforms the numbers extracted here */ 189 Every other access function simply transforms the numbers extracted here */
190 190
191 register php_uint32 s1; 191 register php_uint32 s1;
192 192
193 if (SUHOSIN7_G(mt_left) == 0) { 193 if (SUHOSIN7_G(mt_left) == 0) {
194 suhosin_mt_reload(SUHOSIN7_G(mt_state), &SUHOSIN7_G(mt_next), &SUHOSIN7_G(mt_left)); 194 suhosin_mt_reload(SUHOSIN7_G(mt_state), &SUHOSIN7_G(mt_next), &SUHOSIN7_G(mt_left));
195 } 195 }
196 --SUHOSIN7_G(mt_left); 196 --SUHOSIN7_G(mt_left);
197 197
198 s1 = *SUHOSIN7_G(mt_next)++; 198 s1 = *SUHOSIN7_G(mt_next)++;
199 s1 ^= (s1 >> 11); 199 s1 ^= (s1 >> 11);
200 s1 ^= (s1 << 7) & 0x9d2c5680U; 200 s1 ^= (s1 << 7) & 0x9d2c5680U;
@@ -263,7 +263,7 @@ static void SUHOSIN7_Gen_entropy(php_uint32 *entropybuf)
263 */ 263 */
264static void suhosin_srand_auto() 264static void suhosin_srand_auto()
265{ 265{
266 php_uint32 seed[8]; 266 php_uint32 seed[8];
267 SUHOSIN7_Gen_entropy(&seed[0]); 267 SUHOSIN7_Gen_entropy(&seed[0]);
268 268
269 suhosin_mt_init_by_array(seed, 8, SUHOSIN7_G(r_state)); 269 suhosin_mt_init_by_array(seed, 8, SUHOSIN7_G(r_state));
@@ -278,7 +278,7 @@ static void suhosin_srand_auto()
278 */ 278 */
279static void suhosin_mt_srand_auto() 279static void suhosin_mt_srand_auto()
280{ 280{
281 php_uint32 seed[8]; 281 php_uint32 seed[8];
282 SUHOSIN7_Gen_entropy(&seed[0]); 282 SUHOSIN7_Gen_entropy(&seed[0]);
283 283
284 suhosin_mt_init_by_array(seed, 8, SUHOSIN7_G(mt_state)); 284 suhosin_mt_init_by_array(seed, 8, SUHOSIN7_G(mt_state));
@@ -309,14 +309,14 @@ static php_uint32 suhosin_rand()
309{ 309{
310 /* Pull a 32-bit integer from the generator state 310 /* Pull a 32-bit integer from the generator state
311 Every other access function simply transforms the numbers extracted here */ 311 Every other access function simply transforms the numbers extracted here */
312 312
313 register php_uint32 s1; 313 register php_uint32 s1;
314 314
315 if (SUHOSIN7_G(r_left) == 0) { 315 if (SUHOSIN7_G(r_left) == 0) {
316 suhosin_mt_reload(SUHOSIN7_G(r_state), &SUHOSIN7_G(r_next), &SUHOSIN7_G(r_left)); 316 suhosin_mt_reload(SUHOSIN7_G(r_state), &SUHOSIN7_G(r_next), &SUHOSIN7_G(r_left));
317 } 317 }
318 --SUHOSIN7_G(r_left); 318 --SUHOSIN7_G(r_left);
319 319
320 s1 = *SUHOSIN7_G(r_next)++; 320 s1 = *SUHOSIN7_G(r_next)++;
321 s1 ^= (s1 >> 11); 321 s1 ^= (s1 >> 11);
322 s1 ^= (s1 << 7) & 0x9d2c5680U; 322 s1 ^= (s1 << 7) & 0x9d2c5680U;
@@ -334,7 +334,7 @@ S7_IH_FUNCTION(srand)
334 SUHOSIN7_G(r_is_seeded) = 0; 334 SUHOSIN7_G(r_is_seeded) = 0;
335 return 1; 335 return 1;
336 } 336 }
337 337
338 if (zend_parse_parameters(argc, "|l", &seed) == FAILURE) { 338 if (zend_parse_parameters(argc, "|l", &seed) == FAILURE) {
339 return 1; 339 return 1;
340 } 340 }
@@ -356,7 +356,7 @@ S7_IH_FUNCTION(mt_srand)
356 SUHOSIN7_G(mt_is_seeded) = 0; 356 SUHOSIN7_G(mt_is_seeded) = 0;
357 return 1; 357 return 1;
358 } 358 }
359 359
360 if (zend_parse_parameters(argc, "|l", &seed) == FAILURE) { 360 if (zend_parse_parameters(argc, "|l", &seed) == FAILURE) {
361 return 1; 361 return 1;
362 } 362 }
@@ -377,7 +377,7 @@ S7_IH_FUNCTION(mt_rand)
377 long number; 377 long number;
378 378
379 if (argc != 0 && zend_parse_parameters(argc, "ll", &min, &max) == FAILURE) { 379 if (argc != 0 && zend_parse_parameters(argc, "ll", &min, &max) == FAILURE) {
380 return (1); 380 return (1);
381 } 381 }
382 382
383 if (!SUHOSIN7_G(mt_is_seeded)) { 383 if (!SUHOSIN7_G(mt_is_seeded)) {
@@ -401,7 +401,7 @@ S7_IH_FUNCTION(rand)
401 long number; 401 long number;
402 402
403 if (argc != 0 && zend_parse_parameters(argc, "ll", &min, &max) == FAILURE) { 403 if (argc != 0 && zend_parse_parameters(argc, "ll", &min, &max) == FAILURE) {
404 return (1); 404 return (1);
405 } 405 }
406 406
407 if (!SUHOSIN7_G(r_is_seeded)) { 407 if (!SUHOSIN7_G(r_is_seeded)) {