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

Comparing ray/src/common/calexpr.c (file contents):
Revision 2.44 by greg, Sat Feb 24 19:00:23 2024 UTC vs.
Revision 2.45 by greg, Sat Feb 24 19:11:45 2024 UTC

# Line 211 | Line 211 | epfree(                        /* free a parse tree */
211   }
212  
213  
214 < void
214 > static void
215   epflatten(                      /* flatten hierarchies for '+', '*' */
216          EPNODE *epar
217   )
218   {
219      EPNODE      *ep;
220  
221 <    if (epar->nkids < 0)        /* don't really handle this properly */
221 >    if (epar->nkids < 0)        /* we don't really handle this properly */
222          epar->nkids *= -1;
223  
224      for (ep = epar->v.kid; ep != NULL; ep = ep->sibling)
# Line 242 | Line 242 | epoptimize(                    /* flatten operations and lists -> array
242   {
243      EPNODE      *ep;
244  
245 <   if ((epar->type == '+') | (epar->type == '*'))
245 >    if ((epar->type == '+') | (epar->type == '*'))
246          epflatten(epar);        /* commutative & associative */
247  
248 <   if (epar->nkids)             /* do children if any */
248 >    if (epar->nkids)            /* do children if any */
249          for (ep = epar->v.kid; ep != NULL; ep = ep->sibling)
250              epoptimize(ep);
251  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines