constant globals checking
[ccc.git] / scc.c
diff --git a/scc.c b/scc.c
index 3c690a2..a3743e2 100644 (file)
--- a/scc.c
+++ b/scc.c
@@ -14,11 +14,6 @@ struct node {
        void *data;
 };
 
-struct edge2 {
-       struct node *from;
-       struct node *to;
-};
-
 int ptrcmp(const void *l, const void *r)
 {
        return ((ptrdiff_t)((struct node *)l)->data)
@@ -31,7 +26,7 @@ int nodecmp(const void *l, const void *r)
 }
 
 struct components *strongconnect(struct node *v, struct node **stack, int *sp,
-       int *index, int nedges, struct edge2 *edges, struct components *components)
+       int *index, int nedges, struct edge *edges, struct components *components)
 {
        struct node *w;
        v->index = *index;
@@ -76,7 +71,7 @@ struct components *scc(int nnodes, void **nodedata, int nedges, struct edge *edg
                        .onStack=false, .data=nodedata[i]};
        qsort(nodes, nnodes, sizeof(struct node), ptrcmp);
 
-       struct edge2 *edges = safe_malloc(nedges*sizeof(struct edge2));
+       struct edge *edges = safe_malloc(nedges*sizeof(struct edge));
        for (int i = 0; i<nedges; i++) {
                struct node *from = bsearch(edgedata[i].from, nodes, nnodes,
                        sizeof(struct node), nodecmp);
@@ -90,7 +85,7 @@ struct components *scc(int nnodes, void **nodedata, int nedges, struct edge *edg
                        fprintf(stderr, "edge to references unknown node\n");
                        goto end;
                }
-               edges[i] = (struct edge2){.from=from, .to=to};
+               edges[i] = (struct edge){.from=from, .to=to};
        }
 
        struct node **stack = safe_malloc(nnodes*sizeof(struct node *));