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

Comparing ray/src/rt/rtrace.c (file contents):
Revision 2.44 by greg, Sun Jun 5 19:52:01 2005 UTC vs.
Revision 2.46 by greg, Fri Jun 10 20:44:00 2005 UTC

# Line 50 | Line 50 | void  (*trace)() = NULL;               /* trace call */
50  
51   char  *tralist[128];                    /* list of modifers to trace (or no) */
52   int  traincl = -1;                      /* include == 1, exclude == 0 */
53 < #define  MAXTSET        511             /* maximum number in trace set */
53 > #ifndef  MAXTSET
54 > #define  MAXTSET        1024            /* maximum number in trace set */
55 > #endif
56   OBJECT  traset[MAXTSET+1]={0};          /* trace include/exclude set */
57  
58   int  hresolu = 0;                       /* horizontal (scan) size */
# Line 148 | Line 150 | rtrace(                                /* trace rays from file */
150          char  *fname
151   )
152   {
153 <        long  vcount = hresolu>1 ? hresolu*vresolu : vresolu;
153 >        unsigned long  vcount = (hresolu > 1) ? (unsigned long)hresolu*vresolu
154 >                                              : vresolu;
155          long  nextflush = hresolu;
156          FILE  *fp;
157          double  d;
# Line 187 | Line 190 | rtrace(                                /* trace rays from file */
190                  d = normalize(direc);
191                  if (d == 0.0) {                         /* zero ==> flush */
192                          bogusray();
193 <                        if (--nextflush <= 0 || vcount <= 0) {
193 >                        if (--nextflush <= 0 || !vcount) {
194                                  fflush(stdout);
195                                  nextflush = hresolu;
196                          }
# Line 199 | Line 202 | rtrace(                                /* trace rays from file */
202                          else
203                                  rad(orig, direc, lim_dist ? d : 0.0);
204                                                          /* flush if time */
205 <                        if (--nextflush == 0) {
205 >                        if (!--nextflush) {
206                                  fflush(stdout);
207                                  nextflush = hresolu;
208                          }
209                  }
210                  if (ferror(stdout))
211                          error(SYSTEM, "write error");
212 <                if (--vcount == 0)                      /* check for end */
212 >                if (vcount && !--vcount)                /* check for end */
213                          break;
214          }
215          fflush(stdout);
216 <        if (vcount > 0)
216 >        if (vcount)
217                  error(USER, "unexpected EOF on input");
218          if (fname != NULL)
219                  fclose(fp);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines