Changeset 247 for cpp/common/random.h
- Timestamp:
- 11/07/14 17:51:01 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/common/random.h
r197 r247 12 12 #include <sys/stat.h> 13 13 #include <fcntl.h> 14 #endif 15 #ifdef __BORLANDC__ 16 #include <stdint.h> //uintptr_t in borland 14 17 #endif 15 18 #ifdef _WIN32 … … 76 79 { 77 80 counter++; 78 seed = time(NULL); //time (seconds); could use hi-res timer but then we would depend on common/timer.h79 seed ^= counter; //incremented value, possibly randomly initialized80 seed ^= (unsigned int) &counter; //memory address81 seed = time(NULL); //time (seconds); could use hi-res timer but then we would depend on common/timer.h 82 seed ^= counter; //incremented value, possibly randomly initialized 83 seed ^= (unsigned int)(uintptr_t)&counter; //memory address 81 84 } 82 85 #ifdef _WIN32 //add more randomness from uuid
Note: See TracChangeset
for help on using the changeset viewer.