]> granicus.if.org Git - graphviz/commitdiff
dotgen: remove unnecessary parens
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 28 Jan 2023 16:55:11 +0000 (08:55 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Mon, 30 Jan 2023 15:43:10 +0000 (07:43 -0800)
lib/dotgen/compound.c

index 6b4441482b9f3f104daaaca3093f98b52206fff8..8fcef9cc477248cb4d858b509216ccbe11327dec 100644 (file)
@@ -97,7 +97,7 @@ static int inBoxf(pointf p, boxf * bb)
 static graph_t *getCluster(char *cluster_name, Dt_t *map) {
     Agraph_t* sg;
 
-    if (!cluster_name || (*cluster_name == '\0'))
+    if (!cluster_name || *cluster_name == '\0')
        return NULL;
     sg = findCluster (map, cluster_name);
     if (sg == NULL) {
@@ -131,7 +131,7 @@ static int countVertCross(pointf * pts, double xcoord)
     for (i = 1; i <= 3; i++) {
        old_sign = sign;
        sign = CMP(pts[i].x, xcoord);
-       if ((sign != old_sign) && (old_sign != 0))
+       if (sign != old_sign && old_sign != 0)
            num_crossings++;
     }
     return num_crossings;
@@ -153,7 +153,7 @@ static int countHorzCross(pointf * pts, double ycoord)
     for (i = 1; i <= 3; i++) {
        old_sign = sign;
        sign = CMP(pts[i].y, ycoord);
-       if ((sign != old_sign) && (old_sign != 0))
+       if (sign != old_sign && old_sign != 0)
            num_crossings++;
     }
     return num_crossings;
@@ -184,8 +184,8 @@ findVertical(pointf * pts, double tmin, double tmax,
        return -1.0;
 
     /* if 1 crossing and on the line x == xcoord (within 0.005 point) */
-    if ((no_cross == 1) && (fabs(pts[3].x - xcoord) <= 0.005)) {
-       if ((ymin <= pts[3].y) && (pts[3].y <= ymax)) {
+    if (no_cross == 1 && fabs(pts[3].x - xcoord) <= 0.005) {
+       if (ymin <= pts[3].y && pts[3].y <= ymax) {
            return tmax;
        } else
            return -1.0;
@@ -226,8 +226,8 @@ findHorizontal(pointf * pts, double tmin, double tmax,
        return -1.0;
 
     /* if 1 crossing and on the line y == ycoord (within 0.005 point) */
-    if ((no_cross == 1) && (fabs(pts[3].y - ycoord) <= 0.005)) {
-       if ((xmin <= pts[3].x) && (pts[3].x <= xmax)) {
+    if (no_cross == 1 && fabs(pts[3].y - ycoord) <= 0.005) {
+       if (xmin <= pts[3].x && pts[3].x <= xmax) {
            return tmax;
        } else
            return -1.0;
@@ -263,25 +263,25 @@ static int splineIntersectf(pointf * pts, boxf * bb)
     }
 
     t = findVertical(pts, 0.0, 1.0, bb->LL.x, bb->LL.y, bb->UR.y);
-    if ((t >= 0) && (t < tmin)) {
+    if (t >= 0 && t < tmin) {
        Bezier(origpts, 3, t, pts, NULL);
        tmin = t;
     }
     t = findVertical(pts, 0.0, MIN(1.0, tmin), bb->UR.x, bb->LL.y,
                     bb->UR.y);
-    if ((t >= 0) && (t < tmin)) {
+    if (t >= 0 && t < tmin) {
        Bezier(origpts, 3, t, pts, NULL);
        tmin = t;
     }
     t = findHorizontal(pts, 0.0, MIN(1.0, tmin), bb->LL.y, bb->LL.x,
                       bb->UR.x);
-    if ((t >= 0) && (t < tmin)) {
+    if (t >= 0 && t < tmin) {
        Bezier(origpts, 3, t, pts, NULL);
        tmin = t;
     }
     t = findHorizontal(pts, 0.0, MIN(1.0, tmin), bb->UR.y, bb->LL.x,
                       bb->UR.x);
-    if ((t >= 0) && (t < tmin)) {
+    if (t >= 0 && t < tmin) {
        Bezier(origpts, 3, t, pts, NULL);
        tmin = t;
     }
@@ -379,7 +379,7 @@ static void makeCompoundEdge(edge_t *e, Dt_t *clustMap) {
                }
            } else {
                for (endi = 0; endi < size - 1; endi += 3) {
-                   if (splineIntersectf(&(bez->list[endi]), bb))
+                   if (splineIntersectf(&bez->list[endi], bb))
                        break;
                }
                if (endi == size - 1) { /* no intersection */