From 8455c14f6bcee89ba120c403eb629e1d230e7f1b Mon Sep 17 00:00:00 2001 From: Peter Clifton Date: Sun, 24 Jul 2011 01:03:53 +0100 Subject: [PATCH] gts: Fixup warnings due to assigned but unused variables As I'm not 100% familiar with this code, I have commented out some of the redundant code rather than deleting it completely. --- gts/boolean.c | 32 ++++++++++++++++---------------- gts/cdt.c | 4 ++-- gts/edge.c | 3 --- gts/partition.c | 6 +++--- gts/split.c | 6 +++--- 5 files changed, 24 insertions(+), 27 deletions(-) diff --git a/gts/boolean.c b/gts/boolean.c index 8b76d42108..79f3e0c8b2 100644 --- a/gts/boolean.c +++ b/gts/boolean.c @@ -379,10 +379,10 @@ static gint intersection_orientation (GtsTriangle * t1, GTS_POINT (v2)); } -#define UPDATE_ORIENTATION if (o > 0) { vi2 = v; e2 = e; } else { vi2 = vi1;\ - e2 = e1;\ - vi1 = v;\ - e1 = e; } +#define UPDATE_ORIENTATION if (o > 0) { vi2 = v; /* e2 = e; */ } else { vi2 = vi1;\ + /* e2 = e1; */\ + vi1 = v;\ + /* e1 = e; */ } static void intersect_edges (GtsBBox * bb1, GtsBBox * bb2, GtsSurfaceInter * si) @@ -391,15 +391,15 @@ static void intersect_edges (GtsBBox * bb1, GtsBBox * bb2, GtsTriangle * t1 = GTS_TRIANGLE (bb1->bounded); GtsTriangle * t2 = GTS_TRIANGLE (bb2->bounded); GtsVertex * v, * vi1 = NULL, * vi2 = NULL; - GtsEdge * e1 = NULL, * e2 = NULL, * e; + //GtsEdge * e1 = NULL, * e2 = NULL, * e; vi1 = intersects (t2->e1, t1, s1); - e1 = t2->e1; + //e1 = t2->e1; v = intersects (t2->e2, t1, s1); - e = t2->e2; + //e = t2->e2; if (!vi1) { vi1 = v; - e1 = e; + //e1 = e; } else if (v) { gint o = intersection_orientation (t2, t2->e2, t1); @@ -407,10 +407,10 @@ static void intersect_edges (GtsBBox * bb1, GtsBBox * bb2, } if (!vi2) { v = intersects (t2->e3, t1, s1); - e = t2->e3; + //e = t2->e3; if (!vi1) { vi1 = v; - e1 = e; + //e1 = e; } else if (v) { gint o = intersection_orientation (t2, t2->e3, t1); @@ -419,10 +419,10 @@ static void intersect_edges (GtsBBox * bb1, GtsBBox * bb2, } if (!vi2) { v = intersects (t1->e1, t2, s1); - e = t1->e1; + //e = t1->e1; if (!vi1) { vi1 = v; - e1 = e; + //e1 = e; } else if (v) { gint o = - intersection_orientation (t1, t1->e1, t2); @@ -431,10 +431,10 @@ static void intersect_edges (GtsBBox * bb1, GtsBBox * bb2, } if (!vi2) { v = intersects (t1->e2, t2, s1); - e = t1->e2; + //e = t1->e2; if (!vi1) { vi1 = v; - e1 = e; + //e1 = e; } else if (v) { gint o = - intersection_orientation (t1, t1->e2, t2); @@ -443,10 +443,10 @@ static void intersect_edges (GtsBBox * bb1, GtsBBox * bb2, } if (!vi2) { v = intersects (t1->e3, t2, s1); - e = t1->e3; + //e = t1->e3; if (!vi1) { vi1 = v; - e1 = e; + //e1 = e; } else if (v) { gint o = - intersection_orientation (t1, t1->e3, t2); diff --git a/gts/cdt.c b/gts/cdt.c index 2038ab5755..61c4eb56b6 100644 --- a/gts/cdt.c +++ b/gts/cdt.c @@ -974,7 +974,7 @@ GSList * gts_delaunay_add_constraint (GtsSurface * surface, GtsConstraint * c) { GSList * constraints; - GtsVertex * v1, * v2; + GtsVertex * v1; //, * v2; GSList * left = NULL, * right = NULL; GtsFace * ref = NULL; @@ -983,7 +983,7 @@ GSList * gts_delaunay_add_constraint (GtsSurface * surface, g_return_val_if_fail (GTS_IS_CONSTRAINT (c), NULL); v1 = GTS_SEGMENT (c)->v1; - v2 = GTS_SEGMENT (c)->v2; + //v2 = GTS_SEGMENT (c)->v2; gts_allow_floating_edges = TRUE; constraints = remove_intersected_vertex (GTS_SEGMENT (c), v1, surface, diff --git a/gts/edge.c b/gts/edge.c index fde7d87661..708c06c969 100644 --- a/gts/edge.c +++ b/gts/edge.c @@ -377,12 +377,9 @@ static void triangle_vertices_edges (GtsTriangle * t, gboolean gts_edge_belongs_to_tetrahedron (GtsEdge * e) { GSList * i; - GtsVertex * v1, * v2; g_return_val_if_fail (e != NULL, FALSE); - v1 = GTS_SEGMENT (e)->v1; - v2 = GTS_SEGMENT (e)->v2; i = e->triangles; while (i) { GtsEdge * e1, * e2; diff --git a/gts/partition.c b/gts/partition.c index 16dc0e1c36..3b73e6896e 100644 --- a/gts/partition.c +++ b/gts/partition.c @@ -833,19 +833,19 @@ static void update_neighbors (GtsGNode * n, GtsGraphBisection * bg, if (gts_containee_is_contained (GTS_CONTAINEE (n1), GTS_CONTAINER (bg->g))) { GtsEHeap * h; - GtsGraph * g1, * g2; + GtsGraph /* * g1,*/ * g2; GHashTable * bg1; if (gts_containee_is_contained (GTS_CONTAINEE (n1), GTS_CONTAINER (bg->g1))) { h = h1; - g1 = bg->g1; + //g1 = bg->g1; g2 = bg->g2; bg1 = bg->bg1; } else { h = h2; - g1 = bg->g2; + //g1 = bg->g2; g2 = bg->g1; bg1 = bg->bg2; } diff --git a/gts/split.c b/gts/split.c index 8283e17e63..43fea3a051 100644 --- a/gts/split.c +++ b/gts/split.c @@ -923,8 +923,8 @@ GtsSplit * gts_split_new (GtsSplitClass * klass, GtsObject * o2) { GtsSplit * vs; - GtsVertex * v1, * v2; #ifndef DYNAMIC_SPLIT + GtsVertex * v1, * v2; GtsEdge * e; GSList * i; GtsSplitCFace * cf; @@ -939,12 +939,12 @@ GtsSplit * gts_split_new (GtsSplitClass * klass, vs->v = v; vs->v1 = o1; vs->v2 = o2; - v1 = GTS_SPLIT_V1 (vs); - v2 = GTS_SPLIT_V2 (vs); #ifdef DYNAMIC_SPLIT vs->ncf = 0; vs->cfaces = NULL; #else + v1 = GTS_SPLIT_V1 (vs); + v2 = GTS_SPLIT_V2 (vs); g_assert ((e = GTS_EDGE (gts_vertices_are_connected (v1, v2)))); i = e->triangles; vs->ncf = g_slist_length (i); -- 2.11.4.GIT