diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2013-03-07 23:46:05 -0800 |
---|---|---|
committer | Ulrich Sibiller <uli42@gmx.de> | 2016-10-19 21:40:27 +0200 |
commit | e15023b2ad2a5ca8742cbb93fe10cb38ab079831 (patch) | |
tree | ac6b9de01f8f71b15392cc5216e53220da288e75 /nx-X11/lib/X11/Region.c | |
parent | 47d0ea1ba5bdd53d5df2cd06ffb637c889cf5e03 (diff) | |
download | nx-libs-e15023b2ad2a5ca8742cbb93fe10cb38ab079831.tar.gz nx-libs-e15023b2ad2a5ca8742cbb93fe10cb38ab079831.tar.bz2 nx-libs-e15023b2ad2a5ca8742cbb93fe10cb38ab079831.zip |
Remove more unnecessary casts from Xmalloc/calloc calls
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Backported-to-NX-by: Ulrich Sibiller <uli42@gmx.de>
Diffstat (limited to 'nx-X11/lib/X11/Region.c')
-rw-r--r-- | nx-X11/lib/X11/Region.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/nx-X11/lib/X11/Region.c b/nx-X11/lib/X11/Region.c index 5491dbd0e..998639c25 100644 --- a/nx-X11/lib/X11/Region.c +++ b/nx-X11/lib/X11/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); |