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.48 by greg, Sun Feb 25 04:41:44 2024 UTC vs.
Revision 2.50 by greg, Tue Feb 27 01:24:10 2024 UTC

# Line 37 | Line 37 | static const char      RCSid[] = "$Id$";
37  
38   #define  envalue(ep)    ((ep)->type==NUM ? (ep)->v.num : evalue(ep))
39  
40 < static double  euminus(EPNODE *), eargument(EPNODE *), enumber(EPNODE *);
40 > static double  euminus(EPNODE *), enumber(EPNODE *);
41   static double  echannel(EPNODE *);
42   static double  eadd(EPNODE *), esubtr(EPNODE *),
43                 emult(EPNODE *), edivi(EPNODE *),
# Line 208 | Line 208 | epfree(                        /* free a parse tree */
208      }
209      if (frep)
210          efree(epar);
211 +    else
212 +        memset(epar, 0, sizeof(EPNODE));
213   }
214  
215  
# Line 266 | Line 268 | epoptimize(                    /* flatten operations, lists -> arrays *
268  
269                                  /* the following used to be a switch */
270   static double
269 eargument(
270    EPNODE      *ep
271 )
272 {
273    return(argument(ep->v.chan));
274 }
275
276 static double
271   enumber(
272      EPNODE      *ep
273   )
# Line 738 | Line 732 | getE3(void)                    /* E3 -> E4 ^ E3 */
732                          ep2 = ep1;
733                  } else if ((ep3->type == NUM && ep3->v.num == 0) |
734                                  (ep1->type == NUM && ep1->v.num == 1)) {
735 <                        epfree(ep2,1);          /* (E4 ^ 0) or (1 ^ E3) */
742 <                        ep2 = newnode();
735 >                        epfree(ep2,0);          /* (E4 ^ 0) or (1 ^ E3) */
736                          ep2->type = NUM;
737                          ep2->v.num = 1;
738                  } else if (ep3->type == NUM && ep3->v.num == 1) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines