summaryrefslogtreecommitdiff
path: root/isisd/topology/random.c
diff options
context:
space:
mode:
authorhasso <hasso>2005-09-01 18:18:47 +0000
committerhasso <hasso>2005-09-01 18:18:47 +0000
commit29e50b23530f37df9073808fe78a6c22f00beeea (patch)
treec6461b12ec92d0ba5dc776a16510dc2695c6587a /isisd/topology/random.c
parentaac372f4f5b617a579dafeab31fb486a5d69d65d (diff)
* 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.
Diffstat (limited to 'isisd/topology/random.c')
-rw-r--r--isisd/topology/random.c9
1 files changed, 5 insertions, 4 deletions
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 <sys/types.h>
#include <sys/times.h>
-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) ;
}
/*********************************************************************/