From 6885128a0d3f09569068ca9634cf7a9f5ab7ded3 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Thu, 24 Nov 2022 08:54:06 -0800 Subject: [PATCH] ortho: remove 'TRSIZE' and rely on trapezoid collection length We no longer need the global here. Apart from progress towards #56, this makes progress towards thread-safety too. Gitlab: #56 --- lib/ortho/trapezoid.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/ortho/trapezoid.c b/lib/ortho/trapezoid.c index 4645ad4b0..8df98720d 100644 --- a/lib/ortho/trapezoid.c +++ b/lib/ortho/trapezoid.c @@ -57,7 +57,6 @@ typedef struct { static int q_idx; static int tr_idx; static int QSIZE; -static int TRSIZE; /* Return a new node to be added into the query tree */ static int newnode(void) @@ -73,7 +72,7 @@ static int newnode(void) /* Return a free trapezoid */ static int newtrap(traps_t *tr) { - if (tr_idx < TRSIZE) { + if (tr_idx < tr->length) { tr->data[tr_idx].lseg = -1; tr->data[tr_idx].rseg = -1; tr->data[tr_idx].state = ST_VALID; @@ -1019,7 +1018,6 @@ construct_trapezoids(int nseg, segment_t *seg, int *permute, traps_t* tr) { qnode_t* qs; QSIZE = 2 * tr->length; - TRSIZE = tr->length; qs = gv_calloc(2 * tr->length, sizeof(qnode_t)); q_idx = tr_idx = 1; memset(tr->data, 0, tr->length * sizeof(trap_t)); -- 2.40.0