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

Comparing ray/src/common/bsdf_t.c (file contents):
Revision 3.10 by greg, Thu Apr 28 04:05:11 2011 UTC vs.
Revision 3.11 by greg, Thu Apr 28 17:46:25 2011 UTC

# Line 505 | Line 505 | sscmp(const void *p1, const void *p2)
505          if (h1 < h2)
506                  return -1;
507          return 0;
508 /*
509        return (int)((*(const struct outdir_s *)p1).hent -
510                        (*(const struct outdir_s *)p2).hent);
511 */
508   }
509  
510   /* Create a new cumulative distribution for the given input direction */
# Line 730 | Line 726 | count_values(char *cp)
726          int     n = 0;
727  
728          while (next_token(&cp) != '}' && *cp) {
729 <                if (*cp == '{')
730 <                        return -1;
731 <                while (*cp && (*cp != ',') & (*cp != '}') & !isspace(*cp))
736 <                        ++cp;
729 >                while (!isspace(*cp) & (*cp != ',') & (*cp != '}'))
730 >                        if (!*++cp)
731 >                                break;
732                  ++n;
733                  eat_token(&cp, ',');
734          }
# Line 778 | Line 773 | load_tree_data(char **spp, int nd)
773          } else {                        /* else load value grid */
774                  int     bsiz;
775                  n = count_values(*spp); /* see how big the grid is */
781                if (n <= 0) {
782                        strcpy(SDerrorDetail, "Bad tensor tree data");
783                        return NULL;
784                }
776                  for (bsiz = 0; bsiz < 8*sizeof(size_t)-1; bsiz += nd)
777                          if (1<<bsiz == n)
778                                  break;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines