]> granicus.if.org Git - graphviz/commitdiff
remove some no-op casts
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 18 Apr 2021 05:00:17 +0000 (22:00 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 24 Apr 2021 20:31:57 +0000 (13:31 -0700)
These pointers implicitly coerce.

lib/neatogen/heap.c
lib/neatogen/info.c
lib/neatogen/neatoinit.c
lib/neatogen/voronoi.c

index c2572562620c09e0e7d990ee3bab668f94bc3041..48ea43d0aec8e86086f37c526f2380e5e922a354 100644 (file)
@@ -47,7 +47,7 @@ void PQinsert(Halfedge * he, Site * v, double offset)
     ref(v);
     he->ystar = v->coord.y + offset;
     last = &PQhash[PQbucket(he)];
-    while ((next = last->PQnext) != (struct Halfedge *) NULL &&
+    while ((next = last->PQnext) != NULL &&
           (he->ystar > next->ystar ||
            (he->ystar == next->ystar
             && v->coord.x > next->vertex->coord.x))) {
@@ -62,14 +62,14 @@ void PQdelete(Halfedge * he)
 {
     Halfedge *last;
 
-    if (he->vertex != (Site *) NULL) {
+    if (he->vertex != NULL) {
        last = &PQhash[PQbucket(he)];
        while (last->PQnext != he)
            last = last->PQnext;
        last->PQnext = he->PQnext;
        --PQcount;
        deref(he->vertex);
-       he->vertex = (Site *) NULL;
+       he->vertex = NULL;
     }
 }
 
@@ -84,7 +84,7 @@ Point PQ_min(void)
 {
     Point answer;
 
-    while (PQhash[PQmin].PQnext == (struct Halfedge *) NULL) {
+    while (PQhash[PQmin].PQnext == NULL) {
        PQmin += 1;
     }
     answer.x = PQhash[PQmin].PQnext->vertex->coord.x;
@@ -118,7 +118,7 @@ void PQinitialize(void)
     if (PQhash == NULL)
        PQhash = N_GNEW(PQhashsize, Halfedge);
     for (i = 0; i < PQhashsize; i += 1)
-       PQhash[i].PQnext = (Halfedge *) NULL;
+       PQhash[i].PQnext = NULL;
 }
 
 static void PQdumphe(Halfedge * p)
index ff670c721cff9e091d19065635764257e7b9111b..e8d8d4de1640433685124e350161815c5615d06f 100644 (file)
@@ -127,7 +127,7 @@ void addVertex(Site * s, double x, double y)
     if (cmp == 0)
        return;
     else if (cmp < 0) {
-       p = (PtItem *) getfree(&pfl);
+       p = getfree(&pfl);
        p->p.x = x;
        p->p.y = y;
        p->next = curr;
@@ -143,7 +143,7 @@ void addVertex(Site * s, double x, double y)
     }
     if (cmp == 0)
        return;
-    p = (PtItem *) getfree(&pfl);
+    p = getfree(&pfl);
     p->p.x = x;
     p->p.y = y;
     prev->next = p;
index 2e4ff71b411a88bedd9b567e072d021c4be9f1f6..37929f96974a413258ccca39bfe9eadf926c92db 100644 (file)
@@ -1171,7 +1171,7 @@ majorization(graph_t *mg, graph_t * g, int nv, int mode, int model, int dim, int
             char* str;
             ipsep_options opt;
             pointf* nsize;
-           cluster_data *cs = (cluster_data*)cluster_map(mg,g);
+           cluster_data *cs = cluster_map(mg,g);
            nsize = N_GNEW(nv, pointf);
             opt.edge_gap = lgap;
 #ifdef MOSEK
index 3d3f8e7f7fcb6043ef1d8be89f78593912594b48..382e05fe3f55bc32455001a8cfb4c340b0988d64 100644 (file)
@@ -39,7 +39,7 @@ void voronoi(int triangulate, Site * (*nextsite) (void))
        if (!PQempty())
            newintstar = PQ_min();
 
-       if (newsite != (struct Site *) NULL && (PQempty()
+       if (newsite != NULL && (PQempty()
                                                || newsite->coord.y <
                                                newintstar.y
                                                || (newsite->coord.y ==
@@ -56,14 +56,14 @@ void voronoi(int triangulate, Site * (*nextsite) (void))
            e = gvbisect(bot, newsite);
            bisector = HEcreate(e, le);
            ELinsert(lbnd, bisector);
-           if ((p = hintersect(lbnd, bisector)) != (struct Site *) NULL) {
+           if ((p = hintersect(lbnd, bisector)) != NULL) {
                PQdelete(lbnd);
                PQinsert(lbnd, p, dist(p, newsite));
            }
            lbnd = bisector;
            bisector = HEcreate(e, re);
            ELinsert(lbnd, bisector);
-           if ((p = hintersect(bisector, rbnd)) != (struct Site *) NULL)
+           if ((p = hintersect(bisector, rbnd)) != NULL)
                PQinsert(bisector, p, dist(p, newsite));
            newsite = (*nextsite) ();
        } else if (!PQempty()) {
@@ -96,11 +96,11 @@ void voronoi(int triangulate, Site * (*nextsite) (void))
            ELinsert(llbnd, bisector);
            endpoint(e, re - pm, v);
            deref(v);
-           if ((p = hintersect(llbnd, bisector)) != (struct Site *) NULL) {
+           if ((p = hintersect(llbnd, bisector)) != NULL) {
                PQdelete(llbnd);
                PQinsert(llbnd, p, dist(p, bot));
            }
-           if ((p = hintersect(bisector, rrbnd)) != (struct Site *) NULL) {
+           if ((p = hintersect(bisector, rrbnd)) != NULL) {
                PQinsert(bisector, p, dist(p, bot));
            }
        } else