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.14 by greg, Fri Aug 21 18:21:05 2015 UTC vs.
Revision 2.17 by schorsch, Sun Mar 6 01:13:18 2016 UTC

# Line 6 | Line 6 | static const char RCSid[] = "$Id$";
6   * File i/o and recovery
7   */
8  
9 + #include <ctype.h>
10 + #include "platform.h"
11   #include "rcontrib.h"
12   #include "resolu.h"
11 #include <ctype.h>
13  
14   /* Close output stream and free record */
15   static void
# Line 161 | Line 162 | getostream(const char *ospec, const char *mname, int b
162                          if (waitflush > 0)
163                                  fflush(stdout);
164                          stdos.xr = xres; stdos.yr = yres;
165 < #if 0
165 > #ifdef getc_unlocked
166                          flockfile(stdout);      /* avoid lock/unlock overhead */
167   #endif
168                          using_stdout = 1;
# Line 203 | Line 204 | getostream(const char *ospec, const char *mname, int b
204                          goto openerr;
205                  if (outfmt != 'a')
206                          SET_FILE_BINARY(sop->ofp);
207 < #if 0
207 > #ifdef getc_unlocked
208                  flockfile(sop->ofp);            /* avoid lock/unlock overhead */
209   #endif
210                  if (accumulate > 0) {           /* global resolution */
# Line 474 | Line 475 | reload_output()
475                                          error(WARNING, errmsg);
476                                          break;
477                                  }
478 < #if 0
478 > #ifdef getc_unlocked
479                                  flockfile(sout.ofp);
480   #endif
481                                  if (header && checkheader(sout.ofp, outvfmt, NULL) != 1) {
# Line 482 | Line 483 | reload_output()
483                                                          oname);
484                                          error(USER, errmsg);
485                                  }
486 <                                if ((sout.xr > 0) & (sout.yr > 0) &&
486 >                                if ((sout.reclen == 1) & (sout.xr > 0) & (sout.yr > 0) &&
487                                                  (!fscnresolu(&xr, &yr, sout.ofp) ||
488                                                          (xr != sout.xr) |
489                                                          (yr != sout.yr))) {
# Line 592 | Line 593 | recover_output()
593                          } else {
594                                  sout.reclen = 0;
595                                  sout.outpipe = 0;
596 +                                sout.xr = xres;
597 +                                sout.yr = yres;
598                                  sout.ofp = NULL;
599                          }
600                          if (sout.ofp != NULL) { /* already open? */
# Line 632 | Line 635 | recover_output()
635                                                  oname);
636                                  error(USER, errmsg);
637                          }
638 <                        sout.xr = xres; sout.yr = yres;
636 <                        if ((sout.xr > 0) & (sout.yr > 0) &&
638 >                        if ((sout.reclen == 1) & (sout.xr > 0) & (sout.yr > 0) &&
639                                          (!fscnresolu(&xr, &yr, sout.ofp) ||
640                                                  (xr != sout.xr) |
641                                                  (yr != sout.yr))) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines