]> granicus.if.org Git - graphviz/commitdiff
fdpgen: remove unnecessary parens
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 28 Dec 2022 23:17:03 +0000 (15:17 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 1 Jan 2023 00:38:35 +0000 (16:38 -0800)
lib/fdpgen/dbg.c
lib/fdpgen/layout.c
lib/fdpgen/xlayout.c

index d377e5ad48d15d550febae748a2485c4434f1b40..7c6e52eac24000498b80263532d28cc0d93e5b79 100644 (file)
@@ -362,7 +362,7 @@ static void pswrite(Agraph_t * g, FILE * fp, int expMode)
        wd = data->wd;
        ht = data->ht;
        fprintf(fp, "%f %f %f %f doBox\n", wd, ht,
-               data->pos.x - (wd / 2), data->pos.y - (ht / 2));
+               data->pos.x - wd / 2, data->pos.y - ht / 2);
     }
 #else
     for (n = agfstnode(g); n; n = agnxtnode(g, n)) {
@@ -372,9 +372,9 @@ static void pswrite(Agraph_t * g, FILE * fp, int expMode)
            double r;
            wd = ND_width(n);
            ht = ND_height(n);
-           r = sqrt((wd * wd / 4) + ht * ht / 4);
+           r = sqrt(wd * wd / 4 + ht * ht / 4);
            fprintf(fp, "%f inch %f inch %f inch %f inch doBox\n", wd, ht,
-                   ND_pos(n)[0] - (wd / 2), ND_pos(n)[1] - (ht / 2));
+                   ND_pos(n)[0] - wd / 2, ND_pos(n)[1] - ht / 2);
            fprintf(fp, "%f inch %f inch %f inch drawCircle\n",
                    ND_pos(n)[0], ND_pos(n)[1], r);
        } else {
index 6d1593877d00b713519164d106f5af9bd40ba5b3..66d5fc3abbf74e3fb8b5913b999c2e434d56a704 100644 (file)
@@ -354,7 +354,7 @@ static void addEdge(edge_t * de, edge_t * e)
     short cnt = ED_count(de);
     edge_t **el;
 
-    el = (edge_t **) (ED_to_virt(de));
+    el = (edge_t**)ED_to_virt(de);
     el = gv_recalloc(el, cnt, cnt + 1, sizeof(edge_t*));
     el[cnt] = e;
     ED_to_virt(de) = (edge_t *) el;
index dc1ee641dfa4ed72d0c35822ca8003aa3ff85c27..8e10a64364e2195dac9da8d8aa891a691711469c 100644 (file)
@@ -334,7 +334,7 @@ static void applyAttr(Agnode_t * p, Agnode_t * q)
     xdelta = ND_pos(q)[0] - ND_pos(p)[0];
     ydelta = ND_pos(q)[1] - ND_pos(p)[1];
     dist = hypot(xdelta, ydelta);
-    force = (dout * dout) / (X_K * dist);
+    force = dout * dout / (X_K * dist);
 #elif defined(ALT)
     xdelta = ND_pos(q)[0] - ND_pos(p)[0];
     ydelta = ND_pos(q)[1] - ND_pos(p)[1];