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.21 by greg, Fri Jul 5 03:04:22 2019 UTC vs.
Revision 2.22 by greg, Mon Jul 15 21:27:25 2019 UTC

# Line 34 | Line 34 | putint(                                /* write a siz-byte integer to fp */
34   )
35   {
36          siz <<= 3;
37 <        while ((siz -= 8) >= 0)
37 >        while ((siz -= 8) > 0)
38                  putc((int)(i>>siz & 0xff), fp);
39 +        putc((int)(i & 0xff), fp);
40   }
41  
42  
# Line 57 | Line 58 | putflt(                                /* put out floating point number */
58                  e = 0;
59          }
60          putint(m, 4, fp);
61 <        putint((long)e, 1, fp);
61 >        putint(e, 1, fp);
62   }
63  
64  
# Line 71 | Line 72 | putbinary(                     /* fwrite() replacement for small objects
72          const char      *s = (const char *)p;
73          int             nbytes = elsiz*nel;
74  
75 <        if (nbytes > 256)
75 >        if (nbytes > 128)
76                  return(fwrite(p, elsiz, nel, fp));
77          
78          while (nbytes-- > 0)
# Line 153 | Line 154 | getbinary(                     /* fread() replacement for small objects
154          int     nbytes = elsiz*nel;
155          int     c;
156  
157 <        if (nbytes > 256)
157 >        if (nbytes > 128)
158                  return(fread(p, elsiz, nel, fp));
159          
160          while (nbytes-- > 0) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines