--- ray/src/common/urand.c 2022/04/21 02:52:40 2.12 +++ ray/src/common/urand.c 2022/04/21 02:55:19 2.13 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: urand.c,v 2.12 2022/04/21 02:52:40 greg Exp $"; +static const char RCSid[] = "$Id: urand.c,v 2.13 2022/04/21 02:55:19 greg Exp $"; #endif /* * Anticorrelated random function due to Christophe Schlick @@ -25,14 +25,10 @@ irandom( /* better than using random() % modulus */ long modulus ) { - static const int isize = sizeof(int); - static const int lsize = sizeof(long); - static const int llsize = sizeof(long long); - - if ((lsize == 8) | (isize == 8)) + if ((sizeof(long) == 8) | (sizeof(int) == 8)) return((random()*modulus)>>31); - if (llsize == 8) + if (sizeof(long long) == 8) return((random()*(long long)modulus)>>31); return(random() % modulus);