We no longer need the global here. Apart from progress towards #56, this
makes progress towards thread-safety too.
Gitlab: #56
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)
/* 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;
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));