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

Comparing ray/src/rt/rpict.c (file contents):
Revision 1.16 by greg, Tue Jan 16 11:30:09 1990 UTC vs.
Revision 1.20 by greg, Tue Mar 27 11:40:07 1990 UTC

# Line 18 | Line 18 | static char SCCSid[] = "$SunId$ LBL";
18   #else
19   #include  <signal.h>
20   #endif
21 < #include  <sys/fcntl.h>
21 > #include  <fcntl.h>
22  
23   #include  "view.h"
24  
# Line 149 | Line 149 | char  *zfile, *oldfile;
149                                                  /* compute scanlines */
150          for (ypos -= ystep; ypos > -ystep; ypos -= ystep) {
151                                                          /* record progress */
152 <                pctdone = 100.0*(vresolu-ypos-ystep)/vresolu;
152 >                pctdone = 100.0*(vresolu-1-ypos-ystep)/vresolu;
153                                                          /* bottom adjust? */
154                  if (ypos < 0) {
155                          ystep += ypos;
# Line 167 | Line 167 | char  *zfile, *oldfile;
167                  fillscanbar(scanbar, zbar, hresolu, ypos, ystep);
168                                                          /* write it out */
169                  for (i = ystep; i > 0; i--) {
170 <                        if (zfd!=-1 && write(zfd,zbar[i],hresolu*sizeof(float))
170 >                        if (zfd != -1 && write(zfd, (char *)zbar[i],
171 >                                        hresolu*sizeof(float))
172                                          < hresolu*sizeof(float))
173                                  goto writerr;
174 <                        if (fwritescan(scanbar[i],hresolu,stdout) < 0)
174 >                        if (fwritescan(scanbar[i], hresolu, stdout) < 0)
175                                  goto writerr;
176                  }
177                  if (fflush(stdout) == EOF)
# Line 178 | Line 179 | char  *zfile, *oldfile;
179          }
180                                                  /* clean up */
181          if (zfd != -1) {
182 <                if (write(zfd,zbar[0],hresolu*sizeof(float))
182 >                if (write(zfd, (char *)zbar[0], hresolu*sizeof(float))
183                                  < hresolu*sizeof(float))
184                          goto writerr;
185 <                close(zfd);
185 >                if (close(zfd) == -1)
186 >                        goto writerr;
187                  for (i = 0; i <= psample; i++)
188                          free((char *)zbar[i]);
189          }
# Line 328 | Line 330 | int  x, y;                     /* pixel position */
330  
331          copycolor(col, thisray.rcol);           /* return color */
332          
333 <        return(thisray.rot);                    /* return distance */
333 >        return(thisray.rt);                     /* return distance */
334   }
335  
336  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines