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

Comparing ray/src/rt/func.c (file contents):
Revision 2.6 by greg, Tue Mar 3 13:58:12 1992 UTC vs.
Revision 2.11 by greg, Wed Sep 29 10:39:40 1993 UTC

# Line 18 | Line 18 | static char SCCSid[] = "$SunId$ LBL";
18  
19  
20   #define  INITFILE       "rayinit.cal"
21 #define  REFVNAME       "`FILE_REFCNT"
21   #define  CALSUF         ".cal"
22   #define  LCALSUF        4
23 + char  REFVNAME[] = "`FILE_REFCNT";
24  
25   XF  unitxf = {                  /* identity transform */
26 <        1.0, 0.0, 0.0, 0.0,
27 <        0.0, 1.0, 0.0, 0.0,
28 <        0.0, 0.0, 1.0, 0.0,
29 <        0.0, 0.0, 0.0, 1.0,
26 >        {{1.0, 0.0, 0.0, 0.0},
27 >        {0.0, 1.0, 0.0, 0.0},
28 >        {0.0, 0.0, 1.0, 0.0},
29 >        {0.0, 0.0, 0.0, 1.0}},
30          1.0
31   };
32  
# Line 54 | Line 54 | int  dofwd;
54                                          /* check to see if done already */
55          if ((f = (MFUNC *)m->os) != NULL)
56                  return(f);
57 +        fobj = NULL; fray = NULL;
58          if (initfile[0]) {              /* initialize on first call */
59                  setcontext("");
60                  scompile("Dx=$1;Dy=$2;Dz=$3;", NULL, 0);
# Line 68 | Line 69 | int  dofwd;
69                  funset("erf", 1, ':', l_erf);
70                  funset("erfc", 1, ':', l_erfc);
71                  setnoisefuncs();
72 +                setprismfuncs();
73                  loadfunc(initfile);
74                  initfile[0] = '\0';
75          }
# Line 165 | Line 167 | setfunc(m, r)                  /* set channels for function call */
167   OBJREC  *m;
168   register RAY  *r;
169   {
170 <        static long  lastrno = -1;
170 >        static unsigned long  lastrno = ~0;
171          register MFUNC  *f;
172                                          /* get function */
173          if ((f = (MFUNC *)m->os) == NULL)
# Line 211 | Line 213 | l_arg()                                /* return nth real argument */
213          extern double  argument();
214          register int  n;
215  
216 +        if (fobj == NULL)
217 +                syntax("arg(n) used in constant expression");
218 +
219          n = argument(1) + .5;           /* round to integer */
220  
221          if (n < 1)
# Line 248 | Line 253 | register int  n;
253   {
254          double  sum;
255          register RAY  *r;
256 +
257 +        if (fray == NULL)
258 +                syntax("ray parameter used in constant expression");
259  
260          if (--n < 0)
261                  goto badchan;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines