From: Emden Gansner Date: Thu, 13 Sep 2012 15:41:53 +0000 (-0400) Subject: Additional fix to make sure all declarations occur before statements X-Git-Tag: LAST_LIBGRAPH~32^2~310 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=58dcfd2bdf480a60c1cbcb5e38eec5c00656bb9e;p=graphviz Additional fix to make sure all declarations occur before statements --- diff --git a/lib/neatogen/constraint.c b/lib/neatogen/constraint.c index 578fae6ed..7c6411d34 100644 --- a/lib/neatogen/constraint.c +++ b/lib/neatogen/constraint.c @@ -227,15 +227,15 @@ static graph_t *mkNConstraintG(graph_t * g, Dt_t * list, { nitem *p; nitem *nxp; + node_t *n; + edge_t *e; + node_t *lastn = NULL; #ifndef WITH_CGRAPH graph_t *cg = agopen("cg", AGDIGRAPHSTRICT); #else graph_t *cg = agopen("cg", Agstrictdirected, NIL(Agdisc_t *)); agbindrec(cg, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE); // graph custom data #endif - node_t *n; - edge_t *e; - node_t *lastn = NULL; for (p = (nitem *) dtflatten(list); p; p = (nitem *) dtlink(list, (Dtlink_t *) p)) { @@ -316,12 +316,6 @@ static graph_t *mkConstraintG(graph_t * g, Dt_t * list, nitem *p; nitem *nxt = NULL; nitem *nxp; -#ifndef WITH_CGRAPH - graph_t *cg = agopen("cg", AGDIGRAPHSTRICT); -#else - graph_t *cg = agopen("cg", Agstrictdirected, NIL(Agdisc_t *)); - agbindrec(cg, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE); // graph custom data -#endif graph_t *vg; node_t *prev = NULL; node_t *root = NULL; @@ -333,6 +327,12 @@ static graph_t *mkConstraintG(graph_t * g, Dt_t * list, double root_val; #endif node_t *lastn = NULL; +#ifndef WITH_CGRAPH + graph_t *cg = agopen("cg", AGDIGRAPHSTRICT); +#else + graph_t *cg = agopen("cg", Agstrictdirected, NIL(Agdisc_t *)); + agbindrec(cg, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE); // graph custom data +#endif /* count distinct nodes */ cnt = 0;