From c420f450d0a2b1f26d4043334bb8b6524fea4b07 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sat, 15 Oct 2022 13:10:52 -0700 Subject: Stop casting return value of malloc() and calloc() Not needed in C89 and later, and may hide errors Signed-off-by: Alan Coopersmith --- do_complex.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'do_complex.c') diff --git a/do_complex.c b/do_complex.c index 82a2f9d..8fcabe8 100644 --- a/do_complex.c +++ b/do_complex.c @@ -67,7 +67,7 @@ InitComplexPoly(XParms xp, Parms p, int64_t reps) iradius = (int) radius + 1; numPoints = (p->objects) * NUM_POINTS; - points = (XPoint *)malloc(numPoints * sizeof(XPoint)); + points = malloc(numPoints * sizeof(XPoint)); curPoint = points; x = iradius; y = iradius; @@ -139,7 +139,7 @@ InitGeneralPoly(XParms xp, Parms p, int64_t reps) inner_radius = size / sqrt (nsides * tan (PI / nsides)); outer_radius = inner_radius / cos (PI / (2 * nsides)); numPoints = p->objects * nsides; - points = (XPoint *) malloc (numPoints * sizeof (XPoint)); + points = malloc (numPoints * sizeof (XPoint)); curPoint = points; iradius = outer_radius + 1; x = iradius; -- cgit v1.2.3