]> 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/neatogen/stuff.c
lib/twopigen/twopiinit.c
tclpkg/gv/gv.cpp
tclpkg/tcldot/tcldot.c

index 65d29e272a157757cf425033f2a2bea99fea5e8b..ee5207da9af8b2278ffb6d372944c48acdc75999 100644 (file)
@@ -384,13 +384,7 @@ void diffeq_model(graph_t * G, int nG)
     for (i = 0; i < nG; i++) {
        for (j = 0; j < i; j++) {
            f = Spring_coeff / (D[i][j] * D[i][j]);
-#ifndef WITH_CGRAPH
-           if ((e = agfindedge(G, GD_neato_nlist(G)[i],
-                   GD_neato_nlist(G)[j])))
-#else /* WITH_CGRAPH */
-           if ((e = agedge(G, GD_neato_nlist(G)[i],
-                   GD_neato_nlist(G)[j],(char*)0,0)))
-#endif /* WITH_CGRAPH */
+           if ((e = agfindedge(G, GD_neato_nlist(G)[i], GD_neato_nlist(G)[j])))
                f = f * ED_factor(e);
            K[i][j] = K[j][i] = f;
        }
index cdae79fe0a7161db7f6e46b4058d9523d68f20c8..3432cf4e075315f90a0b8254eeb6143960bc4713 100644 (file)
@@ -72,11 +72,7 @@ void twopi_layout(Agraph_t * g)
     twopi_init_graph(g);
     s = agget(g, "root");
     if (s && (*s != '\0')) {
-#ifndef WITH_CGRAPH
        ctr = agfindnode(g, s);
-#else /* WITH_CGRAPH */
-       ctr = agnode(g, s,0);
-#endif /* WITH_CGRAPH */
        if (!ctr) {
            agerr(AGWARN, "specified root node \"%s\" was not found.", s);
            agerr(AGPREV, "Using default calculation for root node\n");
index de0e89bff3da41571e8463ffbf0adc45956455c2..d5a126bd66fb794aac3624a660504b1491312c32 100644 (file)
@@ -321,11 +321,7 @@ Agedge_t *findedge(Agnode_t *t, Agnode_t *h)
 {
     if (!t || !h)
         return NULL;
-#ifndef WITH_CGRAPH
     return agfindedge(agraphof(t), t, h);
-#else
-    return agedge(agraphof(t), t, h, NULL, 0);
-#endif
 }
 
 Agsym_t *findattr(Agraph_t *g, char *name)
@@ -495,11 +491,7 @@ Agraph_t *nextsubg(Agraph_t *g, Agraph_t *sg)
     mg = agraphof(ng);
     if (!mg) 
         return NULL;
-#ifndef WITH_CGRAPH
     e = agfindedge(mg, ng, nsg);
-#else
-    e = agedge(mg, ng, nsg, NULL, 0);
-#endif
     if (!e) 
         return NULL;
     e = agnxtout(mg, e);
@@ -543,11 +535,7 @@ Agraph_t *nextsupg(Agraph_t *g, Agraph_t *sg)
     mg = agraphof(ng);
     if (!mg) 
         return NULL;
-#ifndef WITH_CGRAPH
     e = agfindedge(mg, nsg, ng);
-#else
-    e = agedge(mg, nsg, ng, NULL, 0);
-#endif
     if (!e) 
         return NULL;
     e = agnxtin(mg, e);
@@ -631,11 +619,7 @@ Agnode_t *nexthead(Agnode_t *n, Agnode_t *h)
     if (!n || !h)
         return NULL;
     g = agraphof(n);
-#ifndef WITH_CGRAPH
     e = agfindedge(g, n, h);
-#else
-    e = agedge(g, n, h, NULL, 0);
-#endif
     if (!e)
         return NULL;
     do {
@@ -721,11 +705,7 @@ Agnode_t *nexttail(Agnode_t *n, Agnode_t *t)
 
     if (!n || !t)
         return NULL;
-#ifndef WITH_CGRAPH
     e = agfindedge(g, t, n);
-#else
-    e = agedge(g, t, n, NULL, 0);
-#endif
     if (!e)
         return NULL;
     do {
index 478881c9a4debc72071963592915b890b18e1ca0..c2f1cc3cd13115b50f477ada0d46ba53c3ee1fe5 100644 (file)
@@ -852,27 +852,15 @@ static int graphcmd(ClientData clientData, Tcl_Interp * interp,
                             argv[0], " findedge tailnodename headnodename\"", NULL);
            return TCL_ERROR;
        }
-#ifndef WITH_CGRAPH
        if (!(tail = agfindnode(g, argv[2]))) {
-#else
-       if (!(tail = agnode(g, argv[2], 0))) {
-#endif
            Tcl_AppendResult(interp, "Tail node \"", argv[2], "\" not found.", NULL);
            return TCL_ERROR;
        }
-#ifndef WITH_CGRAPH
        if (!(head = agfindnode(g, argv[3]))) {
-#else
-       if (!(head = agnode(g, argv[3], 0))) {
-#endif
            Tcl_AppendResult(interp, "Head node \"", argv[3], "\" not found.", NULL);
            return TCL_ERROR;
        }
-#ifndef WITH_CGRAPH
        if (!(e = agfindedge(g, tail, head))) {
-#else
-       if (!(e = agedge(g, tail, head, NULL, 0))) {
-#endif
            Tcl_AppendResult(interp, "Edge \"", argv[2], " - ", argv[3], "\" not found.", NULL);
            return TCL_ERROR;
        }
@@ -885,11 +873,7 @@ static int graphcmd(ClientData clientData, Tcl_Interp * interp,
            Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], " findnode nodename\"", NULL);
            return TCL_ERROR;
        }
-#ifndef WITH_CGRAPH
        if (!(n = agfindnode(g, argv[2]))) {
-#else
-       if (!(n = agnode(g, argv[2], 0))) {
-#endif
            Tcl_AppendResult(interp, "Node not found.", NULL);
            return TCL_ERROR;
        }