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

Comparing ray/src/cal/cnt.c (file contents):
Revision 1.5 by greg, Wed Apr 20 20:56:01 2022 UTC vs.
Revision 1.6 by greg, Thu Apr 21 02:52:40 2022 UTC

# Line 213 | Line 213 | big_shuffle(long *n, long alen)
213          tree_root = tree_alloc(alen);
214  
215          while (alen > 0)                /* allocate and print random array entries */
216 <                print_shuf(n, eat_nth_leaf(tree_root, random() % alen--));
216 >                print_shuf(n, eat_nth_leaf(tree_root, irandom(alen--)));
217  
218          free(tree_root);                /* all done */
219   }
# Line 251 | Line 251 | shuffle(long *n)
251                  myshuf[i] = i;
252                                  /* perform Fisher-Yates shuffle */
253          for (i = 0; i < alen-1; i++) {
254 <                int     ix = random()%(alen-i) + i;
254 >                int     ix = irandom(alen-i) + i;
255                  int     ndx = myshuf[i];
256                  myshuf[i] = myshuf[ix];
257                  myshuf[ix] = ndx;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines