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

Comparing ray/src/hd/sm_sets.c (file contents):
Revision 3.3 by gwlarson, Wed Sep 16 18:16:29 1998 UTC vs.
Revision 3.4 by gwlarson, Wed Nov 11 12:05:41 1998 UTC

# Line 29 | Line 29 | QUADTREE
29   qtnewleaf(oset)                 /* return new leaf node for object set */
30   OBJECT  *oset;
31   {
32 <        register QUADTREE  osi;
32 >  register QUADTREE  osi;
33  
34 <        if (*oset <= 0)
35 <                return(EMPTY);          /* should be error? */
36 <        if (qtfreesets != EMPTY) {
37 <                osi = qtfreesets;
38 <                qtfreesets = (int)qtsettab[osi];
39 <        } else if ((osi = qtnumsets++) % QTSETIBLK == 0) {
40 <                qtsettab = (OBJECT **)realloc((char *)qtsettab,
41 <                                (unsigned)(osi+QTSETIBLK)*sizeof(OBJECT *));
42 <                if (qtsettab == NULL)
43 <                        goto memerr;
44 <        }
45 <        qtsettab[osi] = (OBJECT *)malloc(QTNODESIZ(*oset)*sizeof(OBJECT));
46 <        if (qtsettab[osi] == NULL)
47 <                goto memerr;
48 <        setcopy(qtsettab[osi], oset);
49 <        return(QT_INDEX(osi));
34 >  if (*oset <= 0)
35 >    return(EMPTY);              /* should be error? */
36 >  if (qtfreesets != EMPTY) {
37 >    osi = qtfreesets;
38 >    qtfreesets = (int)qtsettab[osi];
39 >  } else if ((osi = qtnumsets++) % QTSETIBLK == 0) {
40 >    qtsettab = (OBJECT **)realloc((char *)qtsettab,
41 >                                  (unsigned)(osi+QTSETIBLK)*sizeof(OBJECT *));
42 >    if (qtsettab == NULL)
43 >      goto memerr;
44 >  }
45 >  qtsettab[osi] = (OBJECT *)malloc(QTNODESIZ(*oset)*sizeof(OBJECT));
46 >  if (qtsettab[osi] == NULL)
47 >    goto memerr;
48 >  setcopy(qtsettab[osi], oset);
49 >  return(QT_INDEX(osi));
50   memerr:
51 <        error(SYSTEM, "out of memory in qtnewleaf");
51 >  error(SYSTEM, "out of memory in qtnewleaf");
52   }
53  
54  
# Line 195 | Line 195 | register OBJECT  *cs;                   /* cs' = cs +
195      for (i = os[0]; i-- >= 0; )
196         *cs++ = *os++;
197   }
198 +
199 +
200 +
201 +
202 +
203 +
204 +
205 +
206  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines