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.14 by greg, Sat Dec 28 18:05:13 2019 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines