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 1.2 by greg, Mon Apr 10 22:06:37 1989 UTC vs.
Revision 1.3 by greg, Wed Jun 14 22:29:01 1989 UTC

# Line 517 | Line 517 | EPNODE *
517   getE4()                         /* E4 -> ADDOP E5 */
518                                  /*       E5 */
519   {
520 <    register EPNODE  *ep1;
520 >    register EPNODE  *ep1, *ep2;
521  
522      if (nextc == '-') {
523          scan();
524 <        ep1 = newnode();
525 < #ifndef  RCONST
526 <        if (isdecimal(nextc)) {
527 <            ep1->type = NUM;
528 <            ep1->v.num = -getnum();
529 <            return(ep1);
524 >        ep2 = getE5();
525 >        if (ep2->type == NUM) {
526 >                ep2->v.num = -ep2->v.num;
527 >                return(ep2);
528          }
529 < #endif
529 >        ep1 = newnode();
530          ep1->type = UMINUS;
531 <        addekid(ep1, getE5());
534 < #ifdef  RCONST
535 <        if (ep1->v.kid->type == NUM)
536 <                ep1 = rconst(ep1);
537 < #endif
531 >        addekid(ep1, ep2);
532          return(ep1);
533      }
534      if (nextc == '+')

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines