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

Comparing ray/src/common/portio.c (file contents):
Revision 2.8 by schorsch, Thu Jul 17 09:21:29 2003 UTC vs.
Revision 2.12 by greg, Fri Feb 18 16:34:27 2005 UTC

# Line 13 | Line 13 | static const char      RCSid[] = "$Id$";
13  
14   #include "rtio.h"
15  
16 < #ifndef frexp
17 < extern double  frexp();
16 > #include <math.h>
17 >
18 > #ifdef getc_unlocked            /* avoid horrendous overhead of flockfile */
19 > #undef getc
20 > #undef putc
21 > #define getc    getc_unlocked
22 > #define putc    putc_unlocked
23   #endif
19 #ifndef ldexp
20 extern double  ldexp();
21 #endif
24  
25  
26   void
# Line 101 | Line 103 | FILE  *fp;
103          double  d;
104  
105          l = getint(4, fp);
106 +        if (l == 0) {
107 +                getc(fp);               /* exactly zero -- ignore exponent */
108 +                return(0.0);
109 +        }
110          d = (l + (l > 0 ? .5 : -.5)) * (1./0x7fffffff);
111          return(ldexp(d, (int)getint(1, fp)));
112   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines