--- ray/src/util/glareval.c 2004/01/02 12:48:36 2.11 +++ ray/src/util/glareval.c 2012/10/10 21:41:02 2.14 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: glareval.c,v 2.11 2004/01/02 12:48:36 schorsch Exp $"; +static const char RCSid[] = "$Id: glareval.c,v 2.14 2012/10/10 21:41:02 greg Exp $"; #endif /* * Compute pixels for glare calculation @@ -10,6 +10,7 @@ static const char RCSid[] = "$Id: glareval.c,v 2.11 20 #include #include +#include "platform.h" #include "rtprocess.h" /* Windows: must come first because of conflicts */ #include "glare.h" @@ -144,7 +145,7 @@ seekerr: #ifdef DEBUG -static void +void pict_stats(void) /* print out picture read statistics */ { static long lastcall = 0L; /* ncall at last report */ @@ -248,8 +249,10 @@ getviewspan( /* compute a span of view pixels */ /* send to rtrace */ if (n >= maxpix) { /* flush */ rt_compute(rt_buf, n); - while (n-- > 0) + while (n > 0) { + --n; vb[buf_vh[n]+hsize] = luminance(rt_buf+3*n); + } } rt_buf[6*n] = ourview.vp[0]; rt_buf[6*n+1] = ourview.vp[1]; @@ -319,6 +322,7 @@ open_pict( /* open picture file */ fprintf(stderr, "%s: cannot open\n", fn); exit(1); } + SET_FILE_BINARY(pictfp); exposure = 1.0; getheader(pictfp, getexpos, NULL); if (wrongformat || !fscnresolu(&pxsiz, &pysiz, pictfp)) {