summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorDaniel P. Berrange <berrange@redhat.com>2012-01-10 11:39:16 +0000
committerAlon Levy <alevy@redhat.com>2012-01-13 18:11:58 +0200
commit42df032c47dea6f02a932b318ac3ea81e017781e (patch)
tree865854427de4a6835b89a1ec44076cb06e715d90 /common
parentd262f1d96e7ac519c48914c6899309c135ac8276 (diff)
Remove casts from void * with xrealloc() calls
The xrealloc() function returns void*, so the return value never needs to be cast
Diffstat (limited to 'common')
-rw-r--r--common/lines.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/common/lines.c b/common/lines.c
index 9b47ee3..797d5d6 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;