Changeset 539 for trunk/src/sh_files.c
- Timestamp:
- Jan 7, 2019, 8:03:37 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/sh_files.c
r516 r539 2046 2046 #endif 2047 2047 2048 /* This is the LCG from Numerical Recipies. Deterministic. 2049 */ 2050 static unsigned int simple_rand(unsigned int * state) 2051 { 2052 *state = 1664525 * (*state) + 1013904223; 2053 return *state; 2054 } 2055 2048 2056 void * sh_dummy_dirlist; 2049 2057 void * sh_dummy_tmpcat; … … 2290 2298 BREAKEXIT(sh_derr); 2291 2299 2292 #if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_RAND_R) 2293 if (0 == (rand_r(&state) % 5)) (void) sh_derr(); 2294 #else 2295 if (0 == state * (rand() % 5)) (void) sh_derr(); 2296 #endif 2300 if (0 == (simple_rand(&state) % 5)) (void) sh_derr(); 2297 2301 2298 2302 /* ---- Check the file. ---- … … 2637 2641 BREAKEXIT(sh_derr); 2638 2642 2639 #if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_RAND_R) 2640 if (0 == (rand_r(&state) % 2)) (void) sh_derr(); 2641 #else 2642 if (0 == state * (rand() % 2)) (void) sh_derr(); 2643 #endif 2643 if (0 == (simple_rand(&state) % 2)) (void) sh_derr(); 2644 2644 2645 2645 if (dirName && infileName && (dirName[0] == '/') && (dirName[1] == '\0')
Note:
See TracChangeset
for help on using the changeset viewer.