--- ray/src/common/readoct.c 1990/09/06 23:32:45 1.8 +++ ray/src/common/readoct.c 1991/04/18 13:01:28 1.12 @@ -37,7 +37,8 @@ int load; CUBE *scene; char *ofn[]; { - char sbuf[128]; + extern int fputs(); + char sbuf[512]; int nf; OBJECT fnobjects; register int i; @@ -54,13 +55,11 @@ char *ofn[]; } } /* get header */ - if (load & IO_INFO) - copyheader(infp, stdout); - else - getheader(infp, NULL); + if (checkheader(infp, OCTFMT, load&IO_INFO ? stdout : NULL) < 0) + octerror(USER, "not an octree"); /* check format */ if (getint(2) != OCTMAGIC) - octerror(USER, "invalid octree format"); + octerror(USER, "incompatible octree format"); /* get boundaries */ if (load & IO_BOUNDS) { for (i = 0; i < 3; i++) @@ -104,10 +103,10 @@ char *ofn[]; if (load & IO_SCENE) { /* check object count */ if (nobjects != objorig+fnobjects) - octerror(USER, "bad object count -- stale octree?"); + octerror(USER, "bad object count; octree stale?"); /* check for non-surfaces */ if (nonsurfinset(objorig, fnobjects)) - octerror(USER, "non-surface in set -- stale octree?"); + octerror(USER, "non-surface in set; octree stale?"); } return(nf); } @@ -173,7 +172,7 @@ getflt() /* get a floating point number */ double d; d = (double)getint(4)/0x7fffffff; - return(ldexp(d, getint(1))); + return(ldexp(d, (int)getint(1))); }