--- ray/src/common/readoct.c 2023/06/08 17:39:13 2.33 +++ ray/src/common/readoct.c 2025/06/07 05:09:45 2.37 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: readoct.c,v 2.33 2023/06/08 17:39:13 greg Exp $"; +static const char RCSid[] = "$Id: readoct.c,v 2.37 2025/06/07 05:09:45 greg Exp $"; #endif /* * readoct.c - routines to read octree information. @@ -11,7 +11,6 @@ static const char RCSid[] = "$Id: readoct.c,v 2.33 202 #include #include "platform.h" -#include "paths.h" #include "standard.h" #include "octree.h" #include "object.h" @@ -127,9 +126,12 @@ readoct( /* read in octree file or stream */ } } /* close the input */ - if (infn[0] == '!') - pclose(infp); - else if (infp != stdin) + if (inpspec[0] == '!') { + if (pclose(infp) != 0) { + sprintf(errmsg, "bad status from \"%s\"", inpspec); + error(WARNING, errmsg); + } + } else if (infp != stdin) fclose(infp); #ifdef getc_unlocked else @@ -142,8 +144,6 @@ readoct( /* read in octree file or stream */ static char * ogetstr(char *s) /* get null-terminated string */ { - extern char *getstr(); - if (getstr(s, infp) == NULL) octerror(USER, "truncated octree"); return(s); @@ -154,8 +154,8 @@ static OCTREE getfullnode() /* get a set, return fullnode */ { OBJECT set[MAXSET+1]; - register int i; - register long m; + int i; + long m; if ((set[0] = ogetint(objsize)) > MAXSET) octerror(USER, "bad set in getfullnode"); @@ -171,8 +171,7 @@ getfullnode() /* get a set, return fullnode */ static long ogetint(int siz) /* get a siz-byte integer */ { - extern long getint(); - register long r; + long r; r = getint(siz, infp); if (feof(infp)) @@ -184,7 +183,6 @@ ogetint(int siz) /* get a siz-byte integer */ static double ogetflt() /* get a floating point number */ { - extern double getflt(); double r; r = getflt(infp); @@ -197,8 +195,8 @@ ogetflt() /* get a floating point number */ static OCTREE gettree() /* get a pre-ordered octree */ { - register OCTREE ot; - register int i; + OCTREE ot; + int i; switch (getc(infp)) { case OT_EMPTY: @@ -224,7 +222,7 @@ static int nonsurfintree(OCTREE ot) /* check tree for modifiers */ { OBJECT set[MAXSET+1]; - register int i; + int i; if (isempty(ot)) return(0); @@ -245,7 +243,7 @@ nonsurfintree(OCTREE ot) /* check tree for modifiers static void skiptree(void) /* skip octree on input */ { - register int i; + int i; switch (getc(infp)) { case OT_EMPTY: