From 29e50b23530f37df9073808fe78a6c22f00beeea Mon Sep 17 00:00:00 2001 From: hasso Date: Thu, 1 Sep 2005 18:18:47 +0000 Subject: * random.c, spgrid.[ch]: Fix warnings with hope that I didn't broke anything. These floats to longs and vice versa casts are starnge indeed. * isis_pdu.c: As we don't use %z for size_t for now because we support older compilers, cast them to unsigned long. Also fix previous changelog entry. Isisd compiles cleanly now again. --- isisd/topology/random.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'isisd/topology/random.c') diff --git a/isisd/topology/random.c b/isisd/topology/random.c index d4ef9950..6ee17a0a 100644 --- a/isisd/topology/random.c +++ b/isisd/topology/random.c @@ -10,11 +10,11 @@ #include #include -float timer() +unsigned long timer() { struct tms hold; times(&hold); - return (float)(hold.tms_utime) / 60.0; + return (unsigned long) ((float) (hold.tms_utime) / 60.0); } @@ -84,6 +84,7 @@ static long irand () return (long) internal_seed ; } +#if 0 /* Not used. */ /*********************************************************************/ /* */ /* computer independent variant of irand */ @@ -106,14 +107,14 @@ static long xrand() internal_seed = ( (((is2 * A1) + (is1 * A2))% T16 )* T15 + (is2 * A2) ) & B; return (long) ( internal_seed ) ; } - +#endif /*********************************************************************/ double rand01() -{ return (double) irand() / BF ; +{ return (double) (irand() / BF) ; } /*********************************************************************/ -- cgit v1.2.1