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.5 by gwlarson, Tue Oct 27 08:47:18 1998 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 263 | Line 265 | int    np;
265                                  progname, np);
266   #endif
267          bzero(pb+6*np, 6*sizeof(float));
268 <        if (process(rt_pd, pb, pb, 3*sizeof(float)*np,
269 <                        6*sizeof(float)*(np+1)) < 3*sizeof(float)*np) {
268 >        if (process(rt_pd, pb, pb, 3*sizeof(float)*(np+1),
269 >                        6*sizeof(float)*(np+1)) < 3*sizeof(float)*(np+1)) {
270                  fprintf(stderr, "%s: rtrace communication error\n",
271                                  progname);
272                  exit(1);
# Line 272 | Line 274 | int    np;
274   }
275  
276  
277 + int
278   getexpos(s)                     /* get exposure from header line */
279   char    *s;
280   {
# Line 283 | Line 286 | char   *s;
286                  formatval(fmt, s);
287                  wrongformat = strcmp(fmt, COLRFMT);
288          }
289 +        return(0);
290   }
291  
292  
# Line 290 | Line 294 | open_pict(fn)                  /* open picture file */
294   char    *fn;
295   {
296          if ((pictfp = fopen(fn, "r")) == NULL) {
297 <                fprintf("%s: cannot open\n", fn);
297 >                fprintf(stderr, "%s: cannot open\n", fn);
298                  exit(1);
299          }
300          exposure = 1.0;
# Line 398 | Line 402 | initscans()                            /* initialize scanline buffers */
402          register SCAN   *ptr;
403          register int    i;
404                                          /* initialize positions */
405 <        scanpos = (long *)malloc(pysiz*sizeof(long));
405 >        scanpos = (long *)bmalloc(pysiz*sizeof(long));
406          if (scanpos == NULL)
407                  memerr("scanline positions");
408          for (i = pysiz-1; i >= 0; i--)
# Line 415 | Line 419 | initscans()                            /* initialize scanline buffers */
419          i = MAXSBUF / scansize;         /* compute number to allocate */
420          if (i > HSIZE)
421                  i = HSIZE;
422 <        scan_buf = malloc(i*scansize);  /* get in one big chunk */
422 >        scanbufsiz = i*scansize;
423 >        scan_buf = bmalloc(scanbufsiz); /* get in one big chunk */
424          if (scan_buf == NULL)
425                  memerr("scanline buffers");
426          ptr = (SCAN *)scan_buf;
# Line 432 | Line 437 | initscans()                            /* initialize scanline buffers */
437  
438   donescans()                             /* free up scanlines */
439   {
440 <        free(scan_buf);
441 <        free((char *)scanpos);
440 >        bfree(scan_buf, scanbufsiz);
441 >        bfree((char *)scanpos, pysiz*sizeof(long));
442   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines