--- ray/src/common/portio.c 1992/07/13 15:36:01 2.1 +++ ray/src/common/portio.c 1996/11/15 16:17:05 2.4 @@ -10,7 +10,14 @@ static char SCCSid[] = "$SunId$ LBL"; #include +#ifndef frexp +extern double frexp(); +#endif +#ifndef ldexp +extern double ldexp(); +#endif + putstr(s, fp) /* write null-terminated string to fp */ register char *s; register FILE *fp; @@ -27,14 +34,14 @@ register int siz; register FILE *fp; { while (siz--) - putc(i>>(siz<<3) & 0xff, fp); + putc((int)(i>>(siz<<3) & 0xff), fp); } putflt(f, fp) /* put out floating point number */ -double f; +double f; +FILE *fp; { - extern double frexp(); int e; putint((long)(frexp(f,&e)*0x7fffffff), 4, fp); @@ -84,9 +91,8 @@ double getflt(fp) /* get a floating point number */ FILE *fp; { - extern double ldexp(); - double d; + double d; - d = (double)getint(4, fp)/0x7fffffff; + d = (getint(4, fp) + .5) / 0x7fffffff; return(ldexp(d, (int)getint(1, fp))); }