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 1.7 by greg, Mon Mar 12 10:39:17 1990 UTC vs.
Revision 1.8 by greg, Thu Sep 6 23:32:45 1990 UTC

# Line 39 | Line 39 | char  *ofn[];
39   {
40          char  sbuf[128];
41          int  nf;
42 +        OBJECT  fnobjects;
43          register int  i;
44          
45          if (fname == NULL) {
# Line 80 | Line 81 | char  *ofn[];
81          }
82          if (load & IO_FILES)
83                  ofn[nf] = NULL;
84 +                                        /* get number of objects */
85 +        fnobjects = getint(sizeof(OBJECT));
86  
87          if (load & IO_TREE) {
88                                                  /* get the octree */
# Line 97 | Line 100 | char  *ofn[];
100                  }
101          }
102          fclose(infp);
103 +                                        /* consistency checks */
104 +        if (load & IO_SCENE) {
105 +                                        /* check object count */
106 +                if (nobjects != objorig+fnobjects)
107 +                        octerror(USER, "bad object count -- stale octree?");
108 +                                        /* check for non-surfaces */
109 +                if (nonsurfinset(objorig, fnobjects))
110 +                        octerror(USER, "non-surface in set -- stale octree?");
111 +        }
112          return(nf);
113   }
114  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines