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.21 by greg, Thu Aug 18 00:52:48 2016 UTC vs.
Revision 2.23 by greg, Tue Aug 30 14:54:08 2016 UTC

# Line 195 | Line 195 | rmx_load(const char *inspec)
195  
196          if (inspec == NULL) {                   /* reading from stdin? */
197                  inspec = "<stdin>";
198 < #if defined(_WIN32) || defined(_WIN64)
199 <                _setmode(fileno(stdin), _O_BINARY);
200 < #endif
198 >                SET_FILE_BINARY(stdin);
199          } else if (inspec[0] == '!') {
200                  if ((fp = popen(inspec+1, "r")) == NULL)
201                          return(NULL);
202 < #if defined(_WIN32) || defined(_WIN64)
205 <                _setmode(fileno(fp), _O_BINARY);
206 < #endif
202 >                SET_FILE_BINARY(stdin);
203          } else {
204                  const char      *sp = inspec;   /* check suffix */
205                  while (*sp)
# Line 254 | Line 250 | rmx_load(const char *inspec)
250          dnew->info = dinfo.info;
251          switch (dinfo.dtype) {
252          case DTascii:
253 < #if defined(_WIN32) || defined(_WIN64)
258 <                _setmode(fileno(fp), _O_TEXT);
259 < #endif
253 >                SET_FILE_TEXT(stdin);
254                  if (!rmx_load_ascii(dnew, fp))
255                          goto loaderr;
256                  dnew->dtype = DTascii;          /* should leave double? */
# Line 522 | Line 516 | rmx_multiply(const RMATRIX *m1, const RMATRIX *m2)
516                  for (k = mres->ncomp; k--; ) {
517                      long double d = 0;
518                      for (h = m1->ncols; h--; )
519 <                        d += rmx_lval(m1,i,h,k) * rmx_lval(m2,h,j,k);
519 >                        d += (long double)rmx_lval(m1,i,h,k) *
520 >                                (long double)rmx_lval(m2,h,j,k);
521                      rmx_lval(mres,i,j,k) = (double)d;
522                  }
523          return(mres);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines