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

Comparing ray/src/util/glaresrc.c (file contents):
Revision 2.2 by greg, Tue Mar 10 10:00:33 1992 UTC vs.
Revision 2.4 by greg, Sat Feb 22 02:07:30 2003 UTC

# Line 1 | Line 1
1 /* Copyright (c) 1991 Regents of the University of California */
2
1   #ifndef lint
2 < static char SCCSid[] = "$SunId$ LBL";
2 > static const char       RCSid[] = "$Id$";
3   #endif
6
4   /*
5   * Gather samples and compute glare sources.
6   */
# Line 81 | Line 78 | analyze()                      /* analyze our scene */
78                  if (left < h)
79                          addsrcspan(newspan(left,h,v,spanbr));
80          }
81 <        free((char *)spanbr);
81 >        free((void *)spanbr);
82          close_allsrcs();
83   }
84  
# Line 241 | Line 238 | struct source  *sp, *ap;
238                  sp->brt = (sp->brt*sp->dom + ap->brt*ap->dom)
239                                  / (sp->dom + ap->dom);
240          }
241 <        free((char *)ap);
241 >        free((void *)ap);
242   }
243  
244  
# Line 382 | Line 379 | register struct source *sp;
379                          sp->dom += d;
380                  }
381          }
382 +        freespans(sp);
383 +        if (sp->dom <= FTINY) {         /* must be right at edge of image */
384 +                free((void *)sp);
385 +                return;
386 +        }
387          sp->brt /= (double)n;
388          compdir(sp->dir, (int)(hsum/sp->dom), (int)(vsum/sp->dom));
387        freespans(sp);
389          sp->next = donelist;
390          donelist = sp;
391          if (verbose)
# Line 454 | Line 455 | register struct source *s;
455                  indirect[i].n += d;
456          }
457          freespans(s);
458 <        free((char *)s);
458 >        free((void *)s);
459   }
460  
461  
# Line 463 | Line 464 | struct source  *sp;
464   {
465          register struct srcspan *ss;
466  
467 <        for (ss = sp->first; ss != NULL; ss = ss->next)
468 <                free((char *)ss);
469 <        sp->first = NULL;
467 >        while ((ss = sp->first) != NULL) {
468 >                sp->first = ss->next;
469 >                free((void *)ss);
470 >        }
471   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines