From: Matthew Fernandez Date: Thu, 18 Aug 2022 01:40:09 +0000 (-0700) Subject: remove unnecessary casts around 'ND_shape_info' X-Git-Tag: 6.0.1~33^2~7 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=17e830cd67bfc904d261798979fa907ff8fd3b2e;p=graphviz remove unnecessary casts around 'ND_shape_info' --- diff --git a/lib/common/emit.c b/lib/common/emit.c index 99ccce65a..8b1bec672 100644 --- a/lib/common/emit.c +++ b/lib/common/emit.c @@ -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)) diff --git a/lib/common/output.c b/lib/common/output.c index 5a488ab92..ac41a32ff 100644 --- a/lib/common/output.c +++ b/lib/common/output.c @@ -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"); diff --git a/lib/common/shapes.c b/lib/common/shapes.c index b385e2c56..15f0e4bed 100644 --- a/lib/common/shapes.c +++ b/lib/common/shapes.c @@ -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; diff --git a/lib/neatogen/neatosplines.c b/lib/neatogen/neatosplines.c index 07032f002..1950ae6a4 100644 --- a/lib/neatogen/neatosplines.c +++ b/lib/neatogen/neatosplines.c @@ -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; diff --git a/lib/neatogen/poly.c b/lib/neatogen/poly.c index 6172bf282..e4fa45f1b 100644 --- a/lib/neatogen/poly.c +++ b/lib/neatogen/poly.c @@ -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);