[brlcad-commits] SF.net SVN: brlcad:[37093] brlcad/trunk
Open Source Solid Modeling CAD
Brought to you by:
brlcad
From: <br...@us...> - 2009-12-31 10:48:37
|
Revision: 37093 http://brlcad.svn.sourceforge.net/brlcad/?rev=37093&view=rev Author: brlcad Date: 2009-12-31 10:48:25 +0000 (Thu, 31 Dec 2009) Log Message: ----------- and with this WHOOOSH.. the remainder of nmg is quellified. quieted sign warnings, unused params, shadow vars, and floating point comparisons (which now test via computation tolerance). go ahead and change some of the signatures for funcs that had unused params that provided little stubbed benefit. Modified Paths: -------------- brlcad/trunk/include/raytrace.h brlcad/trunk/src/librt/primitives/nmg/nmg_fcut.c brlcad/trunk/src/librt/primitives/nmg/nmg_inter.c brlcad/trunk/src/librt/primitives/nmg/nmg_mesh.c brlcad/trunk/src/librt/primitives/nmg/nmg_mod.c brlcad/trunk/src/librt/primitives/nmg/nmg_plot.c brlcad/trunk/src/librt/primitives/nmg/nmg_pr.c brlcad/trunk/src/librt/primitives/nmg/nmg_rt_isect.c brlcad/trunk/src/librt/primitives/nmg/nmg_rt_segs.c brlcad/trunk/src/librt/primitives/nmg/nmg_tri.c brlcad/trunk/src/librt/primitives/nmg/nmg_tri_mc.c Modified: brlcad/trunk/include/raytrace.h =================================================================== --- brlcad/trunk/include/raytrace.h 2009-12-31 10:28:51 UTC (rev 37092) +++ brlcad/trunk/include/raytrace.h 2009-12-31 10:48:25 UTC (rev 37093) @@ -4217,38 +4217,14 @@ const struct bn_tol *tol)); /* From nmg_extrude.c */ -RT_EXPORT BU_EXTERN(void nmg_translate_face, - (struct faceuse *fu, - const vect_t Vec, - const struct bn_tol *tol)); -RT_EXPORT BU_EXTERN(int nmg_extrude_face, - (struct faceuse *fu, - const vect_t Vec, - const struct bn_tol *tol)); -RT_EXPORT BU_EXTERN(struct vertexuse *nmg_find_vertex_in_lu, - (const struct vertex *v, - const struct loopuse *lu)); -RT_EXPORT BU_EXTERN(void nmg_fix_overlapping_loops, - (struct shell *s, - const struct bn_tol *tol)); -RT_EXPORT BU_EXTERN(void nmg_break_crossed_loops, - (struct shell *is, - const struct bn_tol *tol)); -RT_EXPORT BU_EXTERN(struct shell *nmg_extrude_cleanup, - (struct shell *is, - const int is_void, - const struct bn_tol *tol)); -RT_EXPORT BU_EXTERN(void nmg_hollow_shell, - (struct shell *s, - const fastf_t thick, - const int approximate, - const struct bn_tol *tol)); -RT_EXPORT BU_EXTERN(struct shell *nmg_extrude_shell, - (struct shell *s, - const fastf_t dist, - const int normal_ward, - const int approximate, - const struct bn_tol *tol)); +RT_EXPORT BU_EXTERN(void nmg_translate_face, (struct faceuse *fu, const vect_t Vec)); +RT_EXPORT BU_EXTERN(int nmg_extrude_face, (struct faceuse *fu, const vect_t Vec, const struct bn_tol *tol)); +RT_EXPORT BU_EXTERN(struct vertexuse *nmg_find_vertex_in_lu, (const struct vertex *v, const struct loopuse *lu)); +RT_EXPORT BU_EXTERN(void nmg_fix_overlapping_loops, (struct shell *s, const struct bn_tol *tol)); +RT_EXPORT BU_EXTERN(void nmg_break_crossed_loops, (struct shell *is, const struct bn_tol *tol)); +RT_EXPORT BU_EXTERN(struct shell *nmg_extrude_cleanup, (struct shell *is, const int is_void, const struct bn_tol *tol)); +RT_EXPORT BU_EXTERN(void nmg_hollow_shell, (struct shell *s, const fastf_t thick, const int approximate, const struct bn_tol *tol)); +RT_EXPORT BU_EXTERN(struct shell *nmg_extrude_shell, (struct shell *s, const fastf_t dist, const int normal_ward, const int approximate, const struct bn_tol *tol)); /* From nmg_pr.c */ RT_EXPORT BU_EXTERN(char *nmg_orientation, @@ -4939,8 +4915,7 @@ long *tab, int red, int green, - int blue, - int fancy)); + int blue)); RT_EXPORT BU_EXTERN(void nmg_vlblock_eu, (struct bn_vlblock *vbp, const struct edgeuse *eu, @@ -4948,8 +4923,7 @@ int red, int green, int blue, - int fancy, - int loopnum)); + int fancy)); RT_EXPORT BU_EXTERN(void nmg_vlblock_euleft, (struct bu_list *vh, const struct edgeuse *eu, @@ -4972,8 +4946,7 @@ int red, int green, int blue, - int fancy, - int loopnum)); + int fancy)); RT_EXPORT BU_EXTERN(void nmg_vlblock_fu, (struct bn_vlblock *vbp, const struct faceuse *fu, @@ -5007,7 +4980,6 @@ const struct faceuse *fu1)); RT_EXPORT BU_EXTERN(void nmg_pl_2fu, (const char *str, - int num, const struct faceuse *fu1, const struct faceuse *fu2, int show_mates)); @@ -5723,10 +5695,6 @@ RT_EXPORT BU_EXTERN(void nmg_s_radial_harmonize, (struct shell *s, const struct bn_tol *tol)); -RT_EXPORT BU_EXTERN(int nmg_eu_radial_check, - (const struct edgeuse *eu, - const struct shell *s, - const struct bn_tol *tol)); RT_EXPORT BU_EXTERN(void nmg_s_radial_check, (struct shell *s, const struct bn_tol *tol)); Modified: brlcad/trunk/src/librt/primitives/nmg/nmg_fcut.c =================================================================== --- brlcad/trunk/src/librt/primitives/nmg/nmg_fcut.c 2009-12-31 10:28:51 UTC (rev 37092) +++ brlcad/trunk/src/librt/primitives/nmg/nmg_fcut.c 2009-12-31 10:48:25 UTC (rev 37093) @@ -1552,7 +1552,7 @@ struct loopuse *lu; lu = nmg_find_lu_of_vu(vs[i].vu); bu_log("\tvu[%d]=x%x, lu=x%x\n", i, vs[i].vu, lu); - nmg_vlblock_lu(vbp, lu, b, 255, 0, 0, 0, 0); + nmg_vlblock_lu(vbp, lu, b, 255, 0, 0, 0); } for (i=start; i < end; i++) { struct loopuse *lu; Modified: brlcad/trunk/src/librt/primitives/nmg/nmg_inter.c =================================================================== --- brlcad/trunk/src/librt/primitives/nmg/nmg_inter.c 2009-12-31 10:28:51 UTC (rev 37092) +++ brlcad/trunk/src/librt/primitives/nmg/nmg_inter.c 2009-12-31 10:48:25 UTC (rev 37093) @@ -2230,7 +2230,7 @@ if (fu1 && rt_g.NMG_debug & (DEBUG_POLYSECT|DEBUG_FCUT|DEBUG_MESH) && rt_g.NMG_debug & DEBUG_PLOTEM) { - nmg_pl_2fu("Iface%d.pl", 0, fu2, fu1, 0); + nmg_pl_2fu("Iface%d.pl", fu2, fu1, 0); } vu1 = eu1->vu_p; @@ -5169,7 +5169,7 @@ if (rt_g.NMG_debug & (DEBUG_POLYSECT|DEBUG_FCUT|DEBUG_MESH) && rt_g.NMG_debug & DEBUG_PLOTEM) { - nmg_pl_2fu("Iface%d.pl", 0, fu1, fu2, 0); + nmg_pl_2fu("Iface%d.pl", fu1, fu2, 0); } #if 0 /* Topology search */ @@ -7285,7 +7285,7 @@ /* Both at once */ - nmg_pl_2fu("Iface%d.pl", 0, fu2, fu1, 0); + nmg_pl_2fu("Iface%d.pl", fu2, fu1, 0); /* Each in it's own file */ nmg_face_plot(fu1); Modified: brlcad/trunk/src/librt/primitives/nmg/nmg_mesh.c =================================================================== --- brlcad/trunk/src/librt/primitives/nmg/nmg_mesh.c 2009-12-31 10:28:51 UTC (rev 37092) +++ brlcad/trunk/src/librt/primitives/nmg/nmg_mesh.c 2009-12-31 10:48:25 UTC (rev 37093) @@ -584,8 +584,7 @@ BN_CK_TOL(tol); if (rt_g.NMG_debug & DEBUG_MESH_EU && rt_g.NMG_debug & DEBUG_PLOTEM) { - static int fnum=1; - nmg_pl_2fu("Before_mesh%d.pl", fnum++, fu1, fu2, 1); + nmg_pl_2fu("Before_mesh%d.pl", fu1, fu2, 1); } if (rt_g.NMG_debug & DEBUG_MESH_EU) @@ -601,8 +600,7 @@ count += nmg_mesh_two_faces(fu1, fu2, tol); if (rt_g.NMG_debug & DEBUG_MESH_EU && rt_g.NMG_debug & DEBUG_PLOTEM) { - static int fno=1; - nmg_pl_2fu("After_mesh%d.pl", fno++, fu1, fu2, 1); + nmg_pl_2fu("After_mesh%d.pl", fu1, fu2, 1); } } Modified: brlcad/trunk/src/librt/primitives/nmg/nmg_mod.c =================================================================== --- brlcad/trunk/src/librt/primitives/nmg/nmg_mod.c 2009-12-31 10:28:51 UTC (rev 37092) +++ brlcad/trunk/src/librt/primitives/nmg/nmg_mod.c 2009-12-31 10:48:25 UTC (rev 37093) @@ -374,7 +374,6 @@ while (BU_LIST_NOT_HEAD(&lu->l, &fu->lu_hd)) { struct loopuse *next_lu; struct loopuse *lu1; - struct edgeuse *eu; NMG_CK_LOOPUSE(lu); @@ -1407,7 +1406,7 @@ HPRINT("plane", plane); return(-1); } - if (plane[0] == 0.0 && plane[1] == 0.0 && plane[2] == 0.0) { + if (VNEAR_ZERO(plane, SMALL_FASTF)) { bu_log("nmg_fu_planeeqn(): Bad plane equation from bn_mk_plane_3pts\n"); HPRINT("plane", plane); return(-1); @@ -3423,13 +3422,8 @@ */ eu = tmpeu; - if (rt_g.NMG_debug &(DEBUG_PLOTEM|DEBUG_PL_ANIM) && - *lu->up.magic_p == NMG_FACEUSE_MAGIC) { - static int fno=0; - - nmg_pl_2fu("After_joinloop%d.pl", fno++, - lu->up.fu_p, lu->up.fu_p->fumate_p, 0); - + if (rt_g.NMG_debug &(DEBUG_PLOTEM|DEBUG_PL_ANIM) && *lu->up.magic_p == NMG_FACEUSE_MAGIC) { + nmg_pl_2fu("After_joinloop%d.pl", lu->up.fu_p, lu->up.fu_p->fumate_p, 0); } } eu = BU_LIST_PNEXT(edgeuse, eu); @@ -3497,12 +3491,9 @@ return 1; /* loopuse is empty */ eu = BU_LIST_FIRST(edgeuse, &lu->down_hd); - if (rt_g.NMG_debug &(DEBUG_PLOTEM|DEBUG_PL_ANIM) && - *lu->up.magic_p == NMG_FACEUSE_MAGIC) { - static int fno=0; + if (rt_g.NMG_debug &(DEBUG_PLOTEM|DEBUG_PL_ANIM) && *lu->up.magic_p == NMG_FACEUSE_MAGIC) { - nmg_pl_2fu("After_joinloop%d.pl", fno++, - lu->up.fu_p, lu->up.fu_p->fumate_p, 0); + nmg_pl_2fu("After_joinloop%d.pl", lu->up.fu_p, lu->up.fu_p->fumate_p, 0); } Modified: brlcad/trunk/src/librt/primitives/nmg/nmg_plot.c =================================================================== --- brlcad/trunk/src/librt/primitives/nmg/nmg_plot.c 2009-12-31 10:28:51 UTC (rev 37092) +++ brlcad/trunk/src/librt/primitives/nmg/nmg_plot.c 2009-12-31 10:48:25 UTC (rev 37093) @@ -742,7 +742,7 @@ struct bn_vlblock *vbp; vbp = rt_vlblock_init(); - nmg_vlblock_lu(vbp, lu, b, red, green, blue, 0, 0); + nmg_vlblock_lu(vbp, lu, b, red, green, blue, 0); rt_plot_vlblock(fp, vbp); rt_vlblock_free(vbp); } @@ -756,7 +756,6 @@ { struct loopuse *lu; struct bn_vlblock *vbp; - int loopnum = 0; NMG_CK_FACEUSE(fu); NMG_INDEX_RETURN_IF_SET_ELSE_SET(b, fu->index); @@ -764,7 +763,7 @@ vbp = rt_vlblock_init(); for (BU_LIST_FOR(lu, loopuse, &fu->lu_hd)) { - nmg_vlblock_lu(vbp, lu, b, red, green, blue, 1, loopnum++); + nmg_vlblock_lu(vbp, lu, b, red, green, blue, 1); } rt_plot_vlblock(fp, vbp); @@ -866,7 +865,7 @@ * N M G _ V L B L O C K _ E */ void -nmg_vlblock_e(struct bn_vlblock *vbp, const struct edge *e, long *tab, int red, int green, int blue, int fancy) +nmg_vlblock_e(struct bn_vlblock *vbp, const struct edge *e, long *tab, int red, int green, int blue) { pointp_t p0, p1; point_t end0, end1; @@ -909,7 +908,7 @@ * M N G _ V L B L O C K _ E U */ void -nmg_vlblock_eu(struct bn_vlblock *vbp, const struct edgeuse *eu, long *tab, int red, int green, int blue, int fancy, int loopnum) +nmg_vlblock_eu(struct bn_vlblock *vbp, const struct edgeuse *eu, long *tab, int red, int green, int blue, int fancy) { point_t base, tip; point_t radial_tip; @@ -929,7 +928,7 @@ NMG_CK_VERTEX(eu->eumate_p->vu_p->v_p); NMG_CK_VERTEX_G(eu->eumate_p->vu_p->v_p->vg_p); - nmg_vlblock_e(vbp, eu->e_p, tab, red, green, blue, fancy); + nmg_vlblock_e(vbp, eu->e_p, tab, red, green, blue); if (!fancy) return; @@ -1129,10 +1128,10 @@ do { if (fancy) nmg_vlblock_euleft(vh, eu, center, mat, xvec, yvec, len, tol); - nmg_vlblock_eu(vbp, eu, tab, 80, 100, 170, 3, 0); + nmg_vlblock_eu(vbp, eu, tab, 80, 100, 170, 3); eu = eu->eumate_p; - nmg_vlblock_eu(vbp, eu, tab, 80, 100, 170, 3, 0); + nmg_vlblock_eu(vbp, eu, tab, 80, 100, 170, 3); eu = eu->radial_p; } while (eu != orig_eu); } @@ -1142,7 +1141,7 @@ * N M G _ V L B L O C K _ L U */ void -nmg_vlblock_lu(struct bn_vlblock *vbp, const struct loopuse *lu, long *tab, int red, int green, int blue, int fancy, int loopnum) +nmg_vlblock_lu(struct bn_vlblock *vbp, const struct loopuse *lu, long *tab, int red, int green, int blue, int fancy) { struct edgeuse *eu; unsigned long magic1; @@ -1160,8 +1159,7 @@ nmg_vlblock_v(vbp, vu->v_p, tab); } else if (magic1 == NMG_EDGEUSE_MAGIC) { for (BU_LIST_FOR(eu, edgeuse, &lu->down_hd)) { - nmg_vlblock_eu(vbp, eu, tab, red, green, blue, - fancy, loopnum); + nmg_vlblock_eu(vbp, eu, tab, red, green, blue, fancy); } } } @@ -1174,7 +1172,6 @@ nmg_vlblock_fu(struct bn_vlblock *vbp, const struct faceuse *fu, long *tab, int fancy) { struct loopuse *lu; - int loopnum = 0; BN_CK_VLBLOCK(vbp); NMG_CK_FACEUSE(fu); @@ -1183,10 +1180,10 @@ for (BU_LIST_FOR(lu, loopuse, &fu->lu_hd)) { /* Draw in pale blue / purple */ if (fancy) { - nmg_vlblock_lu(vbp, lu, tab, 80, 100, 170, fancy, loopnum++); + nmg_vlblock_lu(vbp, lu, tab, 80, 100, 170, fancy); } else { /* Non-fancy */ - nmg_vlblock_lu(vbp, lu, tab, 80, 100, 170, 0, loopnum++); + nmg_vlblock_lu(vbp, lu, tab, 80, 100, 170, 0); } } } @@ -1221,10 +1218,10 @@ for (BU_LIST_FOR(lu, loopuse, &s->lu_hd)) { NMG_CK_LOOPUSE(lu); if (fancy) { - nmg_vlblock_lu(vbp, lu, tab, 255, 0, 0, fancy, 0); + nmg_vlblock_lu(vbp, lu, tab, 255, 0, 0, fancy); } else { /* non-fancy, wire loops in red */ - nmg_vlblock_lu(vbp, lu, tab, 200, 0, 0, 0, 0); + nmg_vlblock_lu(vbp, lu, tab, 200, 0, 0, 0); } } @@ -1233,10 +1230,10 @@ NMG_CK_EDGE(eu->e_p); if (fancy) { - nmg_vlblock_eu(vbp, eu, tab, 200, 200, 0, fancy, 0); + nmg_vlblock_eu(vbp, eu, tab, 200, 200, 0, fancy); } else { /* non-fancy, wire edges in yellow */ - nmg_vlblock_eu(vbp, eu, tab, 200, 200, 0, 0, 0); + nmg_vlblock_eu(vbp, eu, tab, 200, 200, 0, 0); } } if (s->vu_p) { @@ -1451,7 +1448,7 @@ * Called from nmg_isect_2faces and other places. */ void -nmg_pl_2fu(const char *str, int unused, const struct faceuse *fu1, const struct faceuse *fu2, int show_mates) +nmg_pl_2fu(const char *str, const struct faceuse *fu1, const struct faceuse *fu2, int show_mates) { FILE *fp; char name[32]; @@ -1541,8 +1538,8 @@ /** * S H O W _ B R O K E N _ V U */ -static void -show_broken_vu(struct bn_vlblock *vbp, const struct vertexuse *vu, int fancy) +HIDDEN void +show_broken_vu(struct bn_vlblock *vbp, const struct vertexuse *vu) { pointp_t p; struct bu_list *vh; @@ -1595,8 +1592,8 @@ } -static void -show_broken_e(struct bn_vlblock *vbp, const struct edgeuse *eu, int fancy) +HIDDEN void +show_broken_e(struct bn_vlblock *vbp, const struct edgeuse *eu) { pointp_t p0, p1; point_t end0, end1; @@ -1635,8 +1632,8 @@ RT_ADD_VLIST(vh, end0, BN_VLIST_LINE_MOVE); RT_ADD_VLIST(vh, end1, BN_VLIST_LINE_DRAW); - show_broken_vu(vbp, eu->vu_p, fancy); - show_broken_vu(vbp, eu->eumate_p->vu_p, fancy); + show_broken_vu(vbp, eu->vu_p); + show_broken_vu(vbp, eu->eumate_p->vu_p); } @@ -1653,7 +1650,7 @@ NMG_CK_EDGEUSE(eu); NMG_CK_EDGE(eu->e_p); - show_broken_e(vbp, eu, fancy); + show_broken_e(vbp, eu); if (!fancy) return; @@ -1703,7 +1700,7 @@ if (BU_LIST_FIRST_MAGIC(&lu->down_hd)==NMG_VERTEXUSE_MAGIC) { register struct vertexuse *vu; vu = BU_LIST_FIRST(vertexuse, &lu->down_hd); - show_broken_vu(vbp, vu, fancy); + show_broken_vu(vbp, vu); return; } @@ -1765,7 +1762,7 @@ for (BU_LIST_FOR(eu, edgeuse, &s->eu_hd)) show_broken_eu(vbp, eu, fancy); if (s->vu_p) - show_broken_vu(vbp, s->vu_p, fancy); + show_broken_vu(vbp, s->vu_p); } static void show_broken_r(struct bn_vlblock *vbp, const struct nmgregion *r, int fancy) @@ -1789,11 +1786,10 @@ } -static struct bn_vlblock *vbp = (struct bn_vlblock *)NULL; static int stepalong = 0; void -nmg_plot_sigstepalong(int i) +nmg_plot_sigstepalong(int i __attribute__((unused))) { stepalong=1; } @@ -1808,6 +1804,7 @@ void nmg_show_broken_classifier_stuff(unsigned long *p, long int **classlist, int all_new, int fancy, const char *a_string) { + static struct bn_vlblock *vbp = (struct bn_vlblock *)NULL; struct model *m; /* printf("showing broken stuff\n"); */ @@ -1871,7 +1868,7 @@ show_broken_eu(vbp, (struct edgeuse *)p, fancy); break; case NMG_VERTEXUSE_MAGIC: - show_broken_vu(vbp, (struct vertexuse *)p, fancy); + show_broken_vu(vbp, (struct vertexuse *)p); break; default: bu_log("Unknown magic number %ld %0lx %lu %0lx\n", *p, *p, (unsigned long)p, (unsigned long)p); @@ -2220,7 +2217,7 @@ if (*eur->up.magic_p == NMG_LOOPUSE_MAGIC) { /* Draw this loop in non-fancy format, for context */ - nmg_vlblock_lu(vbp, eur->up.lu_p, tab, 80, 100, 170, 0, 0); + nmg_vlblock_lu(vbp, eur->up.lu_p, tab, 80, 100, 170, 0); } eur = eur->radial_p->eumate_p; } while (eur != eu); @@ -2280,11 +2277,11 @@ if (RT_NURB_IS_PT_RATIONAL(c->pt_type)) { vp = c->ctl_points; for (i= 0; i < c->s_size[0] * c->s_size[1]; i++) { - fastf_t div; - vp[0] *= (div = 1/vp[3]); - vp[1] *= div; - vp[2] *= div; - vp[3] *= div; + fastf_t one_over_vp; + vp[0] *= (one_over_vp = 1/vp[3]); + vp[1] *= one_over_vp; + vp[2] *= one_over_vp; + vp[3] *= one_over_vp; vp += coords; } } Modified: brlcad/trunk/src/librt/primitives/nmg/nmg_pr.c =================================================================== --- brlcad/trunk/src/librt/primitives/nmg/nmg_pr.c 2009-12-31 10:28:51 UTC (rev 37092) +++ brlcad/trunk/src/librt/primitives/nmg/nmg_pr.c 2009-12-31 10:48:25 UTC (rev 37093) @@ -447,7 +447,7 @@ { const struct edgeuse *eu; const struct vertexuse *vu; - long magic1; + unsigned long magic1; MKPAD(h); NMG_CK_LOOPUSE(lu); @@ -500,7 +500,7 @@ { const struct edgeuse *eu; const struct vertexuse *vu; - long magic1; + unsigned long magic1; MKPAD(h); NMG_CK_LOOPUSE(lu); @@ -938,7 +938,7 @@ * Does not mind wire edges. */ void -nmg_pr_one_eu_vecs(const struct edgeuse *eu, const fastf_t *xvec, const fastf_t *yvec, const fastf_t *zvec, const struct bn_tol *tol) +nmg_pr_one_eu_vecs(const struct edgeuse *eu, const fastf_t *xvec, const fastf_t *yvec, const fastf_t *zvec, const struct bn_tol *tol __attribute__((unused))) { const struct loopuse *lu; const struct faceuse *fu; Modified: brlcad/trunk/src/librt/primitives/nmg/nmg_rt_isect.c =================================================================== --- brlcad/trunk/src/librt/primitives/nmg/nmg_rt_isect.c 2009-12-31 10:28:51 UTC (rev 37092) +++ brlcad/trunk/src/librt/primitives/nmg/nmg_rt_isect.c 2009-12-31 10:48:25 UTC (rev 37093) @@ -126,7 +126,7 @@ } -static void +HIDDEN void nmg_rt_isect_plfu(struct faceuse *fu, fastf_t *pt, fastf_t *plane_pt) { FILE *fp; @@ -165,7 +165,7 @@ } -static void +HIDDEN void pleu(struct edgeuse *eu, fastf_t *pt, fastf_t *plane_pt) { FILE *fp; @@ -208,10 +208,6 @@ bu_free((char *)b, "bit vec"); fclose(fp); } -static void -plvu(struct vertexuse *vu) -{ -} void @@ -256,7 +252,7 @@ * insert the new hit point in the correct place in the list of hits * so that the list is always in sorted order */ -static void +HIDDEN void hit_ins(struct ray_data *rd, struct hitmiss *newhit) { struct hitmiss *a_hit; @@ -298,7 +294,7 @@ /** * The ray missed this vertex. Build the appropriate miss structure. */ -static struct hitmiss * +HIDDEN struct hitmiss * ray_miss_vertex(struct ray_data *rd, struct vertexuse *vu_p) { struct hitmiss *myhit; @@ -352,7 +348,7 @@ /** * Support routine for vertex_neighborhood() */ -static void +HIDDEN void get_pole_dist_to_face(struct ray_data *rd, struct vertexuse *vu, fastf_t *Pole, fastf_t *Pole_prj_pt, double *Pole_dist, fastf_t *Pole_pca, fastf_t *pointA, fastf_t *leftA, fastf_t *pointB, fastf_t *leftB, fastf_t *polar_height_vect, char *Pole_name) { vect_t pca_to_pole_vect; @@ -575,7 +571,7 @@ } -static void +HIDDEN void plot_neighborhood(fastf_t *North_Pole, fastf_t *North_pl_pt, fastf_t *North_pca, fastf_t *South_Pole, fastf_t *South_pl_pt, fastf_t *South_pca, fastf_t *pointA, fastf_t *pointB, fastf_t *norm, fastf_t *pt, fastf_t *leftA, fastf_t *leftB) { static int plotnum=0; @@ -710,7 +706,7 @@ * face, then the ray state is "outside" before (after) the ray hits * the vertex. */ -static void +HIDDEN void vertex_neighborhood(struct ray_data *rd, struct vertexuse *vu_p, struct hitmiss *myhit) { struct vertexuse *vu; @@ -961,15 +957,15 @@ * Once it has been decided that the ray hits the vertex, this routine * takes care of recording that fact. */ -static void +HIDDEN void ray_hit_vertex(struct ray_data *rd, struct vertexuse *vu_p, int status) { struct hitmiss *myhit; vect_t v; if (rt_g.NMG_debug & DEBUG_RT_ISECT) - bu_log("ray_hit_vertex x%x (%g %g %g)\n", - vu_p->v_p, V3ARGS(vu_p->v_p->vg_p->coord)); + bu_log("ray_hit_vertex x%x (%g %g %g) status=%d\n", + vu_p->v_p, V3ARGS(vu_p->v_p->vg_p->coord), status); if ((myhit = NMG_INDEX_GET(rd->hitmiss, vu_p->v_p))) { if (BU_LIST_MAGIC_OK((struct bu_list *)myhit, NMG_RT_HIT_MAGIC)) @@ -1005,8 +1001,6 @@ */ hit_ins(rd, myhit); - if (rt_g.NMG_debug & DEBUG_RT_ISECT) - plvu(vu_p); /* sanity check */ NMG_CK_HITMISS(myhit); @@ -1025,7 +1019,7 @@ * 1 vertex was hit * 0 vertex was missed */ -static int +HIDDEN int isect_ray_vertexuse(struct ray_data *rd, struct vertexuse *vu_p) { struct hitmiss *myhit; @@ -1091,7 +1085,7 @@ * remembering that this is a seg_in/seg_out pair, and builds the hit * on the edge. */ -static void +HIDDEN void colinear_edge_ray(struct ray_data *rd, struct edgeuse *eu_p) { struct hitmiss *vhit1, *vhit2, *myhit; @@ -1161,7 +1155,7 @@ * Compute the "ray state" before and after the ray encounters a * hit-point on an edge. */ -static void +HIDDEN void edge_hit_ray_state(struct ray_data *rd, struct edgeuse *eu, struct hitmiss *myhit) { double cos_angle; @@ -1385,7 +1379,7 @@ /** * record a hit on an edge. */ -static void +HIDDEN void ray_hit_edge(struct ray_data *rd, struct edgeuse *eu_p, double dist_along_ray, fastf_t *pt) { struct hitmiss *myhit; @@ -1442,12 +1436,6 @@ void -isect_ray_cnurb(struct ray_data *rd, struct edgeuse *eu_p) -{ -} - - -void isect_ray_lseg(struct ray_data *rd, struct edgeuse *eu_p) { int status; @@ -1559,7 +1547,7 @@ * Intersect ray with edgeuse. If they pass within tolerance, a hit * is generated. */ -static void +HIDDEN void isect_ray_edgeuse(struct ray_data *rd, struct edgeuse *eu_p) { struct hitmiss *myhit; @@ -1619,7 +1607,7 @@ isect_ray_lseg(rd, eu_p); break; case NMG_EDGE_G_CNURB_MAGIC: - isect_ray_cnurb(rd, eu_p); + /* not implemented */ break; } } @@ -1629,7 +1617,7 @@ /** * I S E C T _ R A Y _ L O O P U S E */ -static void +HIDDEN void isect_ray_loopuse(struct ray_data *rd, struct loopuse *lu_p) { struct edgeuse *eu_p; @@ -1659,7 +1647,7 @@ } -static void +HIDDEN void eu_touch_func(struct edgeuse *eu, fastf_t *pt, char *priv) { struct edgeuse *eu_next; @@ -1692,8 +1680,8 @@ } -static void -vu_touch_func(struct vertexuse *vu, fastf_t *pt, char *priv) +HIDDEN void +vu_touch_func(struct vertexuse *vu, fastf_t *pt __attribute__((unused)), char *priv) { struct ray_data *rd; @@ -1710,8 +1698,8 @@ } -static void -record_face_hit(struct ray_data *rd, struct hitmiss *myhit, fastf_t *plane_pt, double dist, struct faceuse *fu_p, fastf_t *norm, int a_hit) +HIDDEN void +record_face_hit(struct ray_data *rd, struct hitmiss *myhit, fastf_t *plane_pt, double dist, struct faceuse *fu_p, fastf_t *norm) { double cos_angle; @@ -2078,8 +2066,8 @@ } -void -isect_ray_planar_face(struct ray_data *rd, struct faceuse *fu_p, struct face_g_plane *fg_p) +HIDDEN void +isect_ray_planar_face(struct ray_data *rd, struct faceuse *fu_p) { plane_t norm; fastf_t dist; @@ -2191,7 +2179,7 @@ * sub-element, but it WAS within the area of the * face. We need to record a hit on the face */ - record_face_hit(rd, myhit, plane_pt, dist, fu_p, norm, 0); + record_face_hit(rd, myhit, plane_pt, dist, fu_p, norm); } break; case NMG_CLASS_AoutB : @@ -2217,7 +2205,7 @@ * * check to see if ray hits face. */ -static void +HIDDEN void isect_ray_faceuse(struct ray_data *rd, struct faceuse *fu_p) { @@ -2318,7 +2306,7 @@ switch (*fu_p->f_p->g.magic_p) { case NMG_FACE_G_PLANE_MAGIC: - isect_ray_planar_face(rd, fu_p, fu_p->f_p->g.plane_p); + isect_ray_planar_face(rd, fu_p); break; case NMG_FACE_G_SNURB_MAGIC: isect_ray_snurb_face(rd, fu_p, fu_p->f_p->g.snurb_p); @@ -2331,7 +2319,7 @@ * * Implicit return: adds hit points to the hit-list "hl" */ -static void +HIDDEN void nmg_isect_ray_shell(struct ray_data *rd, const struct shell *s_p) { struct faceuse *fu_p; @@ -2471,7 +2459,7 @@ } -static int +HIDDEN int guess_class_from_hitlist_max(struct ray_data *rd, int *hari_kari, int in_or_out_only) { struct hitmiss *a_hit; @@ -2517,7 +2505,7 @@ nmg_rt_inout_str(a_hit->in_out)); plus_hit = a_hit; *hari_kari = 0; - } else if (a_hit->hit.hit_dist == plus_hit->hit.hit_dist) { + } else if (NEAR_ZERO(a_hit->hit.hit_dist - plus_hit->hit.hit_dist, SMALL_FASTF)) { *hari_kari = 1; } } @@ -2564,7 +2552,7 @@ } -static int +HIDDEN int guess_class_from_hitlist_min(struct ray_data *rd, int *hari_kari, int in_or_out_only) { struct hitmiss *a_hit; @@ -2610,7 +2598,7 @@ nmg_rt_inout_str(a_hit->in_out)); minus_hit = a_hit; *hari_kari = 0; - } else if (a_hit->hit.hit_dist == minus_hit->hit.hit_dist) { + } else if (NEAR_ZERO(a_hit->hit.hit_dist - minus_hit->hit.hit_dist, SMALL_FASTF)) { *hari_kari = 1; } } Modified: brlcad/trunk/src/librt/primitives/nmg/nmg_rt_segs.c =================================================================== --- brlcad/trunk/src/librt/primitives/nmg/nmg_rt_segs.c 2009-12-31 10:28:51 UTC (rev 37092) +++ brlcad/trunk/src/librt/primitives/nmg/nmg_rt_segs.c 2009-12-31 10:48:25 UTC (rev 37093) @@ -295,7 +295,7 @@ HIDDEN int -state0(struct seg *seghead, struct seg **seg_p, int *seg_count, struct hitmiss *a_hit, struct soltab *stp, struct application *ap, struct bn_tol *tol) +state0(struct seg *seghead __attribute__((unused)), struct seg **seg_p, int *seg_count __attribute__((unused)), struct hitmiss *a_hit, struct soltab *stp, struct application *ap, struct bn_tol *tol __attribute__((unused))) /* intersection w/ ray */ /* The segment we're building */ /* The number of valid segments built */ @@ -349,7 +349,7 @@ HIDDEN int -state1(struct seg *seghead, struct seg **seg_p, int *seg_count, struct hitmiss *a_hit, struct soltab *stp, struct application *ap, struct bn_tol *tol) +state1(struct seg *seghead __attribute__((unused)), struct seg **seg_p, int *seg_count __attribute__((unused)), struct hitmiss *a_hit, struct soltab *stp, struct application *ap, struct bn_tol *tol __attribute__((unused))) /* intersection w/ ray */ /* The segment we're building */ /* The number of valid segments built */ @@ -359,6 +359,8 @@ { int ret_val = -1; + if (stp) RT_CK_SOLTAB(stp); + if (ap) RT_CK_APPLICATION(ap); NMG_CK_HITMISS(a_hit); switch (a_hit->in_out) { @@ -970,7 +972,7 @@ HIDDEN void -visitor(long int *l_p, genptr_t tbl, int after) +visitor(long int *l_p, genptr_t tbl, int unused __attribute__((unused))) { (void)bu_ptbl_ins_unique((struct bu_ptbl *)tbl, l_p); } @@ -1066,7 +1068,7 @@ HIDDEN void -unresolved(struct hitmiss *a_hit, struct hitmiss *next_hit, struct bu_ptbl *a_tbl, struct bu_ptbl *next_tbl, struct hitmiss *hd, struct ray_data *rd) +unresolved(struct hitmiss *next_hit, struct bu_ptbl *a_tbl, struct bu_ptbl *next_tbl, struct hitmiss *hd, struct ray_data *rd) { struct hitmiss *hm; @@ -1198,8 +1200,7 @@ a_hit->inbound_use = long_ptr; } else - unresolved(a_hit, next_hit, - a_tbl, next_tbl, hd, rd); + unresolved(next_hit, a_tbl, next_tbl, hd, rd); } Modified: brlcad/trunk/src/librt/primitives/nmg/nmg_tri.c =================================================================== --- brlcad/trunk/src/librt/primitives/nmg/nmg_tri.c 2009-12-31 10:28:51 UTC (rev 37092) +++ brlcad/trunk/src/librt/primitives/nmg/nmg_tri.c 2009-12-31 10:48:25 UTC (rev 37093) @@ -1139,8 +1139,8 @@ * departing edges have the min/max dot product with the direction vector. * */ -static void -pick_edges(struct vertex *v, struct vertexuse **vu_first, int *min_dir, struct vertexuse **vu_last, int *max_dir, struct faceuse *fu, const struct bn_tol *tol, fastf_t *dir) +HIDDEN void +pick_edges(struct vertex *v, struct vertexuse **vu_first, int *min_dir, struct vertexuse **vu_last, int *max_dir, struct faceuse *fu, fastf_t *dir) /* 1: forward -1 reverse */ @@ -1403,7 +1403,7 @@ * that should be the parameters to nmg_cut_loop() and nmg_join_loop(). */ void -nmg_find_first_last_use_of_v_in_fu(struct vertex *v, struct vertexuse **first_vu, struct vertexuse **last_vu, fastf_t *dir, struct faceuse *fu, const struct bn_tol *tol) +nmg_find_first_last_use_of_v_in_fu(struct vertex *v, struct vertexuse **first_vu, struct vertexuse **last_vu, fastf_t *dir, struct faceuse *fu, const struct bn_tol *tol __attribute__((unused))) { struct vertexuse *vu_first, *vu_last; int max_dir, min_dir; /* 1: forward -1 reverse */ @@ -1427,7 +1427,7 @@ V3ARGS(v->vg_p->coord), V3ARGS(dir)); /* go find the edges which are "closest" to the direction vector */ - pick_edges(v, &vu_first, &min_dir, &vu_last, &max_dir, fu, tol, dir); + pick_edges(v, &vu_first, &min_dir, &vu_last, &max_dir, fu, dir); /* Now we know which 2 edges are most important to look at. @@ -2256,8 +2256,8 @@ * * Given a unimonotone loopuse, triangulate it into multiple loopuses */ -static void -cut_unimonotone(struct bu_list *tbl2d, struct bu_list *tlist, struct loopuse *lu, const struct bn_tol *tol) +HIDDEN void +cut_unimonotone(struct bu_list *tbl2d, struct loopuse *lu, const struct bn_tol *tol) { struct pt2d *min, *max, *new, *first=NULL, *prev, *next, *current; struct edgeuse *eu; @@ -2517,9 +2517,9 @@ triangulate: if (rt_g.NMG_debug & DEBUG_TRI) { - vect_t N; - NMG_GET_FU_NORMAL(N, fu); - bu_log("---------------- proceeding to triangulate face %g %g %g\n", V3ARGS(N)); + vect_t normal; + NMG_GET_FU_NORMAL(normal, fu); + bu_log("---------------- proceeding to triangulate face %g %g %g\n", V3ARGS(normal)); } @@ -2546,11 +2546,11 @@ } if (rt_g.NMG_debug & DEBUG_TRI) { - struct pt2d *pt; + struct pt2d *point; bu_log("Face Flattened\n"); bu_log("Vertex list:\n"); - for (BU_LIST_FOR(pt, pt2d, tbl2d)) { - bu_log("\tpt2d %26.20e %26.20e\n", pt->coord[0], pt->coord[1]); + for (BU_LIST_FOR(point, pt2d, tbl2d)) { + bu_log("\tpt2d %26.20e %26.20e\n", point->coord[0], point->coord[1]); } nmg_tri_plfu(fu, tbl2d); @@ -2615,7 +2615,7 @@ vert_count = 0; for (BU_LIST_FOR(eu, edgeuse, &lu->down_hd)) { if (++vert_count > 3) { - cut_unimonotone(tbl2d, &tlist, lu, tol); + cut_unimonotone(tbl2d, lu, tol); if (rt_g.NMG_debug & DEBUG_TRI) { sprintf(db_name, "uni_mono%d.g", monotone++); Modified: brlcad/trunk/src/librt/primitives/nmg/nmg_tri_mc.c =================================================================== --- brlcad/trunk/src/librt/primitives/nmg/nmg_tri_mc.c 2009-12-31 10:28:51 UTC (rev 37092) +++ brlcad/trunk/src/librt/primitives/nmg/nmg_tri_mc.c 2009-12-31 10:48:25 UTC (rev 37093) @@ -63,10 +63,6 @@ void nmg_triangulate_model_mc(struct model *m, const struct bn_tol *tol) { - struct nmgregion *r; - struct shell *s; - struct faceuse *fu; - BN_CK_TOL(tol); NMG_CK_MODEL(m); nmg_vmodel(m); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |