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.30 by greg, Wed May 20 13:16:20 2015 UTC vs.
Revision 2.35 by greg, Sat Aug 10 00:45:21 2019 UTC

# Line 37 | Line 37 | static double  l_erf(char *), l_erfc(char *), l_arg(ch
37  
38  
39   void
40 < initfunc()      /* initialize function evaluation */
40 > initfunc(void)  /* initialize function evaluation */
41   {
42          if (!rayinitcal[0])     /* already done? */
43                  return;
# Line 72 | Line 72 | set_eparams(char *prms)
72          double          value;
73          char            *cpd;
74                                          /* check if already set */
75 <        if ((prms == NULL) | (prms == last_params))
75 >        if (prms == NULL || !*prms)
76                  return;
77 <        if (last_params != NULL && !strcmp(prms, last_params))
77 >        if (prms == last_params || (last_params != NULL &&
78 >                                        !strcmp(prms, last_params)))
79                  return;
80 <        last_params = prms;             /* assign each variable */
80 >        last_params = prms;             /* XXX assumes static string */
81 >                                        /* assign each variable */
82          while (*prms) {
83                  if (isspace(*prms)) {
84                          ++prms; continue;
# Line 85 | Line 87 | set_eparams(char *prms)
87                          goto bad_params;
88                  cpd = vname;
89                  while (*prms && (*prms != '=') & !isspace(*prms)) {
90 <                        if (!isid(*prms))
90 >                        if (!isid(*prms) | (cpd-vname >= RMAXWORD-1))
91                                  goto bad_params;
92                          *cpd++ = *prms++;
93                  }
92                if (cpd == vname)
93                        goto bad_params;
94                  *cpd = '\0';
95                  while (isspace(*prms)) prms++;
96                  if (*prms++ != '=')
# Line 102 | Line 102 | set_eparams(char *prms)
102                  prms += (*prms == ',') | (*prms == ';');
103                  varset(vname, '=', value);
104          }
105 +        eclock++;               /* notify expression evaluator */
106          return;
107   bad_params:
108          sprintf(errmsg, "bad parameter list '%s'", last_params);
# Line 286 | Line 287 | loadfunc(                      /* load definition file */
287  
288          if ((ffname = getpath(fname, getrlibpath(), R_OK)) == NULL) {
289                  sprintf(errmsg, "cannot find function file \"%s\"", fname);
290 <                error(USER, errmsg);
290 >                error(SYSTEM, errmsg);
291          }
292          fcompile(ffname);
293   }
# Line 298 | Line 299 | l_arg(char *nm)                        /* return nth real argument */
299          int  n;
300  
301          if (fobj == NULL)
302 <                error(USER, "arg(n) called without a context");
302 >                error(INTERNAL, "arg(n) called without a modifier context");
303  
304          n = argument(1) + .5;           /* round to integer */
305  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines