]> granicus.if.org Git - graphviz/commitdiff
remove unnecessary casts around 'ND_shape_info'
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Thu, 18 Aug 2022 01:40:09 +0000 (18:40 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Tue, 23 Aug 2022 04:38:16 +0000 (21:38 -0700)
lib/common/emit.c
lib/common/output.c
lib/common/shapes.c
lib/neatogen/neatosplines.c
lib/neatogen/poly.c

index 99ccce65a2faf561b130049b880694d0679fd4f1..8b1bec6722bf81df2b4a4b372bae77c01d14b8f8 100644 (file)
@@ -1792,7 +1792,7 @@ static void emit_begin_node(GVJ_t * job, node_t * n)
         bool filled = isFilled(n);
 
         if (shape == SH_POLY || shape == SH_POINT) {
-            poly = (polygon_t *) ND_shape_info(n);
+            poly = ND_shape_info(n);
 
             /* checking if polygon is regular rectangle */
             if (isRect(poly) && (poly->peripheries || filled))
index 5a488ab920321c1947d3009be177a689817856fc..ac41a32ffb51aca444fcaeca0dde693cb04b2693 100644 (file)
@@ -300,7 +300,7 @@ void attach_attrs_and_arrows(graph_t* g, int* sp, int* ep)
            polygon_t *poly;
            int i;
            if (N_vertices && isPolygon(n)) {
-               poly = (polygon_t *) ND_shape_info(n);
+               poly = ND_shape_info(n);
                sides = poly->sides;
                if (sides < 3) {
                    char *p = agget(n, "samplepoints");
index b385e2c56539007f24feff0ec46ab4327a7d9d78..15f0e4bed5abd0fff9b908032334f87f7c46b123 100644 (file)
@@ -2231,7 +2231,7 @@ static void poly_init(node_t * n)
        ND_width(n) = PS2INCH(bb.x);
        ND_height(n) = PS2INCH(bb.y);
     }
-    ND_shape_info(n) = (void *) poly;
+    ND_shape_info(n) = poly;
 }
 
 static void poly_free(node_t * n)
@@ -2283,7 +2283,7 @@ static bool poly_inside(inside_t * inside_context, pointf p)
 
     if (n != lastn) {
        double n_width, n_height;
-       poly = (polygon_t *) ND_shape_info(n);
+       poly = ND_shape_info(n);
        vertex = poly->vertices;
        sides = poly->sides;
 
@@ -2779,7 +2779,7 @@ static void poly_gencode(GVJ_t * job, node_t * n)
                              obj->url, obj->tooltip, obj->target,
                              obj->id);
 
-    poly = (polygon_t *) ND_shape_info(n);
+    poly = ND_shape_info(n);
     vertices = poly->vertices;
     sides = poly->sides;
     peripheries = poly->peripheries;
@@ -3037,7 +3037,7 @@ static void point_init(node_t * n)
     poly->vertices = vertices;
 
     ND_height(n) = ND_width(n) = PS2INCH(sz);
-    ND_shape_info(n) = (void *) poly;
+    ND_shape_info(n) = poly;
 }
 
 static bool point_inside(inside_t * inside_context, pointf p)
@@ -3057,7 +3057,7 @@ static bool point_inside(inside_t * inside_context, pointf p)
 
     if (n != lastn) {
        int outp;
-       polygon_t *poly = (polygon_t *) ND_shape_info(n);
+       polygon_t *poly = ND_shape_info(n);
 
        /* index to outer-periphery */
        outp = 2 * (poly->peripheries - 1);
@@ -3092,7 +3092,7 @@ static void point_gencode(GVJ_t * job, node_t * n)
                              obj->url, obj->tooltip, obj->target,
                              obj->id);
 
-    poly = (polygon_t *) ND_shape_info(n);
+    poly = ND_shape_info(n);
     vertices = poly->vertices;
     sides = poly->sides;
     peripheries = poly->peripheries;
@@ -3558,7 +3558,7 @@ static void record_init(node_t * n)
     ND_width(n) = PS2INCH(info->size.x);
     ND_height(n) = PS2INCH(info->size.y + 1);  /* Kluge!!  +1 to fix rounding diff between layout and rendering 
                                                   otherwise we can get -1 coords in output */
-    ND_shape_info(n) = (void *) info;
+    ND_shape_info(n) = info;
 }
 
 static void record_free(node_t * n)
