summaryrefslogtreecommitdiff
path: root/src/Region.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2013-03-07 23:46:05 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2013-05-09 18:59:54 -0700
commitd38527e25f8b6e2f1174ecc21260c5c5416f972e (patch)
treedd6c58026d39d45e29de6171e8364873ecbf961b /src/Region.c
parentb2c86b582c58f50c7b14da01cf7ebd20ef12a6b2 (diff)
downloadxorg-lib-libX11-d38527e25f8b6e2f1174ecc21260c5c5416f972e.tar.gz
Remove more unnecessary casts from Xmalloc/calloc calls
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'src/Region.c')
-rw-r--r--src/Region.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/Region.c b/src/Region.c
index 41047b24..d3d431a6 100644
--- a/src/Region.c
+++ b/src/Region.c
@@ -139,9 +139,9 @@ XCreateRegion(void)
{
Region temp;
- if (! (temp = ( Region )Xmalloc( (unsigned) sizeof( REGION ))))
+ if (! (temp = Xmalloc(sizeof( REGION ))))
return (Region) NULL;
- if (! (temp->rects = ( BOX * )Xmalloc( (unsigned) sizeof( BOX )))) {
+ if (! (temp->rects = Xmalloc(sizeof( BOX )))) {
Xfree((char *) temp);
return (Region) NULL;
}
@@ -521,9 +521,9 @@ miRegionCopy(
{
BOX *prevRects = dstrgn->rects;
- if (! (dstrgn->rects = (BOX *)
- Xrealloc((char *) dstrgn->rects,
- (unsigned) rgn->numRects * (sizeof(BOX))))) {
+ dstrgn->rects = Xrealloc(dstrgn->rects,
+ rgn->numRects * (sizeof(BOX)));
+ if (! dstrgn->rects) {
Xfree(prevRects);
return;
}
@@ -788,8 +788,7 @@ miRegionOp(
*/
newReg->size = max(reg1->numRects,reg2->numRects) * 2;
- if (! (newReg->rects = (BoxPtr)
- Xmalloc ((unsigned) (sizeof(BoxRec) * newReg->size)))) {
+ if (! (newReg->rects = Xmalloc (sizeof(BoxRec) * newReg->size))) {
newReg->size = 0;
return;
}
@@ -980,8 +979,8 @@ miRegionOp(
{
BoxPtr prev_rects = newReg->rects;
newReg->size = newReg->numRects;
- newReg->rects = (BoxPtr) Xrealloc ((char *) newReg->rects,
- (unsigned) (sizeof(BoxRec) * newReg->size));
+ newReg->rects = Xrealloc (newReg->rects,
+ sizeof(BoxRec) * newReg->size);
if (! newReg->rects)
newReg->rects = prev_rects;
}
@@ -993,7 +992,7 @@ miRegionOp(
*/
newReg->size = 1;
Xfree((char *) newReg->rects);
- newReg->rects = (BoxPtr) Xmalloc(sizeof(BoxRec));
+ newReg->rects = Xmalloc(sizeof(BoxRec));
}
}
Xfree ((char *) oldRects);