diff options
| author | Jani Taskinen <jani@php.net> | 2007-11-06 10:57:10 +0000 |
|---|---|---|
| committer | Jani Taskinen <jani@php.net> | 2007-11-06 10:57:10 +0000 |
| commit | 5262157d498a34119e776993bc45c85b482f958a (patch) | |
| tree | 8ff0d785368fcdf67087cf8bda722356109bc037 | |
| parent | 661b7c13e6c8f2717c5ff6ebe940eda646d92f5c (diff) | |
| download | php-git-5262157d498a34119e776993bc45c85b482f958a.tar.gz | |
MFH: ws + folding tags
| -rw-r--r-- | ext/standard/lcg.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/ext/standard/lcg.c b/ext/standard/lcg.c index 62531cf095..b2aa2443d4 100644 --- a/ext/standard/lcg.c +++ b/ext/standard/lcg.c @@ -36,7 +36,6 @@ int lcg_globals_id; #else static php_lcg_globals lcg_globals; #endif - #ifdef PHP_WIN32 #include <process.h> @@ -44,7 +43,7 @@ static php_lcg_globals lcg_globals; /* * combinedLCG() returns a pseudo random number in the range of (0, 1). - * The function combines two CGs with periods of + * The function combines two CGs with periods of * 2^31 - 85 and 2^31 - 249. The period of this function * is equal to the product of both primes. */ @@ -53,11 +52,11 @@ static php_lcg_globals lcg_globals; static void lcg_seed(TSRMLS_D); -PHPAPI double php_combined_lcg(TSRMLS_D) +PHPAPI double php_combined_lcg(TSRMLS_D) /* {{{ */ { php_int32 q; php_int32 z; - + if (!LCG(seeded)) { lcg_seed(TSRMLS_C); } @@ -72,8 +71,9 @@ PHPAPI double php_combined_lcg(TSRMLS_D) return z * 4.656613e-10; } +/* }}} */ -static void lcg_seed(TSRMLS_D) +static void lcg_seed(TSRMLS_D) /* {{{ */ { struct timeval tv; @@ -90,13 +90,15 @@ static void lcg_seed(TSRMLS_D) LCG(seeded) = 1; } +/* }}} */ -static void lcg_init_globals(php_lcg_globals *lcg_globals_p TSRMLS_DC) +static void lcg_init_globals(php_lcg_globals *lcg_globals_p TSRMLS_DC) /* {{{ */ { LCG(seeded) = 0; } +/* }}} */ -PHP_MINIT_FUNCTION(lcg) +PHP_MINIT_FUNCTION(lcg) /* {{{ */ { #ifdef ZTS ts_allocate_id(&lcg_globals_id, sizeof(php_lcg_globals), (ts_allocate_ctor) lcg_init_globals, NULL); @@ -105,6 +107,7 @@ PHP_MINIT_FUNCTION(lcg) #endif return SUCCESS; } +/* }}} */ /* {{{ proto float lcg_value() Returns a value from the combined linear congruential generator */ |
