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 1.1 by greg, Thu Feb 2 10:34:26 1989 UTC vs.
Revision 1.4 by greg, Thu Jul 19 11:06:37 1990 UTC

# Line 16 | Line 16 | static char SCCSid[] = "$SunId$ LBL";
16   *  1/15/88  Added clock for caching of variable values.
17   *
18   *  11/16/88  Added VARDEF structure for hard linking.
19 + *
20 + *  5/31/90  Added conditional compile (REDEFW) for redefinition warning.
21   */
22  
23   #include  <stdio.h>
# Line 32 | Line 34 | static char SCCSid[] = "$SunId$ LBL";
34  
35   extern char  *ecalloc(), *savestr();
36  
37 < extern double  dvalue();
37 > static double  dvalue();
38  
39   long  eclock = -1;                      /* value storage timer */
40  
# Line 66 | Line 68 | char  *fname;
68          eputs(": cannot open\n");
69          quit(1);
70      }
71 <    initfile(fname, fp);
71 >    initfile(fp, fname, 0);
72      while (nextc != EOF)
73          loaddefn();
74      if (fname != NULL)
# Line 74 | Line 76 | char  *fname;
76   }
77  
78  
79 < scompile(file, str)             /* get definitions from a string */
78 < char  *file;
79 > scompile(str, fn, ln)           /* get definitions from a string */
80   char  *str;
81 + char  *fn;
82 + int  ln;
83   {
84 <    initstr(file, str);
84 >    initstr(str, fn, ln);
85      while (nextc != EOF)
86          loaddefn();
87   }
# Line 370 | Line 373 | loaddefn()                     /* load next definition */
373   #endif
374      {                           /* ordinary definition */
375          ep = getdefn();
376 + #ifdef  REDEFW
377 +        if (dlookup(dname(ep)) != NULL) {
378 +                dclear(dname(ep));
379 +                wputs(dname(ep));
380 +                wputs(": redefined\n");
381 +        }
382 + #else
383          dclear(dname(ep));
384 + #endif
385          dpush(ep);
386      }
387      if (nextc != EOF) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines