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.16 by greg, Thu Jun 9 17:09:39 2011 UTC vs.
Revision 3.20 by greg, Sun Aug 21 22:38:12 2011 UTC

# Line 87 | Line 87 | fequal(double a, double b)
87          return (a <= 1e-6) & (a >= -1e-6);
88   }
89  
90 /* Returns the name of the given tag */
91 #ifdef ezxml_name
92 #undef ezxml_name
93 static char *
94 ezxml_name(ezxml_t xml)
95 {
96        if (xml == NULL)
97                return NULL;
98        return xml->name;
99 }
100 #endif
101
90   /* Returns the given tag's character content or empty string if none */
91   #ifdef ezxml_txt
92   #undef ezxml_txt
# Line 190 | Line 178 | fo_getndx(const FVECT v, void *p)
178   {
179          ANGLE_BASIS     *ab = (ANGLE_BASIS *)p;
180          int     li, ndx;
181 <        double  pol, azi, d;
181 >        double  pol, azi;
182  
183          if (v == NULL)
184                  return -1;
# Line 610 | Line 598 | SDloadMtx(SDData *sd, ezxml_t wtl)
598                                  sd->name);
599                  return SDEsupport;
600          }
601 <                                        /* get angle basis */
602 <        rval = load_angle_basis(ezxml_child(ezxml_child(wtl,
603 <                                "DataDefinition"), "AngleBasis"));
604 <        if (rval < 0)
605 <                return convert_errcode(rval);
601 >                                        /* get angle bases */
602 >        for (wld = ezxml_child(ezxml_child(wtl, "DataDefinition"), "AngleBasis");
603 >                                wld != NULL; wld = wld->next) {
604 >                rval = load_angle_basis(wld);
605 >                if (rval < 0)
606 >                        return convert_errcode(rval);
607 >        }
608                                          /* load BSDF components */
609          for (wld = ezxml_child(wtl, "WavelengthData");
610                                  wld != NULL; wld = wld->next) {
# Line 769 | Line 759 | SDgetMtxCDist(const FVECT inVec, SDComponent *sdc)
759          }
760          cdlast = NULL;                  /* check for it in cache list */
761          for (cd = (SDMatCDst *)sdc->cdList; cd != NULL;
762 <                                cdlast = cd, cd = (SDMatCDst *)cd->next)
762 >                                        cdlast = cd, cd = cd->next)
763                  if (cd->indx == myCD.indx && (cd->calen == myCD.calen) &
764                                          (cd->ob_priv == myCD.ob_priv) &
765                                          (cd->ob_vec == myCD.ob_vec))
# Line 788 | Line 778 | SDgetMtxCDist(const FVECT inVec, SDComponent *sdc)
778          }
779          if (cdlast != NULL) {           /* move entry to head of cache list */
780                  cdlast->next = cd->next;
781 <                cd->next = sdc->cdList;
781 >                cd->next = (SDMatCDst *)sdc->cdList;
782                  sdc->cdList = (SDCDst *)cd;
783          }
784          return (SDCDst *)cd;            /* ready to go */
# Line 808 | Line 798 | SDsampMtxCDist(FVECT ioVec, double randX, const SDCDst
798                                          /* binary search to find index */
799          ilower = 0; iupper = mcd->calen;
800          while ((i = (iupper + ilower) >> 1) != ilower)
801 <                if ((long)target >= (long)mcd->carr[i])
801 >                if (target >= mcd->carr[i])
802                          ilower = i;
803                  else
804                          iupper = i;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines