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.70 by greg, Tue Dec 5 01:06:10 2023 UTC vs.
Revision 2.72 by greg, Tue Dec 5 21:45:39 2023 UTC

# Line 374 | Line 374 | rmx_load(const char *inspec, RMPref rmp)
374                  fp = stdin;
375          else if (inspec[0] == '!')
376                  fp = popen(inspec+1, "r");
377 <        else if (rmp != RMPnone) {
377 >        else {
378                  const char      *sp = inspec;   /* check suffix */
379                  while (*sp)
380                          ++sp;
381                  while (sp > inspec && sp[-1] != '.')
382                          --sp;
383                  if (!strcasecmp(sp, "XML")) {   /* assume it's a BSDF */
384 <                        CMATRIX *cm = rmp==RMPtrans ? cm_loadBTDF(inspec) :
384 >                        CMATRIX *cm = rmp==RMPnone ? (CMATRIX *)NULL :
385 >                                        rmp==RMPtrans ? cm_loadBTDF(inspec) :
386                                          cm_loadBRDF(inspec, rmp==RMPreflB) ;
387                          if (!cm)
388                                  return(NULL);
# Line 449 | Line 450 | rmx_write_ascii(const double *dp, int nc, int len, FIL
450   {
451          while (len-- > 0) {
452                  int     k = nc;
453 <                while (nc-- > 0)
453 >                while (k-- > 0)
454                          fprintf(fp, " %.7e", *dp++);
455                  fputc('\t', fp);
456          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines