37 |
|
|
38 |
|
|
39 |
|
void |
40 |
< |
initfunc() /* initialize function evaluation */ |
40 |
> |
initfunc(void) /* initialize function evaluation */ |
41 |
|
{ |
42 |
|
if (!rayinitcal[0]) /* already done? */ |
43 |
|
return; |
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; |
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++ != '=') |
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); |
299 |
|
int n; |
300 |
|
|
301 |
|
if (fobj == NULL) |
302 |
< |
error(INTERNAL, "arg(n) called without a modifier context"); |
302 |
> |
error(USER, |
303 |
> |
"bad call to arg(n) - illegal constant in .cal file?"); |
304 |
|
|
305 |
|
n = argument(1) + .5; /* round to integer */ |
306 |
|
|
355 |
|
/ funcxf.sca ); |
356 |
|
|
357 |
|
if (n <= 8) { /* intersection point */ |
358 |
< |
if (fray->rot >= FHUGE) |
358 |
> |
if (fray->rot >= FHUGE*.99) |
359 |
|
return(0.0); /* XXX should be runtime error? */ |
360 |
|
|
361 |
|
return( fray->rop[0]*funcxf.xfm[0][n-6] + |