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

Comparing ray/src/rt/rc2.c (file contents):
Revision 2.20 by greg, Fri Sep 16 04:49:15 2016 UTC vs.
Revision 2.24 by greg, Wed Sep 4 20:19:51 2019 UTC

# Line 116 | Line 116 | printheader(FILE *fout, const char *info)
116          fputs("NCOMP=3\n", fout);               /* always RGB */
117          if (info != NULL)                       /* add extra info if given */
118                  fputs(info, fout);
119 +        if ((outfmt == 'f') | (outfmt == 'd'))
120 +                fputendian(fout);
121          fputformat(formstr(outfmt), fout);
122          fputc('\n', fout);                      /* empty line ends header */
123   }
# Line 146 | Line 148 | getostream(const char *ospec, const char *mname, int b
148                  if (!noopen & !using_stdout) {
149                          if (outfmt != 'a')
150                                  SET_FILE_BINARY(stdout);
151 + #ifdef getc_unlocked
152 +                        flockfile(stdout);      /* avoid lock/unlock overhead */
153 + #endif
154                          if (header) {
155                                  cp = info;
156                                  if (yres > 0) {
# Line 162 | Line 167 | getostream(const char *ospec, const char *mname, int b
167                          if (waitflush > 0)
168                                  fflush(stdout);
169                          stdos.xr = xres; stdos.yr = yres;
165 #ifdef getc_unlocked
166                        flockfile(stdout);      /* avoid lock/unlock overhead */
167 #endif
170                          using_stdout = 1;
171                  }
172                  stdos.ofp = stdout;
# Line 519 | Line 521 | myseeko(const LUENT *e, void *p)
521          off_t           nbytes = *(off_t *)p;
522          
523          if (sop->reclen > 1)
524 <                nbytes = nbytes * sop->reclen;
524 >                nbytes *= (off_t)sop->reclen;
525          if (fseeko(sop->ofp, nbytes, SEEK_CUR) < 0) {
526                  sprintf(errmsg, "seek error on file '%s'", e->key);
527                  error(SYSTEM, errmsg);
# Line 588 | Line 590 | recover_output()
590                                  sprintf(errmsg, "missing recover file '%s'",
591                                                  oname);
592                                  error(WARNING, errmsg);
593 +                                lastout = 0;
594                                  break;
595                          }
596                          nvals = lseek(fileno(sop->ofp), 0, SEEK_END);
# Line 620 | Line 623 | recover_output()
623                  }
624                  if (!lastout) {                 /* empty output */
625                          error(WARNING, "no previous data to recover");
626 <                        lu_done(&ofiletab);     /* reclose all outputs */
626 >                                                /* reclose all outputs */
627 >                        lu_doall(&ofiletab, &myclose, NULL);
628                          return;
629                  }
630          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines