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

Comparing ray/src/cal/total.c (file contents):
Revision 1.12 by greg, Thu Mar 24 19:00:54 2016 UTC vs.
Revision 1.13 by greg, Thu Aug 18 00:52:47 2016 UTC

# Line 12 | Line 12 | static const char      RCSid[] = "$Id$";
12   #include  <ctype.h>
13   #include  <math.h>
14   #include  "platform.h"
15 + #include  "rtio.h"
16  
17   #define  MAXCOL         8192            /* maximum number of columns */
18  
# Line 170 | Line 171 | getrecord(                     /* read next input record */
171          int   nf;
172                                                  /* reading binary input? */
173          if (nbicols > 0)
174 <                return(fread(field, sizeof(double), nbicols, fp));
174 >                return(getbinary(field, sizeof(double), nbicols, fp));
175          if (nbicols < 0) {
176                  float   *fbuf = (float *)buf;
177                  int     i;
178 <                nf = fread(fbuf, sizeof(float), -nbicols, fp);
178 >                nf = getbinary(fbuf, sizeof(float), -nbicols, fp);
179                  for (i = nf; i-- > 0; )
180                          field[i] = fbuf[i];
181                  return(nf);
# Line 211 | Line 212 | putrecord(                     /* write out results record */
212   {
213                                                  /* binary output? */
214          if (bocols > 0) {
215 <                fwrite(field, sizeof(double), n, fp);
215 >                putbinary(field, sizeof(double), n, fp);
216                  return;
217          }
218          if (bocols < 0) {
219                  float   fv;
220                  while (n-- > 0) {
221                          fv = *field++;
222 <                        fwrite(&fv, sizeof(float), 1, fp);
222 >                        putbinary(&fv, sizeof(float), 1, fp);
223                  }
224                  return;
225          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines