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

Comparing ray/src/rt/freeobjmem.c (file contents):
Revision 2.3 by greg, Thu Feb 15 17:28:50 1996 UTC vs.
Revision 2.7 by schorsch, Tue Mar 30 16:13:01 2004 UTC

# Line 1 | Line 1
1 /* Copyright (c) 1992 Regents of the University of California */
2
1   #ifndef lint
2 < static char SCCSid[] = "$SunId$ LBL";
2 > static const char       RCSid[] = "$Id$";
3   #endif
6
4   /*
5   * Free memory associated with object(s)
6 + *
7 + * External symbols declared in ray.h
8   */
9  
10 < #include "standard.h"
11 < #include "object.h"
10 > #include "copyright.h"
11 >
12 > #include "ray.h"
13   #include "otypes.h"
14 + #include "rtotypes.h"
15 + #include "face.h"
16 + #include "cone.h"
17 + #include "instance.h"
18 + #include "data.h"
19 + #include "font.h"
20 + #include "func.h"
21 + #include "mesh.h"
22  
23  
24 < int
25 < free_os(op)                     /* free unneeded memory for object */
26 < register OBJREC *op;
24 > extern int
25 > free_os(                        /* free unneeded memory for object */
26 >        register OBJREC *op
27 > )
28   {
29          if (op->os == NULL)
30                  return(0);
# Line 37 | Line 46 | register OBJREC        *op;
46          case OBJ_INSTANCE:      /* octree instance */
47                  freeinstance(op);
48                  return(1);
49 +        case OBJ_MESH:          /* mesh instance */
50 +                freemeshinst(op);
51 +                return(1);
52          case PAT_BTEXT:         /* monochromatic text */
53          case PAT_CTEXT:         /* colored text */
54          case MIX_TEXT:          /* mixing text */
55                  freetext(op);
56                  return(1);
57          case MAT_CLIP:          /* clipping surface */
58 <                free(op->os);
58 >        case MAT_SPOT:          /* spot light source */
59 >                free((void *)op->os);
60                  op->os = NULL;
61                  return(1);
62 <        case MAT_SPOT:          /* spot light source */
50 <                return(0);
51 <        default:
62 >        }
63   #ifdef DEBUG
64 <                objerror(op, WARNING, "cannot free structure");
64 >        objerror(op, WARNING, "cannot free structure");
65   #endif
66 <                return(0);
56 <        }
66 >        return(0);
67   }
68  
69  
70 < int
71 < free_objs(on, no)               /* free some object structures */
72 < register OBJECT on;
73 < OBJECT  no;
70 > extern int
71 > free_objs(              /* free some object structures */
72 >        register OBJECT on,
73 >        OBJECT  no
74 > )
75   {
76          int     nfreed;
77          register OBJREC *op;
# Line 74 | Line 85 | OBJECT no;
85   }
86  
87  
88 < free_objmem()                   /* free all object cache memory */
88 > extern void
89 > free_objmem(void)                       /* free all object cache memory */
90   {
91          free_objs(0, nobjects);
92          freedata(NULL);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines