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.45 by greg, Fri Jun 10 16:49:42 2005 UTC

# Line 148 | Line 148 | rtrace(                                /* trace rays from file */
148          char  *fname
149   )
150   {
151 <        long  vcount = hresolu>1 ? hresolu*vresolu : vresolu;
151 >        unsigned long  vcount = (hresolu > 1) ? (unsigned long)hresolu*vresolu
152 >                                              : vresolu;
153          long  nextflush = hresolu;
154          FILE  *fp;
155          double  d;
# Line 187 | Line 188 | rtrace(                                /* trace rays from file */
188                  d = normalize(direc);
189                  if (d == 0.0) {                         /* zero ==> flush */
190                          bogusray();
191 <                        if (--nextflush <= 0 || vcount <= 0) {
191 >                        if (--nextflush <= 0 || !vcount) {
192                                  fflush(stdout);
193                                  nextflush = hresolu;
194                          }
# Line 199 | Line 200 | rtrace(                                /* trace rays from file */
200                          else
201                                  rad(orig, direc, lim_dist ? d : 0.0);
202                                                          /* flush if time */
203 <                        if (--nextflush == 0) {
203 >                        if (!--nextflush) {
204                                  fflush(stdout);
205                                  nextflush = hresolu;
206                          }
207                  }
208                  if (ferror(stdout))
209                          error(SYSTEM, "write error");
210 <                if (--vcount == 0)                      /* check for end */
210 >                if (vcount && !--vcount)                /* check for end */
211                          break;
212          }
213          fflush(stdout);
214 <        if (vcount > 0)
214 >        if (vcount)
215                  error(USER, "unexpected EOF on input");
216          if (fname != NULL)
217                  fclose(fp);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines