ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/free_os.c
Revision: 3.5
Committed: Fri Nov 8 17:11:42 2013 UTC (10 years, 5 months ago) by greg
Content type: text/plain
Branch: MAIN
CVS Tags: rad5R4, rad5R2, rad4R2P2, rad5R0, rad5R1, rad4R2, rad4R2P1, rad5R3, HEAD
Changes since 3.4: +4 -3 lines
Log Message:
Minor changes not affecting operation

File Contents

# Content
1 #ifndef lint
2 static const char RCSid[] = "$Id: free_os.c,v 3.4 2003/07/17 09:21:29 schorsch Exp $";
3 #endif
4 /*
5 * Free memory associated with object(s)
6 *
7 * External symbols declared in object.h
8 */
9
10 #include "copyright.h"
11
12 #include "standard.h"
13 #include "octree.h"
14 #include "object.h"
15 #include "otypes.h"
16 #include "face.h"
17 #include "cone.h"
18 #include "instance.h"
19 #include "mesh.h"
20
21
22 int
23 free_os( /* free unneeded memory for object */
24 OBJREC *op
25 )
26 {
27 if (op->os == NULL)
28 return(0);
29 switch (op->otype) {
30 case OBJ_FACE: /* polygon */
31 freeface(op);
32 return(1);
33 case OBJ_CONE: /* cone */
34 case OBJ_RING: /* disk */
35 case OBJ_CYLINDER: /* cylinder */
36 case OBJ_CUP: /* inverted cone */
37 case OBJ_TUBE: /* inverted cylinder */
38 freecone(op);
39 return(1);
40 case OBJ_INSTANCE: /* octree instance */
41 freeinstance(op);
42 return(1);
43 case OBJ_MESH: /* mesh instance */
44 freemeshinst(op);
45 return(1);
46 }
47 /* don't really know */
48 free((void *)op->os);
49 op->os = NULL;
50 return(1);
51 }