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.16 by greg, Wed Jul 22 04:29:56 2015 UTC vs.
Revision 2.17 by greg, Wed Jul 22 04:47:51 2015 UTC

# Line 111 | Line 111 | static int
111   rmx_load_ascii(RMATRIX *rm, FILE *fp)
112   {
113          int     i, j, k;
114 < #ifdef _WIN32
115 <        _setmode(fileno(fp), _O_TEXT);
116 < #endif
114 >
115          for (i = 0; i < rm->nrows; i++)
116              for (j = 0; j < rm->ncols; j++)
117                  for (k = 0; k < rm->ncomp; k++)
# Line 253 | Line 251 | rmx_load(const char *inspec)
251          dnew->info = dinfo.info;
252          switch (dinfo.dtype) {
253          case DTascii:
254 + #ifdef _WIN32
255 +                _setmode(fileno(fp), _O_TEXT);
256 + #endif
257                  if (!rmx_load_ascii(dnew, fp))
258                          goto loaderr;
259                  dnew->dtype = DTascii;          /* should leave double? */
# Line 300 | Line 301 | static int
301   rmx_write_ascii(const RMATRIX *rm, FILE *fp)
302   {
303          int     i, j, k;
304 < #ifdef _WIN32
304 <        _setmode(fileno(fp), _O_TEXT);
305 < #endif
304 >
305          for (i = 0; i < rm->nrows; i++) {
306              for (j = 0; j < rm->ncols; j++) {
307                  for (k = 0; k < rm->ncomp; k++)
# Line 385 | Line 384 | rmx_write(const RMATRIX *rm, int dtype, FILE *fp)
384  
385          if ((rm == NULL) | (fp == NULL))
386                  return(0);
387 + #ifdef getc_unlocked
388 +        flockfile(fp);
389 + #endif
390                                                  /* complete header */
391          if (rm->info)
392                  fputs(rm->info, fp);
# Line 429 | Line 431 | rmx_write(const RMATRIX *rm, int dtype, FILE *fp)
431                  return(0);
432          }
433          ok &= (fflush(fp) == 0);
434 + #ifdef getc_unlocked
435 +        funlockfile(fp);
436 + #endif
437          rmx_free(mydm);
438          return(ok);
439   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines