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

Comparing ray/src/common/caldefn.c (file contents):
Revision 2.17 by schorsch, Thu Jul 3 22:41:44 2003 UTC vs.
Revision 2.19 by schorsch, Mon Jul 21 22:30:17 2003 UTC

# Line 28 | Line 28 | static const char      RCSid[] = "$Id$";
28   #include "copyright.h"
29  
30   #include  <stdio.h>
31
31   #include  <string.h>
33
32   #include  <ctype.h>
33  
34 + #include  "rterror.h"
35   #include  "calcomp.h"
36  
37   #ifndef  NHASH
# Line 43 | Line 42 | static const char      RCSid[] = "$Id$";
42  
43   #define  newnode()      (EPNODE *)ecalloc(1, sizeof(EPNODE))
44  
45 < static double  dvalue();
45 > static double  dvalue(char  *name, EPNODE *d);
46  
47   #define  MAXCLOCK       (1L<<31)        /* clock wrap value */
48  
# Line 350 | Line 349 | dcleanup(              /* clear definitions (0->vars,1->output,2->
349                                  /* if context is global, clear all */
350      for (i = 0; i < NHASH; i++)
351          for (vp = hashtbl[i]; vp != NULL; vp = vp->next)
352 <            if (incontext(vp->name))
352 >            if (incontext(vp->name)) {
353                  if (lvl >= 2)
354                      dremove(vp->name);
355                  else
356                      dclear(vp->name);
357 +            }
358      if (lvl >= 1) {
359          for (ep = outchan; ep != NULL; ep = ep->sibling)
360              epfree(ep);
# Line 572 | Line 572 | getstatement(void)                     /* get next statement */
572      } else {                            /* ordinary definition */
573          ep = getdefn();
574          qname = qualname(dname(ep), 0);
575 <        if (esupport&E_REDEFW && (vdef = varlookup(qname)) != NULL)
575 >        if (esupport&E_REDEFW && (vdef = varlookup(qname)) != NULL) {
576              if (vdef->def != NULL && epcmp(ep, vdef->def)) {
577                  wputs(qname);
578                  if (vdef->def->type == ':')
# Line 583 | Line 583 | getstatement(void)                     /* get next statement */
583                  wputs(qname);
584                  wputs(": definition hides library function\n");
585              }
586 +        }
587          if (ep->type == ':')
588              dremove(qname);
589          else
# Line 689 | Line 690 | getchan(void)                  /* A -> $N = E1 */
690   */
691  
692  
693 < static double
694 < dvalue(                 /* evaluate a variable */
694 < char  *name,
695 < EPNODE  *d
696 < )
693 > static double                   /* evaluate a variable */
694 > dvalue(char  *name, EPNODE      *d)
695   {
696      register EPNODE  *ep1, *ep2;
697      

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines