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.6 by greg, Thu Apr 21 02:52:40 2022 UTC vs.
Revision 1.9 by greg, Thu Feb 27 20:00:35 2025 UTC

# Line 161 | Line 161 | incr_counter(uby8 *ctrp, int n)
161   {
162          n = tree_br[n].cntr_siz;
163  
164 <        while (n-- > 0)                 /* LSB first */
165 <                if (++(*ctrp++))
166 <                        break;
164 >        while (! ++(*ctrp++))           /* LSB first */
165 >                if (--n <= 0) {
166 >                        fputs("Shuffle occupancy overflow!\n", stderr);
167 >                        exit(1);        /* means we sized something wrong */
168 >                }
169   }
170  
171  
# Line 285 | Line 287 | main(int argc, char *argv[])
287          n[a] = 0;
288          if (!a)
289                  goto userr;
290 <
290 > #ifdef getc_unlocked
291 >        flockfile(stdout);              /* avoid overhead */
292 > #endif
293          if (doshuffle)
294                  shuffle(n);
295          else

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines