Revision: 54569
          http://brlcad.svn.sourceforge.net/brlcad/?rev=54569&view=rev
Author:   brlcad
Date:     2013-03-08 15:44:07 +0000 (Fri, 08 Mar 2013)
Log Message:
-----------
remove the bu_pool hooks now in dead #if 0 sections.  also simplify 
NMG_FREESTRUCT() .. BU_PUT() already zero's the data and pointer.

Modified Paths:
--------------
    brlcad/trunk/include/nmg.h

Modified: brlcad/trunk/include/nmg.h
===================================================================
--- brlcad/trunk/include/nmg.h  2013-03-08 15:38:35 UTC (rev 54568)
+++ brlcad/trunk/include/nmg.h  2013-03-08 15:44:07 UTC (rev 54569)
@@ -547,17 +547,9 @@
  * storage de-allocation support
  * OBSOLETE
  */
-#define NMG_FREESTRUCT(ptr, str) { \
-    BU_PUT(ptr, struct str); \
-    (ptr) = NULL; \
-}
-#if 0
-    memset((char *)(ptr), 0, sizeof(struct str)); \
-    BU_PUT((ptr), struct str); \
+#define NMG_FREESTRUCT(ptr, str) BU_PUT(ptr, struct str)
 
-#endif
 
-
 /*
  * Macros to create and destroy storage for the NMG data structures.
  * Since nmg_mk.c and g_nmg.c are the only source file which should
@@ -568,29 +560,8 @@
 #define NMG_INCR_INDEX(_p, _m) \
        NMG_CK_MODEL(_m); (_p)->index = ((_m)->maxindex)++
 
-#if 0
-#define GET_REGION(p, m)            {p = (struct nmgregion 
*)bu_pool_get(sizeof(struct nmgregion)); NMG_INCR_INDEX(p, m);}
-#define GET_REGION_A(p, m)          {p = (struct nmgregion_a 
*)bu_pool_get(sizeof(struct nmgregion_a)); NMG_INCR_INDEX(p, m);}
-#define GET_SHELL(p, m)             {p = (struct shell 
*)bu_pool_get(sizeof(struct shell)); NMG_INCR_INDEX(p, m);}
-#define GET_SHELL_A(p, m)           {p = (struct shell_a 
*)bu_pool_get(sizeof(struct shell_a)); NMG_INCR_INDEX(p, m);}
-#define GET_FACE(p, m)              {p = (struct face 
*)bu_pool_get(sizeof(struct face)); NMG_INCR_INDEX(p, m);}
-#define GET_FACE_G_PLANE(p, m)      {p = (struct face_g_plane 
*)bu_pool_get(sizeof(struct face_g_plane)); NMG_INCR_INDEX(p, m);}
-#define GET_FACE_G_SNURB(p, m)      {p = (struct face_g_snurb 
*)bu_pool_get(sizeof(struct face_g_snurb)); NMG_INCR_INDEX(p, m);}
-#define GET_FACEUSE(p, m)           {p = (struct faceuse 
*)bu_pool_get(sizeof(struct faceuse)); NMG_INCR_INDEX(p, m);}
-#define GET_LOOP(p, m)              {p = (struct loop 
*)bu_pool_get(sizeof(struct loop)); NMG_INCR_INDEX(p, m);}
-#define GET_LOOP_G(p, m)            {p = (struct loop_g 
*)bu_pool_get(sizeof(struct loop_g)); NMG_INCR_INDEX(p, m);}
-#define GET_LOOPUSE(p, m)           {p = (struct loopuse 
*)bu_pool_get(sizeof(struct loopuse)); NMG_INCR_INDEX(p, m);}
-#define GET_EDGE(p, m)              {p = (struct edge 
*)bu_pool_get(sizeof(struct edge)); NMG_INCR_INDEX(p, m);}
-#define GET_EDGE_G_LSEG(p, m)       {p = (struct edge_g_lseg 
*)bu_pool_get(sizeof(struct edge_g_lseg)); NMG_INCR_INDEX(p, m);}
-#define GET_EDGE_G_CNURB(p, m)      {p = (struct edge_g_cnurb 
*)bu_pool_get(sizeof(struct edge_g_cnurb)); NMG_INCR_INDEX(p, m);}
-#define GET_EDGEUSE(p, m)           {p = (struct edgeuse 
*)bu_pool_get(sizeof(struct edgeuse)); NMG_INCR_INDEX(p, m);}
-#define GET_VERTEX(p, m)            {p = (struct vertex 
*)bu_pool_get(sizeof(struct vertex)); NMG_INCR_INDEX(p, m);}
-#define GET_VERTEX_G(p, m)          {p = (struct vertex_g 
*)bu_pool_get(sizeof(struct vertex_g)); NMG_INCR_INDEX(p, m);}
-#define GET_VERTEXUSE(p, m)         {p = (struct vertexuse 
*)bu_pool_get(sizeof(struct vertexuse)); NMG_INCR_INDEX(p, m);}
-#define GET_VERTEXUSE_A_PLANE(p, m) {p = (struct vertexuse_a_plane 
*)bu_pool_get(sizeof(struct vertexuse_a_plane)); NMG_INCR_INDEX(p, m);}
-#define GET_VERTEXUSE_A_CNURB(p, m) {p = (struct vertexuse_a_cnurb 
*)bu_pool_get(sizeof(struct vertexuse_a_cnurb)); NMG_INCR_INDEX(p, m);}
-#else
-/* there was no get model */
+
+#define GET_MODEL(p, m)             {NMG_GETSTRUCT(p, model); 
NMG_INCR_INDEX(p, m);}
 #define GET_REGION(p, m)            {NMG_GETSTRUCT(p, nmgregion); 
