From e20473ad1f730c3a0550825cc3a79c13bd02346f Mon Sep 17 00:00:00 2001 From: Magnus Jacobsson Date: Mon, 31 Aug 2020 21:51:45 +0200 Subject: [PATCH] Remove obsolete code within #ifdef OLD in lib/circogen Was obsolete already in the initial version 16 years ago. --- lib/circogen/circpos.c | 15 ------ lib/circogen/nodelist.c | 112 ---------------------------------------- lib/circogen/stack.c | 13 ----- 3 files changed, 140 deletions(-) diff --git a/lib/circogen/circpos.c b/lib/circogen/circpos.c index ac1f91bdd..5015f68c2 100644 --- a/lib/circogen/circpos.c +++ b/lib/circogen/circpos.c @@ -58,9 +58,6 @@ getRotation(block_t * sn, Agraph_t * g, double x, double y, double theta) int count; subg = sn->sub_graph; -#ifdef OLD - parent = sn->parent; -#endif list = sn->circle_list; @@ -79,18 +76,6 @@ getRotation(block_t * sn, Agraph_t * g, double x, double y, double theta) /* Find node in block connected to block's parent */ neighbor = CHILD(sn); -#ifdef OLD - for (e = agfstedge(g, parent); e; e = agnxtedge(g, e, parent)) { - n = e->head; - if (n == parent) - n = e->tail; - - if ((BLOCK(n) == sn) && (PARENT(n) == parent)) { - neighbor = n; - break; - } - } -#endif newX = ND_pos(neighbor)[0] + x; newY = ND_pos(neighbor)[1] + y; mindist2 = LEN2(newX, newY); /* save sqrts by using sqr of dist to find min */ diff --git a/lib/circogen/nodelist.c b/lib/circogen/nodelist.c index 2ef2bff81..39b3f913f 100644 --- a/lib/circogen/nodelist.c +++ b/lib/circogen/nodelist.c @@ -72,59 +72,6 @@ void appendNodelist(nodelist_t * list, nodelistitem_t * one, Agnode_t * n) } } -#ifdef OLD -/* addNodelist: - * Adds node to end of list if not already present. - */ -void addNodelist(nodelist_t * list, Agnode_t * n) -{ - nodelistitem_t *temp; - nodelistitem_t *item = 0; - - for (temp = list->first; temp; temp = temp->next) { - if (n == temp->curr) { - item = temp; - break; - } - } - - if (item) - return; - - item = init_nodelistitem(n); - if (list->last) { - list->last->next = item; - item->prev = list->last; - } else - list->first = item; - list->last = item; - list->sz++; -} - -void removeNodelist(nodelist_t * list, Agnode_t * n) -{ - nodelistitem_t *temp; - - for (temp = list->first; temp; temp = temp->next) { - if (n == temp->curr) { - list->sz--; - if (temp->prev == NULL) { /* the first node */ - list->first = temp->next; - } else { - temp->prev->next = temp->next; - } - if (temp == list->last) { /* the last node */ - list->last = temp->prev; - } else { - temp->next->prev = temp->prev; - } - free(temp); - return; - } - } -} -#endif - /* reverseNodelist; * Destructively reverse a list. */ @@ -255,53 +202,7 @@ insertNodelist(nodelist_t * list, Agnode_t * cn, Agnode_t * neighbor, int sizeNodelist(nodelist_t * list) { return list->sz; -#ifdef OLD - int i = 0; - nodelistitem_t *temp = NULL; - - temp = list->first; - while (temp) { - i++; - temp = temp->next; - } - return i; -#endif -} - -#ifdef OLD -/* node_exists: - * Return true if node is in list. - */ -int node_exists(nodelist_t * list, Agnode_t * n) -{ - nodelistitem_t *temp; - - for (temp = list->first; temp; temp = temp->next) { - if (temp->curr == n) { - return 1; - } - } - return 0; -} - -/* nodename_exists: - * Return true if node with given name is in list. - * Assumes n == np->name for some node np; - */ -int nodename_exists(nodelist_t * list, char *n) -{ - nodelistitem_t *temp; - - temp = list->first; - - for (temp = list->first; temp; temp = temp->next) { - if (temp->curr->name == n) { - return 1; - } - } - return 0; } -#endif /* node_position: * Returns index of node n in list, starting at 0. @@ -310,19 +211,6 @@ int nodename_exists(nodelist_t * list, char *n) int node_position(nodelist_t * list, Agnode_t * n) { return POSITION(n); -#ifdef OLD - nodelistitem_t *temp; - int i = 0; - char *name = agnameof(n); - - for (temp = list->first; temp; temp = temp->next) { - if (streq(agnameof(temp->curr),name)) { - return i; - } - i++; - } - return -1; -#endif } /* concatNodelist: diff --git a/lib/circogen/stack.c b/lib/circogen/stack.c index bfeacf049..d7b92cd25 100644 --- a/lib/circogen/stack.c +++ b/lib/circogen/stack.c @@ -67,19 +67,6 @@ int stackSize(nstack_t * s) int stackCheck(nstack_t * s, Agnode_t * n) { return ONSTACK(n); -#ifdef OLD - stackitem_t *top = s->top; - Agnode_t *node; - - while (top != NULL) { - node = top->data; - if (node == n) - return 1; - top = top->next; - } - - return 0; -#endif } #ifdef DEBUG -- 2.40.0