]> granicus.if.org Git - graphviz/commitdiff
Fix warning messages in changed minmax_edges2 function
authorerg <devnull@localhost>
Thu, 26 Jan 2006 22:53:35 +0000 (22:53 +0000)
committererg <devnull@localhost>
Thu, 26 Jan 2006 22:53:35 +0000 (22:53 +0000)
lib/dotgen/rank.c

index 0ad5272a1f1b2d1a2a9800b76ae33c30e7fcc905..3363089b52a3f2ac58e18513fc3a1ffc92a66f35 100644 (file)
@@ -362,14 +362,19 @@ minmax_edges2(graph_t * g, point slen)
     node_t *n;
     edge_t *e = 0;
 
-    if ((GD_maxset(g) == NULL) && (GD_minset(g) == NULL)) return;
-    for (n = agfstnode(g); n; n = agnxtnode(g, n)) {
-       if (n != UF_find(n))
-           continue;
-       if ((ND_out(n).size == 0) && GD_maxset(g) && (n != GD_maxset(g)))
-           e = virtual_edge(n, GD_maxset(g), NULL)->u.minlen = slen.y;
-       if ((ND_in(n).size == 0) && GD_minset(g) && (n != GD_minset(g)))
-           e = virtual_edge(GD_minset(g), n, NULL)->u.minlen = slen.x;
+    if ((GD_maxset(g)) || (GD_minset(g))) {
+       for (n = agfstnode(g); n; n = agnxtnode(g, n)) {
+           if (n != UF_find(n))
+               continue;
+           if ((ND_out(n).size == 0) && GD_maxset(g) && (n != GD_maxset(g))) {
+               e = virtual_edge(n, GD_maxset(g), NULL);
+               ED_minlen(e) = slen.y;
+           }
+           if ((ND_in(n).size == 0) && GD_minset(g) && (n != GD_minset(g))) {
+               e = virtual_edge(GD_minset(g), n, NULL);
+               ED_minlen(e) = slen.x;
+           }
+       }
     }
     return (e != 0);
 }