NMG_INCR_INDEX(p, m);}
 #define GET_REGION_A(p, m)          {NMG_GETSTRUCT(p, nmgregion_a); 
NMG_INCR_INDEX(p, m);}
 #define GET_SHELL(p, m)             {NMG_GETSTRUCT(p, shell); 
NMG_INCR_INDEX(p, m);}
@@ -602,7 +573,7 @@
 #define GET_LOOP(p, m)              {NMG_GETSTRUCT(p, loop); NMG_INCR_INDEX(p, 
m);}
 #define GET_LOOP_G(p, m)            {NMG_GETSTRUCT(p, loop_g); 
NMG_INCR_INDEX(p, m);}
 #define GET_LOOPUSE(p, m)           {NMG_GETSTRUCT(p, loopuse); 
NMG_INCR_INDEX(p, m);}
-/* there was no get loopuse_a */
+#define GET_LOOPUSE_A(p, m)         {NMG_GETSTRUCT(p, loopuse_a); 
NMG_INCR_INDEX(p, m);}
 #define GET_EDGE(p, m)              {NMG_GETSTRUCT(p, edge); NMG_INCR_INDEX(p, 
m);}
 #define GET_EDGE_G_LSEG(p, m)       {NMG_GETSTRUCT(p, edge_g_lseg); 
NMG_INCR_INDEX(p, m);}
 #define GET_EDGE_G_CNURB(p, m)      {NMG_GETSTRUCT(p, edge_g_cnurb); 
NMG_INCR_INDEX(p, m);}
@@ -612,33 +583,9 @@
 #define GET_VERTEXUSE(p, m)         {NMG_GETSTRUCT(p, vertexuse); 
NMG_INCR_INDEX(p, m);}
 #define GET_VERTEXUSE_A_PLANE(p, m) {NMG_GETSTRUCT(p, vertexuse_a_plane); 
NMG_INCR_INDEX(p, m);}
 #define GET_VERTEXUSE_A_CNURB(p, m) {NMG_GETSTRUCT(p, vertexuse_a_cnurb); 
