ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/readoct.c
(Generate patch)

Comparing ray/src/common/readoct.c (file contents):
Revision 2.33 by greg, Thu Jun 8 17:39:13 2023 UTC vs.
Revision 2.37 by greg, Sat Jun 7 05:09:45 2025 UTC

# Line 11 | Line 11 | static const char      RCSid[] = "$Id$";
11   #include  <time.h>
12  
13   #include  "platform.h"
14 #include  "paths.h"
14   #include  "standard.h"
15   #include  "octree.h"
16   #include  "object.h"
# Line 127 | Line 126 | readoct(                               /* read in octree file or stream */
126              }
127          }
128                                  /* close the input */
129 <        if (infn[0] == '!')
130 <                pclose(infp);
131 <        else if (infp != stdin)
129 >        if (inpspec[0] == '!') {
130 >                if (pclose(infp) != 0) {
131 >                        sprintf(errmsg, "bad status from \"%s\"", inpspec);
132 >                        error(WARNING, errmsg);
133 >                }
134 >        } else if (infp != stdin)
135                  fclose(infp);
136   #ifdef getc_unlocked
137          else
# Line 142 | Line 144 | readoct(                               /* read in octree file or stream */
144   static char *
145   ogetstr(char *s)                /* get null-terminated string */
146   {
145        extern char  *getstr();
146
147          if (getstr(s, infp) == NULL)
148                  octerror(USER, "truncated octree");
149          return(s);
# Line 154 | Line 154 | static OCTREE
154   getfullnode()                   /* get a set, return fullnode */
155   {
156          OBJECT  set[MAXSET+1];
157 <        register int  i;
158 <        register long  m;
157 >        int  i;
158 >        long  m;
159  
160          if ((set[0] = ogetint(objsize)) > MAXSET)
161                  octerror(USER, "bad set in getfullnode");
# Line 171 | Line 171 | getfullnode()                  /* get a set, return fullnode */
171   static long
172   ogetint(int siz)                /* get a siz-byte integer */
173   {
174 <        extern long  getint();
175 <        register long  r;
174 >        long  r;
175  
176          r = getint(siz, infp);
177          if (feof(infp))
# Line 184 | Line 183 | ogetint(int siz)               /* get a siz-byte integer */
183   static double
184   ogetflt()                       /* get a floating point number */
185   {
187        extern double  getflt();
186          double  r;
187  
188          r = getflt(infp);
# Line 197 | Line 195 | ogetflt()                      /* get a floating point number */
195   static OCTREE
196   gettree()                       /* get a pre-ordered octree */
197   {
198 <        register OCTREE  ot;
199 <        register int  i;
198 >        OCTREE   ot;
199 >        int  i;
200          
201          switch (getc(infp)) {
202          case OT_EMPTY:
# Line 224 | Line 222 | static int
222   nonsurfintree(OCTREE ot)                /* check tree for modifiers */
223   {
224          OBJECT  set[MAXSET+1];
225 <        register int  i;
225 >        int  i;
226  
227          if (isempty(ot))
228                  return(0);
# Line 245 | Line 243 | nonsurfintree(OCTREE ot)               /* check tree for modifiers
243   static void
244   skiptree(void)                          /* skip octree on input */
245   {
246 <        register int  i;
246 >        int  i;
247          
248          switch (getc(infp)) {
249          case OT_EMPTY:

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines