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.18 by greg, Tue Mar 15 13:57:09 2016 UTC vs.
Revision 2.19 by greg, Thu Aug 18 00:52:48 2016 UTC

# Line 63 | Line 63 | putflt(                                /* put out floating point number */
63  
64   int
65   putbinary(                      /* fwrite() replacement for small objects */
66 <        char *s,
66 >        const void *p,
67          int elsiz,
68          int nel,
69          FILE *fp)
70   {
71 <        int     nbytes = elsiz*nel;
71 >        const char      *s = (const char *)p;
72 >        int             nbytes = elsiz*nel;
73  
74          if (nbytes > 512)
75 <                return(fwrite(s, elsiz, nel, fp));
75 >                return(fwrite(p, elsiz, nel, fp));
76          
77          while (nbytes-- > 0)
78                  putc(*s++, fp);
# Line 142 | Line 143 | getflt(                                /* get a floating point number */
143  
144   int
145   getbinary(                      /* fread() replacement for small objects */
146 <        char *s,
146 >        void *p,
147          int elsiz,
148          int nel,
149          FILE *fp)
150   {
151 +        char    *s = (char *)p;
152          int     nbytes = elsiz*nel;
153          int     c;
154  
155          if (nbytes > 512)
156 <                return(fread(s, elsiz, nel, fp));
156 >                return(fread(p, elsiz, nel, fp));
157          
158          while (nbytes-- > 0) {
159                  if ((c = getc(fp)) == EOF)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines