# HG changeset patch # User jwe # Date 1053120033 0 # Node ID ed8c4aaa8648171c026269250014d1985362e59c # Parent f071adceaa04dfcc525523277491c38e52d7e31b [project @ 2003-05-16 21:20:33 by jwe] diff -r f071adceaa04 -r ed8c4aaa8648 liboctave/ChangeLog --- a/liboctave/ChangeLog Fri May 16 20:11:35 2003 +0000 +++ b/liboctave/ChangeLog Fri May 16 21:20:33 2003 +0000 @@ -1,3 +1,7 @@ +2003-05-16 Paul Kienzle + + * oct-rand.cc: Use liboctave's clock layer instead of the system clock. + 2003-05-14 John W. Eaton * Makefile.in: Handle DESTDIR. diff -r f071adceaa04 -r ed8c4aaa8648 liboctave/oct-rand.cc --- a/liboctave/oct-rand.cc Fri May 16 20:11:35 2003 +0000 +++ b/liboctave/oct-rand.cc Fri May 16 21:20:33 2003 +0000 @@ -27,6 +27,7 @@ #include "f77-fcn.h" #include "lo-error.h" #include "oct-rand.h" +#include "oct-time.h" // Possible distributions of random numbers. This was handled with an // enum, but unwind_protecting that doesn't work so well. @@ -79,17 +80,13 @@ static void do_initialization (void) { - time_t now; - struct tm *tm; - - time (&now); - tm = localtime (&now); + octave_localtime tm; - int hour = tm->tm_hour + 1; - int minute = tm->tm_min + 1; - int second = tm->tm_sec + 1; + int hour = tm.hour() + 1; + int minute = tm.min() + 1; + int second = tm.sec() + 1; - int s0 = tm->tm_mday * hour * minute * second; + int s0 = tm.mday() * hour * minute * second; int s1 = hour * minute * second; s0 = force_to_fit_range (s0, 1, 2147483563);