@@ -3596,7 +3596,7 @@ static port record_port(node_t * n, char *portname, char *compass)
     sides = BOTTOM | RIGHT | TOP | LEFT;
     if (compass == NULL)
        compass = "_";
-    f = (field_t *) ND_shape_info(n);
+    f = ND_shape_info(n);
     if ((subf = map_rec_port(f, portname))) {
        if (compassPort(n, &subf->b, &rv, compass, subf->sides, NULL)) {
            agerr(AGWARN,
@@ -3626,7 +3626,7 @@ static bool record_inside(inside_t * inside_context, pointf p)
     p = ccwrotatepf(p, 90 * GD_rankdir(agraphof(n)));
 
     if (bp == NULL) {
-       fld0 = (field_t *) ND_shape_info(n);
+       fld0 = ND_shape_info(n);
        bbox = fld0->b;
     } else
        bbox = *bp;
@@ -3648,7 +3648,7 @@ static int record_path(node_t * n, port * prt, int side, boxf rv[],
     if (!prt->defined)
        return 0;
     p = prt->p;
-    info = (field_t *) ND_shape_info(n);
+    info = ND_shape_info(n);
 
     for (i = 0; i < info->n_flds; i++) {
        if (!GD_flip(agraphof(n))) {
@@ -3717,7 +3717,7 @@ static void record_gencode(GVJ_t * job, node_t * n)
     int filled;
     char* clrs[2];
 
-    f = (field_t *) ND_shape_info(n);
+    f = ND_shape_info(n);
     BF = f->b;
     BF.LL.x += ND_coord(n).x;
     BF.LL.y += ND_coord(n).y;
@@ -3856,7 +3856,7 @@ static void epsf_gencode(GVJ_t * job, node_t * n)
     epsf_t *desc;
     int doMap = obj->url || obj->explicit_tooltip;
 
-    desc = (epsf_t *) (ND_shape_info(n));
+    desc = ND_shape_info(n);
     if (!desc)
        return;
 
@@ -3962,7 +3962,7 @@ static bool star_inside(inside_t * inside_context, pointf p)
     }
 
     if (n != lastn) {
-       poly = (polygon_t *) ND_shape_info(n);
+       poly = ND_shape_info(n);
        vertex = poly->vertices;
        sides = poly->sides;
 
index 07032f002d9d387542d415ba2734ef1faf249aeb..1950ae6a420b8717c7a21b317805ac75f211a916 100644 (file)
@@ -294,7 +294,7 @@ Ppoly_t *makeObstacle(node_t * n, expand_t* pmargin, bool isOrtho)
     case SH_POLY:
     case SH_POINT:
        obs = NEW(Ppoly_t);
-       poly = (polygon_t *) ND_shape_info(n);
+       poly = ND_shape_info(n);
        if (isOrtho) {
            isPoly = 1;
            sides = 4;
@@ -393,7 +393,7 @@ Ppoly_t *makeObstacle(node_t * n, expand_t* pmargin, bool isOrtho)
        }
        break;
     case SH_RECORD:
-       fld = (field_t *) ND_shape_info(n);
+       fld = ND_shape_info(n);
        b = fld->b;
        obs = NEW(Ppoly_t);
        obs->pn = 4;
index 6172bf2822d5ee0d05bd982e99692e2747cd4483..e4fa45f1b4d67279f44b15a96891c37d13ad2af0 100644 (file)
@@ -158,7 +158,7 @@ int makeAddPoly(Poly * pp, Agnode_t * n, float xmargin, float ymargin)
     } else
        switch (shapeOf(n)) {
        case SH_POLY:
-           poly = (polygon_t *) ND_shape_info(n);
+           poly = ND_shape_info(n);
            sides = poly->sides;
 
            if (streq(ND_shape(n)->name, "box"))
@@ -250,7 +250,7 @@ int makePoly(Poly * pp, Agnode_t * n, float xmargin, float ymargin)
     } else
        switch (shapeOf(n)) {
        case SH_POLY:
-           poly = (polygon_t *) ND_shape_info(n);
+           poly = ND_shape_info(n);
            sides = poly->sides;
            if (sides >= 3) {   /* real polygon */
                verts = N_GNEW(sides, Point);