]> granicus.if.org Git - graphviz/commitdiff
use agfindnode/agfindedge macros
authorellson <devnull@localhost>
Thu, 23 Oct 2008 20:23:55 +0000 (20:23 +0000)
committerellson <devnull@localhost>
Thu, 23 Oct 2008 20:23:55 +0000 (20:23 +0000)
lib/common/emit.c
lib/common/htmltable.c
lib/common/utils.c

index 29a166f896938391848e5659c235db3e835f7a42..063227dc825d8e60327ad77acdc7f24d504dfc56 100644 (file)
@@ -2074,11 +2074,7 @@ static void init_job_viewport(GVJ_t * job, graph_t * g)
         junk = malloc(strlen(str)+1);
        rv = sscanf(str, "%lf,%lf,%lf,\'%[^\']\'", &X, &Y, &Z, nodename);
        if (rv == 4) {
-#ifndef WITH_CGRAPH
            n = agfindnode(g->root, nodename);
-#else
-           n = agnode(g->root, nodename, 0);
-#endif
            if (n) {
                x = ND_coord(n).x;
                y = ND_coord(n).y;
@@ -2087,11 +2083,7 @@ static void init_job_viewport(GVJ_t * job, graph_t * g)
        else {
            rv = sscanf(str, "%lf,%lf,%lf,%[^,]%s", &X, &Y, &Z, nodename, junk);
            if (rv == 4) {
-#ifndef WITH_CGRAPH
                 n = agfindnode(g->root, nodename);
-#else
-                n = agnode(g->root, nodename, 0);
-#endif
                 if (n) {
                     x = ND_coord(n).x;
                     y = ND_coord(n).y;
index 272271bbeedaeeab3317076d771d41c6feee7f83..c008bf2f4de8663f702724c6a34a66f86f3f553b 100644 (file)
@@ -1106,11 +1106,10 @@ static void checkChain(graph_t * g)
     edge_t *e;
     t = GD_nlist(g);
     for (h = ND_next(t); h; h = ND_next(h)) {
+       if (!agfindedge(g, t, h)) {
 #ifdef WITH_CGRAPH
-        if (!agedge(g, t, h, (char *)NULL, FALSE)) {
-            e = agedge(g, t, h,NULL,1);
+            e = agedge(g, t, h, NULL, 1);
 #else
-       if (!agfindedge(g, t, h)) {
            e = agedge(g, t, h);
 #endif
            ED_minlen(e) = 0;
@@ -1190,13 +1189,11 @@ void makeGraphs(htmltbl_t * tbl, graph_t * rowg, graph_t * colg)
     for (cells = tbl->u.n.cells; *cells; cells++) {
         int x, y, c, r;
        cp = *cells;
-#ifdef WITH_CGRAPH
-       t = agnode(colg, nToName(cp->col),0);
-       h = agnode(colg, nToName(cp->col + cp->cspan),0);
-       e = agedge(colg, t, h,NULL,1);
-#else
        t = agfindnode(colg, nToName(cp->col));
        h = agfindnode(colg, nToName(cp->col + cp->cspan));
+#ifdef WITH_CGRAPH
+       e = agedge(colg, t, h, NULL, 1);
+#else
        e = agedge(colg, t, h);
 #endif
         x = 0;
@@ -1211,13 +1208,11 @@ void makeGraphs(htmltbl_t * tbl, graph_t * rowg, graph_t * colg)
        elist_append(e, ND_out(t));
        elist_append(e, ND_in(h));
 
-#ifdef WITH_CGRAPH
-       t = agnode(rowg, nToName(cp->row),0);
-       h = agnode(rowg, nToName(cp->row + cp->rspan),0);
-       e = agedge(rowg, t, h,NULL,1);
-#else
        t = agfindnode(rowg, nToName(cp->row));
        h = agfindnode(rowg, nToName(cp->row + cp->rspan));
+#ifdef WITH_CGRAPH
+       e = agedge(rowg, t, h, NULL, 1);
+#else
        e = agedge(rowg, t, h);
 #endif
         y = 0;
index 79ecf7c87e4054859569fa7646e55b6021b7acf1..366f9ce0769829181f44b2a7b4b23b1f9b0ecf5b 100644 (file)
@@ -299,11 +299,7 @@ edge_t *debug_getedge(graph_t * g, char *s0, char *s1)
     n0 = agfindnode(g, s0);
     n1 = agfindnode(g, s1);
     if (n0 && n1)
-#ifdef WITH_CGRAPH
-        return agedge(g, n0, n1, (char *)NULL, FALSE);
-#else
        return agfindedge(g, n0, n1);
-#endif
     else
        return NULL;
 }
@@ -1229,21 +1225,17 @@ static node_t *mapN(node_t * n, graph_t * clg)
 #ifndef WITH_CGRAPH
     aginsert(clg, n);
 #else /* WITH_CGRAPH */
-    agsubnode(clg, n,1);
+    agsubnode(clg, n, 1);
 #endif /* WITH_CGRAPH */
     name = strchr(agnameof(n), ':');
     assert(name);
     name++;
-#ifndef WITH_CGRAPH
     if ((nn = agfindnode(g, name)))
-#else /* WITH_CGRAPH */
-    if ((nn = agnode(g, name,0)))
-#endif /* WITH_CGRAPH */
        return nn;
 #ifndef WITH_CGRAPH
     nn = agnode(g, name);
 #else /* WITH_CGRAPH */
-    nn = agnode(g, name,1);
+    nn = agnode(g, name, 1);
     agbindrec(nn, "Agnodeinfo_t", sizeof(Agnodeinfo_t), TRUE); //node custom data
 #endif /* WITH_CGRAPH */