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

Comparing ray/src/util/rmatrix.c (file contents):
Revision 2.20 by schorsch, Sun Mar 6 01:13:18 2016 UTC vs.
Revision 2.21 by greg, Thu Aug 18 00:52:48 2016 UTC

# Line 9 | Line 9 | static const char RCSid[] = "$Id$";
9   #include <stdlib.h>
10   #include <string.h>
11   #include <fcntl.h>
12 + #include "rtio.h"
13   #include "platform.h"
14   #include "resolu.h"
15   #include "paths.h"
# Line 133 | Line 134 | rmx_load_float(RMATRIX *rm, FILE *fp)
134          }
135          for (i = 0; i < rm->nrows; i++)
136              for (j = 0; j < rm->ncols; j++) {
137 <                if (fread(val, sizeof(val[0]), rm->ncomp, fp) != rm->ncomp)
137 >                if (getbinary(val, sizeof(val[0]), rm->ncomp, fp) != rm->ncomp)
138                      return(0);
139                  for (k = rm->ncomp; k--; )
140                       rmx_lval(rm,i,j,k) = val[k];
# Line 153 | Line 154 | rmx_load_double(RMATRIX *rm, FILE *fp)
154          }
155          for (i = 0; i < rm->nrows; i++)
156              for (j = 0; j < rm->ncols; j++) {
157 <                if (fread(val, sizeof(val[0]), rm->ncomp, fp) != rm->ncomp)
157 >                if (getbinary(val, sizeof(val[0]), rm->ncomp, fp) != rm->ncomp)
158                      return(0);
159                  for (k = rm->ncomp; k--; )
160                       rmx_lval(rm,i,j,k) = val[k];
# Line 329 | Line 330 | rmx_write_float(const RMATRIX *rm, FILE *fp)
330              for (j = 0; j < rm->ncols; j++) {
331                  for (k = rm->ncomp; k--; )
332                      val[k] = (float)rmx_lval(rm,i,j,k);
333 <                if (fwrite(val, sizeof(val[0]), rm->ncomp, fp) != rm->ncomp)
333 >                if (putbinary(val, sizeof(val[0]), rm->ncomp, fp) != rm->ncomp)
334                          return(0);
335              }
336          return(1);
# Line 349 | Line 350 | rmx_write_double(const RMATRIX *rm, FILE *fp)
350              for (j = 0; j < rm->ncols; j++) {
351                  for (k = rm->ncomp; k--; )
352                      val[k] = rmx_lval(rm,i,j,k);
353 <                if (fwrite(val, sizeof(val[0]), rm->ncomp, fp) != rm->ncomp)
353 >                if (putbinary(val, sizeof(val[0]), rm->ncomp, fp) != rm->ncomp)
354                          return(0);
355              }
356          return(1);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines