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

Comparing ray/src/cal/rcalc.c (file contents):
Revision 1.29 by greg, Sun May 19 21:15:25 2019 UTC vs.
Revision 1.30 by greg, Tue Dec 10 19:00:26 2019 UTC

# Line 703 | Line 703 | getrec(void)                           /* get next record from file */
703                  eatline = !igneol & (ipb.chr != '\n');
704                  clearrec();             /* start with fresh record */
705                  for (f = inpfmt; f != NULL; f = f->next)
706 <                        if (getfield(f) == -1)
706 >                        if (!getfield(f))
707                                  break;
708                  if (f == NULL) {
709                          advinp();       /* got one! */
# Line 740 | Line 740 | struct field  *f
740                  do {
741                          if (blnkeq && isblnk(*cp)) {
742                                  if (!isblnk(ipb.chr))
743 <                                        return(-1);
743 >                                        return(0);
744                                  do
745                                          cp++;
746                                  while (isblnk(*cp));
# Line 751 | Line 751 | struct field  *f
751                                  cp++;
752                                  scaninp();
753                          } else
754 <                                return(-1);
754 >                                return(0);
755                  } while (*cp);
756 <                return(0);
756 >                break;
757          case T_STR:
758                  if (f->next == NULL || (f->next->type & F_TYP) != T_LIT)
759                          delim = EOF;
# Line 778 | Line 778 | struct field  *f
778                  if (f->f.sv->val == NULL)
779                          f->f.sv->val = savqstr(buf);    /* first setting */
780                  else if (strcmp(f->f.sv->val, buf))
781 <                        return(-1);                     /* doesn't match! */
782 <                return(0);
781 >                        return(0);                      /* doesn't match! */
782 >                break;
783          case T_NUM:
784                  if (f->next == NULL || (f->next->type & F_TYP) != T_LIT)
785                          delim = EOF;
# Line 809 | Line 809 | struct field  *f
809                          varset(f->f.nv, '=', d);        /* first setting */
810                  else if ((d = (varvalue(f->f.nv)-d)/(d==0.?1.:d)) > .001
811                                  || d < -.001)
812 <                        return(-1);                     /* doesn't match! */
813 <                return(0);
812 >                        return(0);                      /* doesn't match! */
813 >                break;
814          }
815 <        return -1; /* pro forma return */
815 >        return(1);      /* success! */
816   }
817  
818  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines