diff options
| author | Simon Tatham <anakin@pobox.com> | 2005-05-23 11:15:39 +0000 |
|---|---|---|
| committer | Simon Tatham <anakin@pobox.com> | 2005-05-23 11:15:39 +0000 |
| commit | 80aa8bafb1d20bc0b2fea6b5c928db58a93c851f (patch) | |
| tree | 0dcac831300bff2840915a78c0529d63bc38c21c | |
| parent | 916ad912980d1890c98c3d1d7576b57a017b71bf (diff) | |
| download | puzzles-80aa8bafb1d20bc0b2fea6b5c928db58a93c851f.zip puzzles-80aa8bafb1d20bc0b2fea6b5c928db58a93c851f.tar.gz puzzles-80aa8bafb1d20bc0b2fea6b5c928db58a93c851f.tar.bz2 puzzles-80aa8bafb1d20bc0b2fea6b5c928db58a93c851f.tar.xz | |
I'm sick of `--generate' giving the same answers if you run it twice
in one second. Switched the Unix get_random_seed() to using
gettimeofday() rather than time().
[originally from svn r5837]
| -rw-r--r-- | gtk.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -82,10 +82,10 @@ struct frontend { void get_random_seed(void **randseed, int *randseedsize) { - time_t *tp = snew(time_t); - time(tp); - *randseed = (void *)tp; - *randseedsize = sizeof(time_t); + struct timeval *tvp = snew(struct timeval); + gettimeofday(tvp, NULL); + *randseed = (void *)tvp; + *randseedsize = sizeof(struct timeval); } void frontend_default_colour(frontend *fe, float *output) |