33 |
|
FILE *fp |
34 |
|
) |
35 |
|
{ |
36 |
< |
while (siz--) |
37 |
< |
putc((int)(i>>(siz<<3) & 0xff), fp); |
36 |
> |
siz <<= 3; |
37 |
> |
while ((siz -= 8) >= 0) |
38 |
> |
putc((int)(i>>siz & 0xff), fp); |
39 |
|
} |
40 |
|
|
41 |
|
|
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); |
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) |