]> granicus.if.org Git - graphviz/commitdiff
Additional fix to make sure all declarations occur before statements
authorEmden Gansner <erg@research.att.com>
Thu, 13 Sep 2012 15:41:53 +0000 (11:41 -0400)
committerEmden Gansner <erg@research.att.com>
Thu, 13 Sep 2012 15:41:53 +0000 (11:41 -0400)
lib/neatogen/constraint.c

index 578fae6edbb454c4f8b120d21db5893de4f91b84..7c6411d347663a6fa85c80a1a9b882b9c3fb89ce 100644 (file)
@@ -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;