From 102d0d14faf12415db0b1cd4bf3a2d510aa798c8 Mon Sep 17 00:00:00 2001 From: simon Date: Mon, 23 May 2005 11:15:39 +0000 Subject: [PATCH] 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(). git-svn-id: svn://svn.tartarus.org/sgt/puzzles@5837 cda61777-01e9-0310-a592-d414129be87e --- gtk.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gtk.c b/gtk.c index 859231f..ab10a11 100644 --- a/gtk.c +++ b/gtk.c @@ -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) -- 2.11.0