From 42df032c47dea6f02a932b318ac3ea81e017781e Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Tue, 10 Jan 2012 11:39:16 +0000 Subject: Remove casts from void * with xrealloc() calls The xrealloc() function returns void*, so the return value never needs to be cast --- common/lines.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/common/lines.c b/common/lines.c index 9b47ee38..797d5d62 100644 --- a/common/lines.c +++ b/common/lines.c @@ -509,17 +509,15 @@ miSubtractSpans (SpanGroup * spanGroup, Spans * sub) int *newwid; #define EXTRA 8 - newPt = - (DDXPointPtr) xrealloc (spans->points, - (spans->count + - EXTRA) * sizeof (DDXPointRec)); + newPt = xrealloc (spans->points, + (spans->count + + EXTRA) * sizeof (DDXPointRec)); if (!newPt) break; spansPt = newPt + (spansPt - spans->points); spans->points = newPt; - newwid = - (int *) xrealloc (spans->widths, - (spans->count + EXTRA) * sizeof (int)); + newwid = xrealloc (spans->widths, + (spans->count + EXTRA) * sizeof (int)); if (!newwid) break; spansWid = newwid + (spansWid - spans->widths); @@ -556,7 +554,7 @@ miAppendSpans (SpanGroup * spanGroup, SpanGroup * otherGroup, Spans * spans) if (spansCount > 0) { if (spanGroup->size == spanGroup->count) { spanGroup->size = (spanGroup->size + 8) * 2; - spanGroup->group = (Spans *) + spanGroup->group = xrealloc (spanGroup->group, sizeof (Spans) * spanGroup->size); } @@ -803,10 +801,10 @@ miFillUniqueSpanGroup (GCPtr pGC, SpanGroup * spanGroup, Boolean foreground) DDXPointPtr newpoints; int *newwidths; ysizes[index] = (ysizes[index] + 8) * 2; - newpoints = (DDXPointPtr) xrealloc (newspans->points, - ysizes[index] * sizeof (DDXPointRec)); - newwidths = (int *) xrealloc (newspans->widths, - ysizes[index] * sizeof (int)); + newpoints = xrealloc (newspans->points, + ysizes[index] * sizeof (DDXPointRec)); + newwidths = xrealloc (newspans->widths, + ysizes[index] * sizeof (int)); if (!newpoints || !newwidths) { int i; -- cgit