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

Comparing ray/src/common/bsdf_m.c (file contents):
Revision 3.13 by greg, Sun Apr 24 20:16:52 2011 UTC vs.
Revision 3.14 by greg, Mon Apr 25 15:48:05 2011 UTC

# Line 687 | Line 687 | SDqueryMtxProjSA(double *psa, const FVECT v1, const RR
687                  if (out_psa > psa[1])
688                          psa[1] = out_psa;
689                  /* fall through */
690        case SDqueryMin:
690          case SDqueryVal:
691                  if (qflags == SDqueryVal)
692                          psa[0] = M_PI;
693 +                /* fall through */
694 +        case SDqueryMin:
695                  if ((inc_psa > 0) & (inc_psa < psa[0]))
696                          psa[0] = inc_psa;
697                  if ((out_psa > 0) & (out_psa < psa[0]))
# Line 761 | Line 762 | SDgetMtxCDist(const FVECT inVec, SDComponent *sdc)
762                  reverse = 1;
763          }
764          cdlast = NULL;                  /* check for it in cache list */
765 <        for (cd = (SDMatCDst *)sdc->cdList;
766 <                                cd != NULL; cd = (SDMatCDst *)cd->next) {
765 >        for (cd = (SDMatCDst *)sdc->cdList; cd != NULL;
766 >                                cdlast = cd, cd = (SDMatCDst *)cd->next)
767                  if (cd->indx == myCD.indx && (cd->calen == myCD.calen) &
768                                          (cd->ob_priv == myCD.ob_priv) &
769                                          (cd->ob_vec == myCD.ob_vec))
770                          break;
770                cdlast = cd;
771        }
771          if (cd == NULL) {               /* need to allocate new entry */
772                  cd = (SDMatCDst *)malloc(sizeof(SDMatCDst) +
773 <                                        myCD.calen*sizeof(myCD.carr[0]));
773 >                                        sizeof(myCD.carr[0])*myCD.calen);
774                  if (cd == NULL)
775                          return NULL;
776                  *cd = myCD;             /* compute cumulative distribution */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines