Revision: 41073
http://brlcad.svn.sourceforge.net/brlcad/?rev=41073&view=rev
Author: brlcad
Date: 2010-10-19 03:51:20 +0000 (Tue, 19 Oct 2010)
Log Message:
-----------
remove bu_ptbl() since it conflicts with 'struct bu_ptbl' causing a compilation
shadow warning on its constructor for c++ codes. the interface is actually
duplicitous so code can be trivially updated to the various equivalent
bu_ptbl_*() calls that it was wrapping.
Modified Paths:
--------------
brlcad/trunk/include/bu.h
brlcad/trunk/src/conv/jack/g-jack.c
brlcad/trunk/src/conv/off/g-off.c
brlcad/trunk/src/conv/patch/patch-g.c
brlcad/trunk/src/libbu/ptbl.c
brlcad/trunk/src/libged/inside.c
brlcad/trunk/src/libged/wdb_obj.c
brlcad/trunk/src/libged/xpush.c
brlcad/trunk/src/librt/primitives/nmg/nmg_inter.c
brlcad/trunk/src/util/fix_polysolids.c
Modified: brlcad/trunk/include/bu.h
===================================================================
--- brlcad/trunk/include/bu.h 2010-10-19 03:43:52 UTC (rev 41072)
+++ brlcad/trunk/include/bu.h 2010-10-19 03:51:20 UTC (rev 41073)
@@ -1394,15 +1394,6 @@
};
#define BU_CK_PTBL(_p) BU_CKMAG(_p, BU_PTBL_MAGIC, "bu_ptbl")
-#define BU_PTBL_INIT 0 /**< @brief initialize table pointer struct &
get storage */
-#define BU_PTBL_INS 1 /**< @brief insert an item (long *) into a
table */
-#define BU_PTBL_LOC 2 /**< @brief locate a (long *) in an existing
table */
-#define BU_PTBL_FREE 3 /**< @brief deallocate buffer associated with a
table */
-#define BU_PTBL_RST 4 /**< @brief empty a table, but keep storage on
hand */
-#define BU_PTBL_CAT 5 /**< @brief catenate one table onto another */
-#define BU_PTBL_RM 6 /**< @brief remove all occurrences of an item
from a table */
-#define BU_PTBL_INS_UNIQUE 7 /**< @brief insert item into table, if not
present */
-#define BU_PTBL_ZERO 8 /**< @brief replace all occurrences of an item
by 0 */
/*
* For those routines that have to "peek" into the ptbl a little bit.
*/
@@ -4028,16 +4019,6 @@
(struct bu_ptbl *b));
/**
- * B U _ P T B L
- *
- * This version maintained for source compatibility with existing NMG
- * code.
- */
-BU_EXPORT BU_EXTERN(int bu_ptbl,
- (struct bu_ptbl *b,
- int func, long *p));
-
-/**
* B U _ P R _ P T B L
*
* Print a bu_ptbl array for inspection.
Modified: brlcad/trunk/src/conv/jack/g-jack.c
===================================================================
--- brlcad/trunk/src/conv/jack/g-jack.c 2010-10-19 03:43:52 UTC (rev 41072)
+++ brlcad/trunk/src/conv/jack/g-jack.c 2010-10-19 03:51:20 UTC (rev 41073)
@@ -465,7 +465,7 @@
jack_faces(r, fp_psurf, map);
- bu_ptbl( &vtab, BU_PTBL_FREE, 0 );
+ bu_ptbl_free(&vtab);
bu_free( (char *)map, "Jack vert map" );
}
Modified: brlcad/trunk/src/conv/off/g-off.c
===================================================================
--- brlcad/trunk/src/conv/off/g-off.c 2010-10-19 03:43:52 UTC (rev 41072)
+++ brlcad/trunk/src/conv/off/g-off.c 2010-10-19 03:51:20 UTC (rev 41073)
@@ -414,7 +414,7 @@
jack_faces(r, fp_psurf, map);
- bu_ptbl( &vtab, BU_PTBL_FREE, 0 );
+ bu_ptbl_free(&vtab);
bu_free( (char *)map, "Jack vert map" );
}
Modified: brlcad/trunk/src/conv/patch/patch-g.c
===================================================================
--- brlcad/trunk/src/conv/patch/patch-g.c 2010-10-19 03:43:52 UTC (rev
41072)
+++ brlcad/trunk/src/conv/patch/patch-g.c 2010-10-19 03:51:20 UTC (rev
41073)
@@ -1010,7 +1010,7 @@
os = s;
/* initialize the list of faces, for later use by nmg_gluefaces */
- bu_ptbl(&faces, BU_PTBL_INIT, NULL);
+ bu_ptbl_init(&faces, 64, "faces");
/* make an array of patch_faces to hold faceuses and the desired
* thickness of each face.
@@ -1104,7 +1104,7 @@
bu_log("\tMade faceuse 0x%p\n", fu);
/* add it to the list */
- bu_ptbl(&faces, BU_PTBL_INS, (long *)fu);
+ bu_ptbl_ins(&faces, (long *)fu);
/* remember this face and its thickness */
p_faces[face_count].fu = fu;
@@ -1174,7 +1174,7 @@
nmg_close_shell(s, tol);
/* free the memory for the face list */
- bu_ptbl(&faces, BU_PTBL_FREE, NULL);
+ bu_ptbl_free(&faces);
/* don't need the p_faces array any more */
bu_free((char *)p_faces, "build_solid: p_faces");
@@ -1249,7 +1249,7 @@
NMG_CK_FACEUSE(fu);
/* free the memory for the face list */
- bu_ptbl(&faces, BU_PTBL_RST, NULL);
+ bu_ptbl_reset(&faces);
/* Create a flags array for the model to make sure each face gets
* its orientation set.
@@ -1374,10 +1374,10 @@
/* glue all the faces of the new shell together */
for (BU_LIST_FOR (fu, faceuse, &is->fu_hd)) {
if (fu->orientation == OT_SAME)
- bu_ptbl(&faces, BU_PTBL_INS, (long *)fu);
+ bu_ptbl_ins(&faces, (long *)fu);
}
nmg_gluefaces((struct faceuse **)BU_PTBL_BASEADDR(&faces),
BU_PTBL_END(&faces), tol);
- bu_ptbl(&faces, BU_PTBL_RST, NULL);
+ bu_ptbl_reset(&faces);
nmg_shell_coplanar_face_merge(is, tol, 0);
nmg_shell_a(is, tol);
@@ -1387,7 +1387,7 @@
flags = (long *)bu_calloc(m->maxindex, sizeof(long), "patch-g: flags");
/* make a list of the vertices to be moved */
- bu_ptbl(&verts_to_move, BU_PTBL_INIT, (long *)NULL);
+ bu_ptbl_init(&verts_to_move, 64, "verts_to_move");
for (BU_LIST_FOR (fu, faceuse, &is->fu_hd)) {
if (fu->orientation != OT_SAME)
continue;
@@ -1410,7 +1410,7 @@
NMG_CK_VERTEX(vu->v_p)
if (NMG_INDEX_TEST_AND_SET(flags, vu->v_p)) {
/* move this vertex */
- bu_ptbl(&verts_to_move, BU_PTBL_INS, (long *)vu->v_p);
+ bu_ptbl_ins(&verts_to_move, (long *)vu->v_p);
}
}
}
@@ -1441,7 +1441,7 @@
nmg_km(m);
bu_free((char *)flags, "build_solid: flags");
bu_free((char *)copy_tbl, "build_solid: copy_tbl");
- bu_ptbl(&verts_to_move, BU_PTBL_FREE, (long *)NULL);
+ bu_ptbl_free(&verts_to_move);
return 1;
}
if (debug > 2)
@@ -1449,7 +1449,7 @@
}
/* done moving, get rid of table */
- bu_ptbl(&verts_to_move, BU_PTBL_FREE, (long *)NULL);
+ bu_ptbl_free(&verts_to_move);
if (debug > 4) {
char tmp_name[NAMESIZE+6];
@@ -1508,7 +1508,7 @@
}
#endif
- bu_ptbl(&faces, BU_PTBL_RST, NULL);
+ bu_ptbl_reset(&faces);
/* glue all the faces of the new shell together */
s = BU_LIST_FIRST(shell, &r->s_hd);
@@ -1517,12 +1517,12 @@
continue;
NMG_CK_FACEUSE(fu);
if (fu->orientation == OT_SAME)
- bu_ptbl(&faces, BU_PTBL_INS, (long *)fu);
+ bu_ptbl_ins(&faces, (long *)fu);
}
if (debug)
bu_log("Re-glue faces\n");
nmg_gluefaces((struct faceuse **)BU_PTBL_BASEADDR(&faces),
BU_PTBL_END(&faces), tol);
- bu_ptbl(&faces, BU_PTBL_FREE, NULL);
+ bu_ptbl_free(&faces);
/* Calculate bounding boxes */
if (debug)
Modified: brlcad/trunk/src/libbu/ptbl.c
===================================================================
--- brlcad/trunk/src/libbu/ptbl.c 2010-10-19 03:43:52 UTC (rev 41072)
+++ brlcad/trunk/src/libbu/ptbl.c 2010-10-19 03:51:20 UTC (rev 41073)
@@ -223,42 +223,6 @@
}
-int
-bu_ptbl(struct bu_ptbl *b, int func, long int *p)
-{
- if (func == BU_PTBL_INIT) {
- bu_ptbl_init(b, 64, "bu_ptbl() buffer[]");
- return 0;
- } else if (func == BU_PTBL_RST) {
- bu_ptbl_reset(b);
- return 0;
- } else if (func == BU_PTBL_INS) {
- return bu_ptbl_ins(b, p);
- } else if (func == BU_PTBL_LOC) {
- return bu_ptbl_locate(b, p);
- } else if (func == BU_PTBL_ZERO) {
- bu_ptbl_zero(b, p);
- return 0;
- } else if (func == BU_PTBL_INS_UNIQUE) {
- return bu_ptbl_ins_unique(b, p);
- } else if (func == BU_PTBL_RM) {
- return bu_ptbl_rm(b, p);
- } else if (func == BU_PTBL_CAT) {
- bu_ptbl_cat(b, (const struct bu_ptbl *)p);
- return 0;
- } else if (func == BU_PTBL_FREE) {
- bu_ptbl_free(b);
- return 0;
- }
-
- bu_log("bu_ptbl(%p) Unknown table function %d\n", (void *)b, func);
- BU_CK_PTBL(b);
-
- /* this is here to keep lint happy */
- return -1;
-}
-
-
void
bu_pr_ptbl(const char *title, const struct bu_ptbl *tbl, int verbose)
{
Modified: brlcad/trunk/src/libged/inside.c
===================================================================
--- brlcad/trunk/src/libged/inside.c 2010-10-19 03:43:52 UTC (rev 41072)
+++ brlcad/trunk/src/libged/inside.c 2010-10-19 03:51:20 UTC (rev 41073)
@@ -326,7 +326,7 @@
/* solve for new vertex geometry
* This does all the vertices
*/
- bu_ptbl(&vert_tab, BU_PTBL_INIT, (long *)NULL);
+ bu_ptbl_init(&vert_tab, 64, "vert_tab");
nmg_vertex_tabulate(&vert_tab, &m->magic);
for (i=0; i<BU_PTBL_END(&vert_tab); i++) {
struct vertex *v;
@@ -337,11 +337,11 @@
if (nmg_in_vert(v, 0, &gedp->ged_wdbp->wdb_tol)) {
bu_vls_printf(&gedp->ged_result_str, "Could not find
coordinates for inside arb7\n");
nmg_km(m);
- bu_ptbl(&vert_tab, BU_PTBL_FREE, (long *)NULL);
+ bu_ptbl_free(&vert_tab);
return GED_ERROR;
}
}
- bu_ptbl(&vert_tab, BU_PTBL_FREE, (long *)NULL);
+ bu_ptbl_free(&vert_tab);
/* rebound model */
nmg_rebound(m, &gedp->ged_wdbp->wdb_tol);
Modified: brlcad/trunk/src/libged/wdb_obj.c
===================================================================
--- brlcad/trunk/src/libged/wdb_obj.c 2010-10-19 03:43:52 UTC (rev 41072)
+++ brlcad/trunk/src/libged/wdb_obj.c 2010-10-19 03:51:20 UTC (rev 41073)
@@ -6584,7 +6584,7 @@
continue;
if (dp->d_nref == 0)
- bu_ptbl(&tops, BU_PTBL_INS, (long *)dp);
+ bu_ptbl_ins(&tops, (long *)dp);
}
}
@@ -6609,7 +6609,7 @@
}
/* Free list of tree-tops */
- bu_ptbl(&tops, BU_PTBL_FREE, (long *)NULL);
+ bu_ptbl_free(&tops);
/* Make new names */
db_functree(wdbp->dbip, old_dp, Make_new_name, Make_new_name,
&rt_uniresource, NULL);
Modified: brlcad/trunk/src/libged/xpush.c
===================================================================
--- brlcad/trunk/src/libged/xpush.c 2010-10-19 03:43:52 UTC (rev 41072)
+++ brlcad/trunk/src/libged/xpush.c 2010-10-19 03:51:20 UTC (rev 41073)
@@ -545,7 +545,7 @@
continue;
if (dp->d_nref == 0)
- bu_ptbl(&tops, BU_PTBL_INS, (long *)dp);
+ bu_ptbl_ins(&tops, (long *)dp);
}
}
@@ -570,7 +570,7 @@
}
/* Free list of tree-tops */
- bu_ptbl(&tops, BU_PTBL_FREE, (long *)NULL);
+ bu_ptbl_free(&tops);
/* Make new names */
db_functree(gedp->ged_wdbp->dbip, old_dp, Make_new_name, Make_new_name,
&rt_uniresource, (genptr_t)gedp);
Modified: brlcad/trunk/src/librt/primitives/nmg/nmg_inter.c
===================================================================
--- brlcad/trunk/src/librt/primitives/nmg/nmg_inter.c 2010-10-19 03:43:52 UTC
(rev 41072)
+++ brlcad/trunk/src/librt/primitives/nmg/nmg_inter.c 2010-10-19 03:51:20 UTC
(rev 41073)
@@ -2214,10 +2214,10 @@
goto do_ret;
}
- (void)bu_ptbl(&vert_list1, BU_PTBL_INIT, (long *)NULL);
- (void)bu_ptbl(&vert_list2, BU_PTBL_INIT, (long *)NULL);
- (void)bu_ptbl(&eu1_list, BU_PTBL_INIT, (long *)NULL);
- (void)bu_ptbl(&eu2_list, BU_PTBL_INIT, (long *)NULL);
+ bu_ptbl_init(&vert_list1, 64, "vert_list1 buffer");
+ bu_ptbl_init(&vert_list2, 64, "vert_list1 buffer");
+ bu_ptbl_init(&eu1_list, 64, "eu1_list1 buffer");
+ bu_ptbl_init(&eu2_list, 64, "eu2_list1 buffer");
NMG_CK_EDGE_G_LSEG(eu1->g.lseg_p);
is->on_eg = eu1->g.lseg_p;
@@ -5241,8 +5241,8 @@
}
}
#endif
- (void)bu_ptbl(&vert_list1, BU_PTBL_INIT, (long *)NULL);
- (void)bu_ptbl(&vert_list2, BU_PTBL_INIT, (long *)NULL);
+ bu_ptbl_init(&vert_list1, 64, "vert_list1 buffer");
+ bu_ptbl_init(&vert_list2, 64, "vert_list2 buffer");
/* Build list of all edgeuses in fu1 and fu2 */
nmg_edgeuse_tabulate(&eu1_list, &fu1->l.magic);
@@ -6502,7 +6502,7 @@
/* get a list of all the loops in this faceuse */
bu_ptbl_init(&loops, 64, " &loops");
for (BU_LIST_FOR(lu, loopuse, &fu1->lu_hd))
- bu_ptbl(&loops, BU_PTBL_INS, (long *)lu);
+ bu_ptbl_ins(&loops, (long *)lu);
/* cut each loop so that every loop ends up either entirely on the other
* face, or with only a "line of intersection" in common
@@ -6597,7 +6597,7 @@
/* get a list of all the loops in this faceuse */
bu_ptbl_reset(&loops);
for (BU_LIST_FOR(lu, loopuse, &fu2->lu_hd))
- bu_ptbl(&loops, BU_PTBL_INS, (long *)lu);
+ bu_ptbl_ins(&loops, (long *)lu);
/* cut each loop so that every loop ends up either entirely on the other
* face, or with only a "line of intersection" in common
Modified: brlcad/trunk/src/util/fix_polysolids.c
===================================================================
--- brlcad/trunk/src/util/fix_polysolids.c 2010-10-19 03:43:52 UTC (rev
41072)
+++ brlcad/trunk/src/util/fix_polysolids.c 2010-10-19 03:51:20 UTC (rev
41073)
@@ -92,7 +92,7 @@
}
}
- bu_ptbl(&faces, BU_PTBL_INIT, (long *)NULL);
+ bu_ptbl_init(&faces, 64, "faces");
m = nmg_mmr();
r = BU_LIST_FIRST(nmgregion, &m->r_hd);
while (1) {
@@ -115,7 +115,7 @@
case ID_P_HEAD:
bu_log("Polysolid (%s)\n", rec.p.p_name);
s = nmg_msv(r);
- bu_ptbl(&faces, BU_PTBL_RST, (long *)NULL);
+ bu_ptbl_reset(&faces);
while (!done) {
struct faceuse *fu;
struct loopuse *lu;
@@ -146,7 +146,7 @@
bu_log("\tEliminating degenerate face\n");
nmg_kfu(fu);
} else {
- bu_ptbl(&faces, BU_PTBL_INS, (long *)fu);
+ bu_ptbl_ins(&faces, (long *)fu);
}
}
nmg_rebound(m, &tol);
@@ -161,7 +161,7 @@
break;
}
}
- bu_ptbl(&faces, BU_PTBL_FREE, (long *)NULL);
+ bu_ptbl_free(&faces);
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits