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

Comparing ray/src/util/rtcontrib.c (file contents):
Revision 1.56 by greg, Fri Jun 11 20:26:09 2010 UTC vs.
Revision 1.60 by greg, Sun Oct 10 09:25:04 2010 UTC

# Line 20 | Line 20 | static const char RCSid[] = "$Id$";
20   #define MAXMODLIST      1024            /* maximum modifiers we'll track */
21   #endif
22  
23 < int     treebufsiz = BUFSIZ;            /* current tree buffer size */
23 > size_t  treebufsiz = BUFSIZ;            /* current tree buffer size */
24  
25   typedef double  DCOLOR[3];              /* double-precision color */
26  
# Line 92 | Line 92 | struct rtproc {
92          struct rtproc   *next;          /* next in list of processes */
93          SUBPROC         pd;             /* rtrace pipe descriptors */
94          unsigned long   raynum;         /* ray number for this tree */
95 <        int             bsiz;           /* ray tree buffer length */
95 >        size_t          bsiz;           /* ray tree buffer length */
96          char            *buf;           /* ray tree buffer */
97 <        int             nbr;            /* number of bytes from rtrace */
97 >        size_t          nbr;            /* number of bytes from rtrace */
98   };                              /* rtrace process buffer */
99  
100                                          /* rtrace command and defaults */
# Line 545 | Line 545 | init(int np)
545                  raysleft = 0;
546          if ((account = accumulate) > 0)
547                  raysleft *= accumulate;
548 <        waitflush = xres;
548 >        waitflush = (yres > 0) & (xres > 1) ? 0 : xres;
549          if (!recover)
550                  return;
551                                          /* recover previous values */
# Line 736 | Line 736 | printresolu(FILE *fout, int xr, int yr)
736   {
737          if ((xr > 0) & (yr > 0))        /* resolution string */
738                  fprtresolu(xr, yr, fout);
739        if (xres > 0)                   /* global flush flag */
740                fflush(fout);
739   }
740  
741   /* Get output stream pointer (open and write header if new and noopen==0) */
# Line 758 | Line 756 | getostream(const char *ospec, const char *mname, int b
756                          if (header)
757                                  printheader(stdout, NULL);
758                          printresolu(stdout, xres, yres);
759 +                        if (waitflush > 0)
760 +                                fflush(stdout);
761                          stdos.xr = xres; stdos.yr = yres;
762                          using_stdout = 1;
763                  }
# Line 826 | Line 826 | getostream(const char *ospec, const char *mname, int b
826                          if (outfmt == 'a')
827                                  putc('\n', sop->ofp);
828                  }
829 <                if (xres > 0)
829 >                if (waitflush > 0)
830                          fflush(sop->ofp);
831          }
832          sop->reclen += noopen;                  /* add to length if noopen */
# Line 993 | Line 993 | done_contrib(int navg)
993          if (using_stdout & (outfmt == 'a'))
994                  putc('\n', stdout);
995          if (!waitflush) {
996 <                waitflush = xres;
996 >                waitflush = (yres > 0) & (xres > 1) ? 0 : xres;
997                  if (using_stdout)
998                          fflush(stdout);
999          }
# Line 1075 | Line 1075 | wait_rproc(void)
1075   {
1076          struct rtproc   *rtfree = NULL;
1077          fd_set          readset, errset;
1078 <        int             nr;
1078 >        ssize_t         nr;
1079          struct rtproc   *rt;
1080          int             n;
1081          

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines