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.59 by greg, Sun Oct 10 01:26:51 2010 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines