ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/free_os.c
Revision: 3.4
Committed: Thu Jul 17 09:21:29 2003 UTC (20 years, 9 months ago) by schorsch
Content type: text/plain
Branch: MAIN
CVS Tags: rad3R7P2, rad3R7P1, rad4R1, rad4R0, rad3R6, rad3R6P1, rad3R8, rad3R9
Changes since 3.3: +2 -1 lines
Log Message:
Added prototypes and includes from patch by Randolph Fritz.
Added more required includes and reduced other compile warnings.

File Contents

# Content
1 #ifndef lint
2 static const char RCSid[] = "$Id: free_os.c,v 3.3 2003/07/10 03:47:00 greg 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(op) /* free unneeded memory for object */
24 register OBJREC *op;
25 {
26 if (op->os == NULL)
27 return(0);
28 switch (op->otype) {
29 case OBJ_FACE: /* polygon */
30 freeface(op);
31 return(1);
32 case OBJ_CONE: /* cone */
33 case OBJ_RING: /* disk */
34 case OBJ_CYLINDER: /* cylinder */
35 case OBJ_CUP: /* inverted cone */
36 case OBJ_TUBE: /* inverted cylinder */
37 freecone(op);
38 return(1);
39 case OBJ_INSTANCE: /* octree instance */
40 freeinstance(op);
41 return(1);
42 case OBJ_MESH: /* mesh instance */
43 freemeshinst(op);
44 return(1);
45 }
46 /* don't really know */
47 free((void *)op->os);
48 op->os = NULL;
49 return(1);
50 }