NMG_INCR_INDEX(p, m);}
-#endif
 
-#if 0
+
 #define FREE_MODEL(p)             NMG_FREESTRUCT(p, model)
-#define FREE_REGION(p)            {bu_pool_put((void *)p, sizeof(struct 
nmgregion));}
-#define FREE_REGION_A(p)          {bu_pool_put((void *)p, sizeof(struct 
nmgregion_a));}
-#define FREE_SHELL(p)             {bu_pool_put((void *)p, sizeof(struct 
shell));}
-#define FREE_SHELL_A(p)           {bu_pool_put((void *)p, sizeof(struct 
shell_a));}
-#define FREE_FACE(p)              {bu_pool_put((void *)p, sizeof(struct 
face));}
-#define FREE_FACE_G_PLANE(p)      {bu_pool_put((void *)p, sizeof(struct 
face_g_plane));}
-#define FREE_FACE_G_SNURB(p)      {bu_pool_put((void *)p, sizeof(struct 
face_g_snurb));}
-#define FREE_FACEUSE(p)           {bu_pool_put((void *)p, sizeof(struct 
faceuse));}
-#define FREE_LOOP(p)              {bu_pool_put((void *)p, sizeof(struct 
loop));}
-#define FREE_LOOP_G(p)            {bu_pool_put((void *)p, sizeof(struct 
loop_g));}
-#define FREE_LOOPUSE(p)           {bu_pool_put((void *)p, sizeof(struct 
loopuse));}
-#define FREE_LOOPUSE_A(p)         NMG_FREESTRUCT(p, loopuse_a)
-#define FREE_EDGE(p)              {bu_pool_put((void *)p, sizeof(struct 
edge));}
-#define FREE_EDGE_G_LSEG(p)       {bu_pool_put((void *)p, sizeof(struct 
edge_g_lseg));}
-#define FREE_EDGE_G_CNURB(p)      {bu_pool_put((void *)p, sizeof(struct 
edge_g_cnurb));}
-#define FREE_EDGEUSE(p)           {bu_pool_put((void *)p, sizeof(struct 
edgeuse));}
-#define FREE_VERTEX(p)            {bu_pool_put((void *)p, sizeof(struct 
vertex));}
-#define FREE_VERTEX_G(p)          {bu_pool_put((void *)p, sizeof(struct 
vertex_g));}
-#define FREE_VERTEXUSE(p)         {bu_pool_put((void *)p, sizeof(struct 
vertexuse));}
-#define FREE_VERTEXUSE_A_PLANE(p) {bu_pool_put((void *)p, sizeof(struct 
vertexuse_a_plane));}
-#define FREE_VERTEXUSE_A_CNURB(p) {bu_pool_put((void *)p, sizeof(struct 
vertexuse_a_cnurb));}
-#else
-#define FREE_MODEL(p)             NMG_FREESTRUCT(p, model)
 #define FREE_REGION(p)            NMG_FREESTRUCT(p, nmgregion)
 #define FREE_REGION_A(p)          NMG_FREESTRUCT(p, nmgregion_a)
 #define FREE_SHELL(p)             NMG_FREESTRUCT(p, shell)
@@ -660,8 +607,8 @@
 #define FREE_VERTEXUSE(p)         NMG_FREESTRUCT(p, vertexuse)
 #define FREE_VERTEXUSE_A_PLANE(p) NMG_FREESTRUCT(p, vertexuse_a_plane)
 #define FREE_VERTEXUSE_A_CNURB(p) NMG_FREESTRUCT(p, vertexuse_a_cnurb)
-#endif
 
+
 /**
  * Do two edgeuses share the same two vertices? If yes, eu's should be
  * joined.

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester  
Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the  
endpoint security space. For insight on selecting the right partner to 
tackle endpoint security challenges, access the full report. 
http://p.sf.net/sfu/symantec-dev2dev
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to