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

Comparing ray/src/common/calexpr.c (file contents):
Revision 2.28 by schorsch, Fri Nov 14 17:22:06 2003 UTC vs.
Revision 2.31 by greg, Wed May 10 15:21:20 2006 UTC

# Line 26 | Line 26 | static const char      RCSid[] = "$Id$";
26   #include  <math.h>
27   #include  <stdlib.h>
28  
29 + #include  "rtmisc.h"
30 + #include  "rtio.h"
31   #include  "rterror.h"
32   #include  "calcomp.h"
33  
# Line 45 | Line 47 | static double  ebotch(EPNODE *);
47   unsigned int  esupport =                /* what to support */
48                  E_VARIABLE | E_FUNCTION ;
49  
50 + int  eofc = 0;                          /* optional end-of-file character */
51   int  nextc;                             /* lookahead character */
52  
53   double  (*eoper[])(EPNODE *) = {        /* expression operations */
# Line 291 | Line 294 | epow(
294      lasterrno = errno;
295      errno = 0;
296      d = pow(evalue(ep1), evalue(ep1->sibling));
297 < #ifdef  IEEE
298 <    if (!finite(d))
299 <        errno = EDOM;
297 > #ifdef  isnan
298 >    if (errno == 0)
299 >        if (isnan(d))
300 >            errno = EDOM;
301 >        else if (isinf(d))
302 >            errno = ERANGE;
303   #endif
304      if (errno == EDOM || errno == ERANGE) {
305          wputs("Illegal power\n");
# Line 411 | Line 417 | scan(void)             /* scan next character, return literal nex
417              nextc = linbuf[linepos++];
418          if (!lnext)
419                  lnext = nextc;
420 +        if (nextc == eofc) {
421 +                nextc = EOF;
422 +                break;
423 +        }
424          if (nextc == '{') {
425              scan();
426              while (nextc != '}')

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines