--- ray/src/px/pcond.c 2003/02/22 02:07:27 3.14 +++ ray/src/px/pcond.c 2003/07/27 22:12:03 3.17 @@ -1,11 +1,12 @@ #ifndef lint -static const char RCSid[] = "$Id: pcond.c,v 3.14 2003/02/22 02:07:27 greg Exp $"; +static const char RCSid[] = "$Id: pcond.c,v 3.17 2003/07/27 22:12:03 schorsch Exp $"; #endif /* * Condition Radiance picture for display/output * Added white-balance adjustment 10/01 (GW). */ +#include "platform.h" #include "pcond.h" @@ -105,7 +106,7 @@ char *argv[]; case 'e': if (i+1 >= argc) goto userr; scalef = atof(argv[++i]); - if (argv[i][0] == '+' | argv[i][0] == '-') + if ((argv[i][0] == '+') | (argv[i][0] == '-')) scalef = pow(2.0, scalef); what2do |= DO_LINEAR; break; @@ -150,7 +151,7 @@ char *argv[]; progname); exit(1); } - if (outprims == stdprims & inprims != stdprims) + if ((outprims == stdprims) & (inprims != stdprims)) outprims = inprims; Bldmin = Bl(ldmax/lddyn); Bldmax = Bl(ldmax); @@ -162,13 +163,11 @@ char *argv[]; /* open output file */ if (i+2 == argc && freopen(argv[i+1], "w", stdout) == NULL) syserror(argv[i+1]); -#ifdef MSDOS - setmode(fileno(infp), O_BINARY); - setmode(fileno(stdout), O_BINARY); -#endif + SET_FILE_BINARY(infp); + SET_FILE_BINARY(stdout); getahead(); /* load input header */ printargs(argc, argv, stdout); /* add to output header */ - if (mbcalfile == NULL & outprims != stdprims) + if ((mbcalfile == NULL) & (outprims != stdprims)) fputprims(outprims, stdout); if ((what2do & (DO_PREHIST|DO_VEIL|DO_ACUITY)) != DO_PREHIST) getfovimg(); /* get foveal sample image? */ @@ -244,7 +243,7 @@ getahead() /* load picture header */ exit(1); } if (!gotview || ourview.type == VT_PAR) { - copystruct(&ourview, &stdview); + ourview = stdview; ourview.type = VT_PER; if (pixaspect*inpres.yr < inpres.xr) { ourview.horiz = 40.0; @@ -326,7 +325,7 @@ getfovimg() /* load foveal sampled image */ if ((fp = popen(combuf, "r")) == NULL) syserror("popen"); getheader(fp, NULL, NULL); /* skip header */ - if (fgetresolu(&x, &y, fp) < 0 || x != fvxr | y != fvyr) + if (fgetresolu(&x, &y, fp) < 0 || (x != fvxr) | (y != fvyr)) goto readerr; for (y = 0; y < fvyr; y++) if (freadscan(fovscan(y), fvxr, fp) < 0)