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

Comparing ray/src/cal/rcalc.c (file contents):
Revision 1.26 by greg, Thu Mar 24 18:48:28 2016 UTC vs.
Revision 1.27 by greg, Thu Aug 18 00:52:47 2016 UTC

# Line 281 | Line 281 | FILE  *fp
281          if (inpfmt != NULL)
282                  return(getrec());
283          if (tolower(itype) == 'd') {
284 <                if (fread(inpbuf, sizeof(double), nbicols, fp) != nbicols)
284 >                if (getbinary(inpbuf, sizeof(double), nbicols, fp) != nbicols)
285                          return(0);
286                  if (itype == 'D')
287                          swap64(inpbuf, nbicols);
288                  return(1);
289          }
290          if (tolower(itype) == 'f') {
291 <                if (fread(inpbuf, sizeof(float), nbicols, fp) != nbicols)
291 >                if (getbinary(inpbuf, sizeof(float), nbicols, fp) != nbicols)
292                          return(0);
293                  if (itype == 'F')
294                          swap32(inpbuf, nbicols);
# Line 466 | Line 466 | double  v
466          float   fval = v;
467  
468          while (++colpos < n)
469 <                fwrite(zerobuf,
469 >                putbinary(zerobuf,
470                          tolower(otype)=='d' ? sizeof(double) : sizeof(float),
471                          1, stdout);
472          switch (otype) {
# Line 474 | Line 474 | double  v
474                  swap64((char *)&v, 1);
475                  /* fall through */
476          case 'd':
477 <                fwrite(&v, sizeof(double), 1, stdout);
477 >                putbinary(&v, sizeof(double), 1, stdout);
478                  break;
479          case 'F':
480                  swap32((char *)&fval, 1);
481                  /* fall through */
482          case 'f':
483 <                fwrite(&fval, sizeof(float), 1, stdout);
483 >                putbinary(&fval, sizeof(float), 1, stdout);
484                  break;
485          }
486   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines