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.32 by greg, Wed Apr 27 21:11:32 2016 UTC vs.
Revision 2.37 by greg, Sat Mar 14 16:25:46 2020 UTC

# Line 67 | Line 67 | initfunc(void) /* initialize function evaluation */
67   void
68   set_eparams(char *prms)
69   {
70 <        static char     *last_params;
71 <        static int      lplen = 0;
72 <        int             len;
70 >        static char     *last_params = NULL;
71          char            vname[RMAXWORD];
72          double          value;
73          char            *cpd;
74                                          /* check if already set */
75          if (prms == NULL || !*prms)
76                  return;
77 <        if (lplen && !strcmp(prms, last_params))
77 >        if (prms == last_params || (last_params != NULL &&
78 >                                        !strcmp(prms, last_params)))
79                  return;
80 <        len = strlen(prms);             /* record new settings */
82 <        if ((lplen != 0) & (lplen <= len)) {
83 <                free(last_params);
84 <                lplen = 0;
85 <        }
86 <        if (!lplen) {
87 <                lplen = len + 100;
88 <                last_params = (char *)malloc(lplen);
89 <                if (last_params == NULL)
90 <                        error(SYSTEM, "out of memory in set_eparams()");
91 <        }
92 <        strcpy(last_params, prms);
80 >        last_params = prms;             /* XXX assumes static string */
81                                          /* assign each variable */
82          while (*prms) {
83                  if (isspace(*prms)) {
# Line 103 | Line 91 | set_eparams(char *prms)
91                                  goto bad_params;
92                          *cpd++ = *prms++;
93                  }
106                if (cpd == vname)
107                        goto bad_params;
94                  *cpd = '\0';
95                  while (isspace(*prms)) prms++;
96                  if (*prms++ != '=')
# Line 113 | Line 99 | set_eparams(char *prms)
99                  if ((prms = fskip(prms)) == NULL)
100                          goto bad_params;
101                  while (isspace(*prms)) prms++;
102 <                prms += (*prms == ',') | (*prms == ';');
102 >                prms += (*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 367 | Line 354 | chanvalue(                     /* return channel n to calcomp */
354                           / funcxf.sca );
355  
356          if (n <= 8) {                   /* intersection point */
357 <                if (fray->rot >= FHUGE)
357 >                if (fray->rot >= FHUGE*.99)
358                          return(0.0);    /* XXX should be runtime error? */
359  
360                  return( fray->rop[0]*funcxf.xfm[0][n-6] +

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines