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.21 by greg, Fri Sep 16 05:06:07 2016 UTC vs.
Revision 2.25 by greg, Fri Apr 7 00:03:26 2023 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 141 | Line 143 | getostream(const char *ospec, const char *mname, int b
143          LUENT                   *lep;
144          STREAMOUT               *sop;
145          char                    *cp;
146 <        
146 >
147 >        info[0] = '\0';
148          if (ospec == NULL) {                    /* use stdout? */
149                  if (!noopen & !using_stdout) {
150                          if (outfmt != 'a')
151                                  SET_FILE_BINARY(stdout);
152 + #ifdef getc_unlocked
153 +                        flockfile(stdout);      /* avoid lock/unlock overhead */
154 + #endif
155                          if (header) {
156                                  cp = info;
157                                  if (yres > 0) {
# Line 162 | Line 168 | getostream(const char *ospec, const char *mname, int b
168                          if (waitflush > 0)
169                                  fflush(stdout);
170                          stdos.xr = xres; stdos.yr = yres;
165 #ifdef getc_unlocked
166                        flockfile(stdout);      /* avoid lock/unlock overhead */
167 #endif
171                          using_stdout = 1;
172                  }
173                  stdos.ofp = stdout;
# Line 519 | Line 522 | myseeko(const LUENT *e, void *p)
522          off_t           nbytes = *(off_t *)p;
523          
524          if (sop->reclen > 1)
525 <                nbytes = nbytes * sop->reclen;
525 >                nbytes *= (off_t)sop->reclen;
526          if (fseeko(sop->ofp, nbytes, SEEK_CUR) < 0) {
527                  sprintf(errmsg, "seek error on file '%s'", e->key);
528                  error(SYSTEM, errmsg);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines