ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/urand.c
(Generate patch)

Comparing ray/src/common/urand.c (file contents):
Revision 1.3 by greg, Tue May 21 11:01:00 1991 UTC vs.
Revision 2.2 by greg, Sat Sep 5 13:40:55 1992 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1991 Regents of the University of California */
1 > /* Copyright (c) 1992 Regents of the University of California */
2  
3   #ifndef lint
4   static char SCCSid[] = "$SunId$ LBL";
5   #endif
6  
7   /*
8 < * Uncorrelated (anticorrelated) random function
8 > * Anticorrelated random function due to Christophe Schlick
9   */
10  
11   #include  "random.h"
# Line 14 | Line 14 | static char SCCSid[] = "$SunId$ LBL";
14  
15   extern char  *malloc();
16  
17 < short  *urperm;         /* urand() permutation */
17 > short  *urperm = NULL;  /* urand() permutation */
18   int  urmask;            /* bits used in permutation */
19  
20  
# Line 24 | Line 24 | int  size;
24          int  order, n;
25          register int  i, offset;
26  
27 +        if (urperm != NULL)
28 +                free((char *)urperm);
29          size--;
30          for (i = 1; size >>= 1; i++)
31                  ;
# Line 53 | Line 55 | register int  *d;
55   register int  n;
56   {
57          static int  tab[8] = {13623,353,1637,5831,2314,3887,5832,8737};
58 <        register unsigned  hval;
58 >        register int  hval;
59  
60          hval = 0;
61          while (n-- > 0)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines