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

Comparing ray/src/util/glareval.c (file contents):
Revision 2.1 by greg, Tue Nov 12 17:19:21 1991 UTC vs.
Revision 2.3 by greg, Tue Sep 21 10:53:45 1993 UTC

# Line 41 | Line 41 | static int     maxpix;         /* maximum number of pixels to buf
41   static SCAN     *freelist;              /* scanline free list */
42   static SCAN     *hashtab[HSIZE];        /* scanline hash table */
43  
44 + static long     scanbufsiz;             /* size of allocated scanline buffer */
45 +
46   static long     ncall = 0L;     /* number of calls to getpictscan */
47   static long     nread = 0L;     /* number of scanlines read */
48   static long     nrecl = 0L;     /* number of scanlines reclaimed */
# Line 290 | Line 292 | open_pict(fn)                  /* open picture file */
292   char    *fn;
293   {
294          if ((pictfp = fopen(fn, "r")) == NULL) {
295 <                fprintf("%s: cannot open\n", fn);
295 >                fprintf(stderr, "%s: cannot open\n", fn);
296                  exit(1);
297          }
298          exposure = 1.0;
# Line 398 | Line 400 | initscans()                            /* initialize scanline buffers */
400          register SCAN   *ptr;
401          register int    i;
402                                          /* initialize positions */
403 <        scanpos = (long *)malloc(pysiz*sizeof(long));
403 >        scanpos = (long *)bmalloc(pysiz*sizeof(long));
404          if (scanpos == NULL)
405                  memerr("scanline positions");
406          for (i = pysiz-1; i >= 0; i--)
# Line 415 | Line 417 | initscans()                            /* initialize scanline buffers */
417          i = MAXSBUF / scansize;         /* compute number to allocate */
418          if (i > HSIZE)
419                  i = HSIZE;
420 <        scan_buf = malloc(i*scansize);  /* get in one big chunk */
420 >        scanbufsiz = i*scansize;
421 >        scan_buf = bmalloc(scanbufsiz); /* get in one big chunk */
422          if (scan_buf == NULL)
423                  memerr("scanline buffers");
424          ptr = (SCAN *)scan_buf;
# Line 432 | Line 435 | initscans()                            /* initialize scanline buffers */
435  
436   donescans()                             /* free up scanlines */
437   {
438 <        free(scan_buf);
439 <        free((char *)scanpos);
438 >        bfree(scan_buf, scanbufsiz);
439 >        bfree((char *)scanpos, pysiz*sizeof(long));
440   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines