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

Comparing ray/src/util/rcomb.c (file contents):
Revision 2.3 by greg, Tue Dec 19 00:39:03 2023 UTC vs.
Revision 2.6 by greg, Fri Feb 9 19:58:56 2024 UTC

# Line 284 | Line 284 | checksymbolic(ROPMAT *rop)
284          memcpy(rop->rmp->wlpart, WLPART, sizeof(rop->rmp->wlpart));
285          rop->rmp->ncomp = rop->preop.clen / nc;
286                                          /* decide on output type */
287 <        if (!strcmp(rop->preop.csym, "XYZ")) {
287 >        if (!strcasecmp(rop->preop.csym, "XYZ")) {
288                  if (dt <= DTspec)
289                          rop->rmp->dtype = DTxyze;
290 <        } else if (!strcmp(rop->preop.csym, "RGB")) {
290 >        } else if (!strcasecmp(rop->preop.csym, "RGB")) {
291                  if (dt <= DTspec)
292                          rop->rmp->dtype = DTrgbe;
293          } else if (rop->rmp->dtype == DTspec)
# Line 592 | Line 592 | combine_input(ROPMAT *res, FILE *fout)
592              RMATRIX     *mres = NULL;
593              for (i = 0; i < nmats; i++) {
594                  if (!rmx_load_row(mop[i].imx.mtx, &mop[i].imx, mop[i].infp)) {
595 <                        if (in_nrows <= 0)      /* normal end? */
595 >                        if (cur_row > in_nrows) /* unknown #input rows? */
596                                  goto loop_exit;
597                          fprintf(stderr, "%s: read error at row %d\n",
598                                          mop[i].inspec, cur_row);
# Line 680 | Line 680 | resize_inparr(int n2alloc)
680   {
681          int     i;
682  
683 <        for (i = nmats; i > n2alloc; i--) {
683 >        if (n2alloc == nall)
684 >                return;
685 >        for (i = nall; i > n2alloc; i--) {
686                  rmx_reset(&mop[i].imx);
687                  if (mop[i].rmp != &mop[i].imx)
688                          rmx_free(mop[i].rmp);
# Line 690 | Line 692 | resize_inparr(int n2alloc)
692                  fputs("Out of memory in resize_inparr()\n", stderr);
693                  exit(1);
694          }
695 <        if (n2alloc > nmats)
696 <                memset(mop+nmats, 0, (n2alloc-nmats)*sizeof(ROPMAT));
695 >        if (n2alloc > nall)
696 >                memset(mop+nall, 0, (n2alloc-nall)*sizeof(ROPMAT));
697          nall = n2alloc;
698   }
699  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines