summaryrefslogtreecommitdiff
path: root/mi
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2009-01-22 02:11:16 -0500
committerAdam Jackson <ajax@redhat.com>2009-01-22 02:11:16 -0500
commit132b464d734b077038e19b21e46d3a6258f4b998 (patch)
tree4fe179cf69d6013a32aaa8e17a28b3fc905e6274 /mi
parent0fb4390526bb829ab17ff4635d41a3012f63c1b2 (diff)
Remove a bunch of useless casts.
We've had void * for twenty years now people let's try to act like we know how it works.
Diffstat (limited to 'mi')
-rw-r--r--mi/miarc.c30
-rw-r--r--mi/mibank.c9
-rw-r--r--mi/mibitblt.c28
-rw-r--r--mi/micmap.c10
-rw-r--r--mi/midispcur.c20
-rw-r--r--mi/miexpose.c9
-rw-r--r--mi/mifillarc.c16
-rw-r--r--mi/mifillrct.c4
-rw-r--r--mi/mifpolycon.c6
-rw-r--r--mi/miglblt.c2
-rw-r--r--mi/mioverlay.c2
-rw-r--r--mi/mipointer.c2
-rw-r--r--mi/mipolycon.c4
-rw-r--r--mi/mipolygen.c3
-rw-r--r--mi/mipolypnt.c2
-rw-r--r--mi/mipolyrect.c2
-rw-r--r--mi/mipolyutil.c23
-rw-r--r--mi/mipushpxl.c2
-rw-r--r--mi/miregion.c14
-rw-r--r--mi/miscrinit.c2
-rw-r--r--mi/mispans.c8
-rw-r--r--mi/misprite.c2
-rw-r--r--mi/mivaltree.c2
-rw-r--r--mi/miwideline.c20
-rw-r--r--mi/miwindow.c12
-rw-r--r--mi/mizerarc.c4
-rw-r--r--mi/mizerline.c4
27 files changed, 116 insertions, 126 deletions
diff --git a/mi/miarc.c b/mi/miarc.c
index bec3391df..12c360c7a 100644
--- a/mi/miarc.c
+++ b/mi/miarc.c
@@ -880,8 +880,7 @@ miComputeWideEllipse(
{
if (spdata)
xfree(spdata);
- spdata = (miArcSpanData *)xalloc(sizeof(miArcSpanData) +
- sizeof(miArcSpan) * (k + 2));
+ spdata = xalloc(sizeof(miArcSpanData) + sizeof(miArcSpan) * (k + 2));
lruent->spdata = spdata;
if (!spdata)
{
@@ -925,7 +924,7 @@ miFillWideEllipse(
yorgu = parc->height + pGC->lineWidth;
n = (sizeof(int) * 2) * yorgu;
- widths = (int *)xalloc(n + (sizeof(DDXPointRec) * 2) * yorgu);
+ widths = xalloc(n + (sizeof(DDXPointRec) * 2) * yorgu);
if (!widths)
return;
points = (DDXPointPtr)((char *)widths + n);
@@ -1361,7 +1360,7 @@ miArcJoin(DrawablePtr pDraw, GCPtr pGC, miArcFacePtr pLeft,
arc.height = width;
arc.angle1 = -miDatan2 (corner.y - center.y, corner.x - center.x);
arc.angle2 = a;
- pArcPts = (SppPointPtr) xalloc (3 * sizeof (SppPointRec));
+ pArcPts = xalloc (3 * sizeof (SppPointRec));
if (!pArcPts)
return;
pArcPts[0].x = otherCorner.x;
@@ -1783,7 +1782,7 @@ addArc (
arc = (miArcDataPtr) xrealloc (*arcsp,
newsize * sizeof (**arcsp));
if (!arc)
- return (miArcDataPtr)NULL;
+ return NULL;
*sizep = newsize;
*arcsp = arc;
}
@@ -1895,14 +1894,14 @@ miComputeArcs (
isDoubleDash = (pGC->lineStyle == LineDoubleDash);
dashOffset = pGC->dashOffset;
- data = (struct arcData *) xalloc (narcs * sizeof (struct arcData));
+ data = xalloc (narcs * sizeof (struct arcData));
if (!data)
- return (miPolyArcPtr)NULL;
- arcs = (miPolyArcPtr) xalloc (sizeof (*arcs) * (isDoubleDash ? 2 : 1));
+ return NULL;
+ arcs = xalloc (sizeof (*arcs) * (isDoubleDash ? 2 : 1));
if (!arcs)
{
xfree(data);
- return (miPolyArcPtr)NULL;
+ return NULL;
}
for (i = 0; i < narcs; i++) {
a0 = todeg (parcs[i].angle1);
@@ -2255,7 +2254,7 @@ miComputeArcs (
arcfail:
miFreeArcs(arcs, pGC);
xfree(data);
- return (miPolyArcPtr)NULL;
+ return NULL;
}
static double
@@ -3111,7 +3110,7 @@ realAllocSpan (void)
struct finalSpan *span;
int i;
- newChunk = (struct finalSpanChunk *) xalloc (sizeof (struct finalSpanChunk));
+ newChunk = xalloc (sizeof (struct finalSpanChunk));
if (!newChunk)
return (struct finalSpan *) NULL;
newChunk->next = chunks;
@@ -3158,8 +3157,8 @@ fillSpans (
if (nspans == 0)
return;
- xSpan = xSpans = (DDXPointPtr) xalloc (nspans * sizeof (DDXPointRec));
- xWidth = xWidths = (int *) xalloc (nspans * sizeof (int));
+ xSpan = xSpans = xalloc (nspans * sizeof (DDXPointRec));
+ xWidth = xWidths = xalloc (nspans * sizeof (int));
if (xSpans && xWidths)
{
i = 0;
@@ -3216,10 +3215,9 @@ realFindSpan (int y)
else
change = SPAN_REALLOC;
newSize = finalSize + change;
- newSpans = (struct finalSpan **) xalloc
- (newSize * sizeof (struct finalSpan *));
+ newSpans = xalloc(newSize * sizeof (struct finalSpan *));
if (!newSpans)
- return (struct finalSpan **)NULL;
+ return NULL;
newMiny = finalMiny;
newMaxy = finalMaxy;
if (y < finalMiny)
diff --git a/mi/mibank.c b/mi/mibank.c
index 3946a4b6d..9e4d63162 100644
--- a/mi/mibank.c
+++ b/mi/mibank.c
@@ -171,8 +171,7 @@ typedef struct _miBankQueue
(*pScreenPriv->BankInfo.SetDestinationBank)(pScreen, (_no)) - \
(pScreenPriv->BankInfo.BankSize * (_no)))
-#define xalloc_ARRAY(atype, ntype) \
- (atype *)xalloc((ntype) * sizeof(atype))
+#define xalloc_ARRAY(atype, ntype) xalloc((ntype) * sizeof(atype))
static int miBankScreenKeyIndex;
static DevPrivateKey miBankScreenKey = &miBankScreenKeyIndex;
@@ -955,7 +954,7 @@ miBankCopy(
paddedWidth = PixmapBytePad(maxWidth,
pScreenPriv->pScreenPixmap->drawable.depth);
- pImage = (char *)xalloc(paddedWidth * maxHeight);
+ pImage = xalloc(paddedWidth * maxHeight);
pGC->fExpose = FALSE;
@@ -1750,7 +1749,7 @@ miBankGetImage(
paddedWidth = PixmapBytePad(w,
pScreenPriv->pScreenPixmap->drawable.depth);
- pBankImage = (char *)xalloc(paddedWidth * h);
+ pBankImage = xalloc(paddedWidth * h);
if (pBankImage)
{
@@ -1811,7 +1810,7 @@ miBankGetSpans(
paddedWidth =
PixmapBytePad(pScreenPriv->pScreenPixmap->drawable.width,
pScreenPriv->pScreenPixmap->drawable.depth);
- pBankImage = (char *)xalloc(paddedWidth);
+ pBankImage = xalloc(paddedWidth);
if (pBankImage)
{
diff --git a/mi/mibitblt.c b/mi/mibitblt.c
index a36e1aacb..cc8b11d9c 100644
--- a/mi/mibitblt.c
+++ b/mi/mibitblt.c
@@ -104,7 +104,7 @@ miCopyArea(DrawablePtr pSrcDrawable,
/* If the destination isn't realized, this is easy */
if (pDstDrawable->type == DRAWABLE_WINDOW &&
!((WindowPtr)pDstDrawable)->realized)
- return (RegionPtr)NULL;
+ return NULL;
/* clip the source */
if (pSrcDrawable->type == DRAWABLE_PIXMAP)
@@ -143,14 +143,11 @@ miCopyArea(DrawablePtr pSrcDrawable,
dsty += pDstDrawable->y;
}
- pptFirst = ppt = (DDXPointPtr)
- xalloc(heightSrc * sizeof(DDXPointRec));
- pwidthFirst = pwidth = (unsigned int *)
- xalloc(heightSrc * sizeof(unsigned int));
+ pptFirst = ppt = xalloc(heightSrc * sizeof(DDXPointRec));
+ pwidthFirst = pwidth = xalloc(heightSrc * sizeof(unsigned int));
numRects = REGION_NUM_RECTS(prgnSrcClip);
boxes = REGION_RECTS(prgnSrcClip);
- ordering = (unsigned int *)
- xalloc(numRects * sizeof(unsigned int));
+ ordering = xalloc(numRects * sizeof(unsigned int));
if(!pptFirst || !pwidthFirst || !ordering)
{
if (ordering)
@@ -159,7 +156,7 @@ miCopyArea(DrawablePtr pSrcDrawable,
xfree(pwidthFirst);
if (pptFirst)
xfree(pptFirst);
- return (RegionPtr)NULL;
+ return NULL;
}
/* If not the same drawable then order of move doesn't matter.
@@ -238,8 +235,7 @@ miCopyArea(DrawablePtr pSrcDrawable,
ppt++->y = y++;
*pwidth++ = width;
}
- pbits = (unsigned int *)xalloc(height * PixmapBytePad(width,
- pSrcDrawable->depth));
+ pbits = xalloc(height * PixmapBytePad(width, pSrcDrawable->depth));
if (pbits)
{
(*pSrcDrawable->pScreen->GetSpans)(pSrcDrawable, width, pptFirst,
@@ -319,7 +315,7 @@ miGetPlane(
if(!result)
result = xcalloc(h, widthInBytes);
if (!result)
- return (MiBits *)NULL;
+ return NULL;
bitsPerPixel = pDraw->bitsPerPixel;
pOut = (OUT_TYPE *) result;
if(bitsPerPixel == 1)
@@ -433,8 +429,8 @@ miOpqStipDrawable(DrawablePtr pDraw, GCPtr pGC, RegionPtr prgnSrc,
dixChangeGC(NullClient, pGCT, GCBackground, NULL, gcv);
ValidateGC((DrawablePtr)pPixmap, pGCT);
miClearDrawable((DrawablePtr)pPixmap, pGCT);
- ppt = pptFirst = (DDXPointPtr)xalloc(h * sizeof(DDXPointRec));
- pwidth = pwidthFirst = (int *)xalloc(h * sizeof(int));
+ ppt = pptFirst = xalloc(h * sizeof(DDXPointRec));
+ pwidth = pwidthFirst = xalloc(h * sizeof(int));
if(!pptFirst || !pwidthFirst)
{
if (pwidthFirst) xfree(pwidthFirst);
@@ -651,7 +647,7 @@ miGetImage( DrawablePtr pDraw, int sx, int sy, int w, int h,
int i, linelength, width, srcx, srcy;
DDXPointRec pt = {0, 0};
XID gcv[2];
- PixmapPtr pPixmap = (PixmapPtr)NULL;
+ PixmapPtr pPixmap = NULL;
GCPtr pGC = NULL;
depth = pDraw->depth;
@@ -802,8 +798,8 @@ miPutImage( DrawablePtr pDraw, GCPtr pGC, int depth,
break;
case ZPixmap:
- ppt = pptFirst = (DDXPointPtr)xalloc(h * sizeof(DDXPointRec));
- pwidth = pwidthFirst = (int *)xalloc(h * sizeof(int));
+ ppt = pptFirst = xalloc(h * sizeof(DDXPointRec));
+ pwidth = pwidthFirst = xalloc(h * sizeof(int));
if(!pptFirst || !pwidthFirst)
{
if (pwidthFirst)
diff --git a/mi/micmap.c b/mi/micmap.c
index 342756b6a..6318d6745 100644
--- a/mi/micmap.c
+++ b/mi/micmap.c
@@ -398,7 +398,7 @@ miSetVisualTypesAndMasks(int depth, int visuals, int bitsPerRGB,
miVisualsPtr new, *prev, v;
int count;
- new = (miVisualsPtr) xalloc (sizeof *new);
+ new = xalloc (sizeof *new);
if (!new)
return FALSE;
if (!redMask || !greenMask || !blueMask)
@@ -539,9 +539,9 @@ miInitVisuals(VisualPtr *visualp, DepthPtr *depthp, int *nvisualp,
ndepth++;
nvisual += visuals->count;
}
- depth = (DepthPtr) xalloc (ndepth * sizeof (DepthRec));
- visual = (VisualPtr) xalloc (nvisual * sizeof (VisualRec));
- preferredCVCs = (int *)xalloc(ndepth * sizeof(int));
+ depth = xalloc (ndepth * sizeof (DepthRec));
+ visual = xalloc (nvisual * sizeof (VisualRec));
+ preferredCVCs = xalloc(ndepth * sizeof(int));
if (!depth || !visual || !preferredCVCs)
{
xfree (depth);
@@ -565,7 +565,7 @@ miInitVisuals(VisualPtr *visualp, DepthPtr *depthp, int *nvisualp,
vid = NULL;
if (nvtype)
{
- vid = (VisualID *) xalloc (nvtype * sizeof (VisualID));
+ vid = xalloc (nvtype * sizeof (VisualID));
if (!vid) {
xfree(preferredCVCs);
return FALSE;
diff --git a/mi/midispcur.c b/mi/midispcur.c
index e73b5003b..7b3ce292e 100644
--- a/mi/midispcur.c
+++ b/mi/midispcur.c
@@ -140,7 +140,7 @@ miDCInitialize (ScreenPtr pScreen, miPointerScreenFuncPtr screenFuncs)
{
miDCScreenPtr pScreenPriv;
- pScreenPriv = (miDCScreenPtr) xalloc (sizeof (miDCScreenRec));
+ pScreenPriv = xalloc (sizeof (miDCScreenRec));
if (!pScreenPriv)
return FALSE;
@@ -229,9 +229,9 @@ miDCRealize (ScreenPtr pScreen, CursorPtr pCursor)
GCPtr pGC;
XID gcvals[3];
- pPriv = (miDCCursorPtr) xalloc (sizeof (miDCCursorRec));
+ pPriv = xalloc (sizeof (miDCCursorRec));
if (!pPriv)
- return (miDCCursorPtr)NULL;
+ return NULL;
#ifdef ARGB_CURSOR
if (pCursor->bits->argb)
{
@@ -243,7 +243,7 @@ miDCRealize (ScreenPtr pScreen, CursorPtr pCursor)
if (!pFormat)
{
xfree ((pointer) pPriv);
- return (miDCCursorPtr)NULL;
+ return NULL;
}
pPriv->sourceBits = 0;
@@ -254,14 +254,14 @@ miDCRealize (ScreenPtr pScreen, CursorPtr pCursor)
if (!pPixmap)
{
xfree ((pointer) pPriv);
- return (miDCCursorPtr)NULL;
+ return NULL;
}
pGC = GetScratchGC (32, pScreen);
if (!pGC)
{
(*pScreen->DestroyPixmap) (pPixmap);
xfree ((pointer) pPriv);
- return (miDCCursorPtr)NULL;
+ return NULL;
}
ValidateGC (&pPixmap->drawable, pGC);
(*pGC->ops->PutImage) (&pPixmap->drawable, pGC, 32,
@@ -275,7 +275,7 @@ miDCRealize (ScreenPtr pScreen, CursorPtr pCursor)
if (!pPriv->pPicture)
{
xfree ((pointer) pPriv);
- return (miDCCursorPtr)NULL;
+ return NULL;
}
dixSetPrivate(&pCursor->bits->devPrivates, CursorScreenKey(pScreen), pPriv);
return pPriv;
@@ -286,14 +286,14 @@ miDCRealize (ScreenPtr pScreen, CursorPtr pCursor)
if (!pPriv->sourceBits)
{
xfree ((pointer) pPriv);
- return (miDCCursorPtr)NULL;
+ return NULL;
}
pPriv->maskBits = (*pScreen->CreatePixmap) (pScreen, pCursor->bits->width, pCursor->bits->height, 1, 0);
if (!pPriv->maskBits)
{
(*pScreen->DestroyPixmap) (pPriv->sourceBits);
xfree ((pointer) pPriv);
- return (miDCCursorPtr)NULL;
+ return NULL;
}
dixSetPrivate(&pCursor->bits->devPrivates, CursorScreenKey(pScreen), pPriv);
@@ -303,7 +303,7 @@ miDCRealize (ScreenPtr pScreen, CursorPtr pCursor)
if (!pGC)
{
(void) miDCUnrealizeCursor (pScreen, pCursor);
- return (miDCCursorPtr)NULL;
+ return NULL;
}
ValidateGC ((DrawablePtr)pPriv->sourceBits, pGC);
diff --git a/mi/miexpose.c b/mi/miexpose.c
index 04bf555ae..d56d18758 100644
--- a/mi/miexpose.c
+++ b/mi/miexpose.c
@@ -207,7 +207,7 @@ miHandleExposures(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
box.y2 = pSrcDrawable->height;
prgnSrcClip = &rgnSrcRec;
REGION_INIT(pscr, prgnSrcClip, &box, 1);
- pSrcWin = (WindowPtr)NULL;
+ pSrcWin = NULL;
}
if (pDstDrawable == pSrcDrawable)
@@ -354,7 +354,7 @@ miSendGraphicsExpose (ClientPtr client, RegionPtr pRgn, XID drawable,
numRects = REGION_NUM_RECTS(pRgn);
pBox = REGION_RECTS(pRgn);
- if(!(pEvent = (xEvent *)xalloc(numRects * sizeof(xEvent))))
+ if(!(pEvent = xalloc(numRects * sizeof(xEvent))))
return;
pe = pEvent;
@@ -397,7 +397,7 @@ miSendExposures( WindowPtr pWin, RegionPtr pRgn, int dx, int dy)
pBox = REGION_RECTS(pRgn);
numRects = REGION_NUM_RECTS(pRgn);
- if(!(pEvent = (xEvent *) xalloc(numRects * sizeof(xEvent))))
+ if(!(pEvent = xalloc(numRects * sizeof(xEvent))))
return;
for (i=numRects, pe = pEvent; --i >= 0; pe++, pBox++)
@@ -600,8 +600,7 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what)
gcmask |= GCFillStyle | GCTile | GCTileStipXOrigin | GCTileStipYOrigin;
}
- prect = (xRectangle *)xalloc(REGION_NUM_RECTS(prgn) *
- sizeof(xRectangle));
+ prect = xalloc(REGION_NUM_RECTS(prgn) * sizeof(xRectangle));
if (!prect)
return;
diff --git a/mi/mifillarc.c b/mi/mifillarc.c
index 33a6e353a..c22baf54c 100644
--- a/mi/mifillarc.c
+++ b/mi/mifillarc.c
@@ -546,10 +546,10 @@ miFillEllipseI(
int *widths;
int *wids;
- points = (DDXPointPtr)xalloc(sizeof(DDXPointRec) * arc->height);
+ points = xalloc(sizeof(DDXPointRec) * arc->height);
if (!points)
return;
- widths = (int *)xalloc(sizeof(int) * arc->height);
+ widths = xalloc(sizeof(int) * arc->height);
if (!widths)
{
xfree(points);
@@ -589,10 +589,10 @@ miFillEllipseD(
int *widths;
int *wids;
- points = (DDXPointPtr)xalloc(sizeof(DDXPointRec) * arc->height);
+ points = xalloc(sizeof(DDXPointRec) * arc->height);
if (!points)
return;
- widths = (int *)xalloc(sizeof(int) * arc->height);
+ widths = xalloc(sizeof(int) * arc->height);
if (!widths)
{
xfree(points);
@@ -661,10 +661,10 @@ miFillArcSliceI(
slw = arc->height;
if (slice.flip_top || slice.flip_bot)
slw += (arc->height >> 1) + 1;
- points = (DDXPointPtr)xalloc(sizeof(DDXPointRec) * slw);
+ points = xalloc(sizeof(DDXPointRec) * slw);
if (!points)
return;
- widths = (int *)xalloc(sizeof(int) * slw);
+ widths = xalloc(sizeof(int) * slw);
if (!widths)
{
xfree(points);
@@ -725,10 +725,10 @@ miFillArcSliceD(
slw = arc->height;
if (slice.flip_top || slice.flip_bot)
slw += (arc->height >> 1) + 1;
- points = (DDXPointPtr)xalloc(sizeof(DDXPointRec) * slw);
+ points = xalloc(sizeof(DDXPointRec) * slw);
if (!points)
return;
- widths = (int *)xalloc(sizeof(int) * slw);
+ widths = xalloc(sizeof(int) * slw);
if (!widths)
{
xfree(points);
diff --git a/mi/mifillrct.c b/mi/mifillrct.c
index a2967da0a..6e9979099 100644
--- a/mi/mifillrct.c
+++ b/mi/mifillrct.c
@@ -107,8 +107,8 @@ miPolyFillRect(
maxheight = max(maxheight, prect->height);
}
- pptFirst = (DDXPointPtr) xalloc(maxheight * sizeof(DDXPointRec));
- pwFirst = (int *) xalloc(maxheight * sizeof(int));
+ pptFirst = xalloc(maxheight * sizeof(DDXPointRec));
+ pwFirst = xalloc(maxheight * sizeof(int));
if(!pptFirst || !pwFirst)
{
if (pwFirst) xfree(pwFirst);
diff --git a/mi/mifpolycon.c b/mi/mifpolycon.c
index 4a3acfd2b..383502f64 100644
--- a/mi/mifpolycon.c
+++ b/mi/mifpolycon.c
@@ -116,9 +116,9 @@ miFillSppPoly(
y = ymax - ymin + 1;
if ((count < 3) || (y <= 0))
return;
- ptsOut = FirstPoint = (DDXPointPtr)xalloc(sizeof(DDXPointRec) * y);
- width = FirstWidth = (int *) xalloc(sizeof(int) * y);
- Marked = (int *) xalloc(sizeof(int) * count);
+ ptsOut = FirstPoint = xalloc(sizeof(DDXPointRec) * y);
+ width = FirstWidth = xalloc(sizeof(int) * y);
+ Marked = xalloc(sizeof(int) * count);
if(!ptsOut || !width || !Marked)
{
diff --git a/mi/miglblt.c b/mi/miglblt.c
index 404d78540..bc715aee9 100644
--- a/mi/miglblt.c
+++ b/mi/miglblt.c
@@ -141,7 +141,7 @@ miPolyGlyphBlt(
DoChangeGC(pGCtmp, GCFunction|GCForeground|GCBackground, gcvals, 0);
nbyLine = BitmapBytePad(width);
- pbits = (unsigned char *)xalloc(height*nbyLine);
+ pbits = xalloc(height*nbyLine);
if (!pbits)
{
(*pDrawable->pScreen->DestroyPixmap)(pPixmap);
diff --git a/mi/mioverlay.c b/mi/mioverlay.c
index f238cd3f2..e0aa88017 100644
--- a/mi/mioverlay.c
+++ b/mi/mioverlay.c
@@ -900,7 +900,7 @@ miOverlayHandleExposures(WindowPtr pWin)
REGION_UNINIT(pScreen, &val->after.borderExposed);
REGION_UNINIT(pScreen, &val->after.exposed);
xfree(val);
- pChild->valdata = (ValidatePtr)NULL;
+ pChild->valdata = NULL;
if (pChild->firstChild)
{
pChild = pChild->firstChild;
diff --git a/mi/mipointer.c b/mi/mipointer.c
index 567790c49..d5202810a 100644
--- a/mi/mipointer.c
+++ b/mi/mipointer.c
@@ -88,7 +88,7 @@ miPointerInitialize (ScreenPtr pScreen,
{
miPointerScreenPtr pScreenPriv;
- pScreenPriv = (miPointerScreenPtr) xalloc (sizeof (miPointerScreenRec));
+ pScreenPriv = xalloc (sizeof (miPointerScreenRec));
if (!pScreenPriv)
return FALSE;
pScreenPriv->spriteFuncs = spriteFuncs;
diff --git a/mi/mipolycon.c b/mi/mipolycon.c
index 6e3889621..79384881d 100644
--- a/mi/mipolycon.c
+++ b/mi/mipolycon.c
@@ -105,8 +105,8 @@ miFillConvexPoly(
dy = ymax - ymin + 1;
if ((count < 3) || (dy < 0))
return(TRUE);
- ptsOut = FirstPoint = (DDXPointPtr )xalloc(sizeof(DDXPointRec)*dy);
- width = FirstWidth = (int *)xalloc(sizeof(int) * dy);
+ ptsOut = FirstPoint = xalloc(sizeof(DDXPointRec)*dy);
+ width = FirstWidth = xalloc(sizeof(int) * dy);
if(!FirstPoint || !FirstWidth)
{
if (FirstWidth) xfree(FirstWidth);
diff --git a/mi/mipolygen.c b/mi/mipolygen.c
index 04bc2c67f..4744583c3 100644
--- a/mi/mipolygen.c
+++ b/mi/mipolygen.c
@@ -92,8 +92,7 @@ miFillGeneralPoly(
if (count < 3)
return(TRUE);
- if(!(pETEs = (EdgeTableEntry *)
- xalloc(sizeof(EdgeTableEntry) * count)))
+ if(!(pETEs = xalloc(sizeof(EdgeTableEntry) * count)))
return(FALSE);
ptsOut = FirstPoint;
width = FirstWidth;
diff --git a/mi/mipolypnt.c b/mi/mipolypnt.c
index 12324b686..5d6243ab0 100644
--- a/mi/mipolypnt.c
+++ b/mi/mipolypnt.c
@@ -107,7 +107,7 @@ miPolyPoint(
DoChangeGC(pGC, GCFillStyle, &fsNew, 0);
ValidateGC(pDrawable, pGC);
}
- if(!(pwidthInit = (int *)xalloc(npt * sizeof(int))))
+ if(!(pwidthInit = xalloc(npt * sizeof(int))))
return;
pwidth = pwidthInit;
for(i = 0; i < npt; i++)
diff --git a/mi/mipolyrect.c b/mi/mipolyrect.c
index f1ec4858a..033c7a7c8 100644
--- a/mi/mipolyrect.c
+++ b/mi/mipolyrect.c
@@ -90,7 +90,7 @@ miPolyRectangle(DrawablePtr pDraw, GCPtr pGC, int nrects, xRectangle *pRects)
offset2 = pGC->lineWidth;
offset1 = offset2 >> 1;
offset3 = offset2 - offset1;
- tmp = (xRectangle *) xalloc(ntmp * sizeof (xRectangle));
+ tmp = xalloc(ntmp * sizeof (xRectangle));
if (!tmp)
return;
t = tmp;
diff --git a/mi/mipolyutil.c b/mi/mipolyutil.c
index ed41a7d1a..15561b73d 100644
--- a/mi/mipolyutil.c
+++ b/mi/mipolyutil.c
@@ -99,19 +99,18 @@ miInsertEdgeInET(EdgeTable *ET, EdgeTableEntry *ETE, int scanline,
{
if (*iSLLBlock > SLLSPERBLOCK-1)
{
- tmpSLLBlock =
- (ScanLineListBlock *)xalloc(sizeof(ScanLineListBlock));
+ tmpSLLBlock = xalloc(sizeof(ScanLineListBlock));
if (!tmpSLLBlock)
return FALSE;
(*SLLBlock)->next = tmpSLLBlock;
- tmpSLLBlock->next = (ScanLineListBlock *)NULL;
+ tmpSLLBlock->next = NULL;
*SLLBlock = tmpSLLBlock;
*iSLLBlock = 0;
}
pSLL = &((*SLLBlock)->SLLs[(*iSLLBlock)++]);
pSLL->next = pPrevSLL->next;
- pSLL->edgelist = (EdgeTableEntry *)NULL;
+ pSLL->edgelist = NULL;
pPrevSLL->next = pSLL;
}
pSLL->scanline = scanline;
@@ -119,7 +118,7 @@ miInsertEdgeInET(EdgeTable *ET, EdgeTableEntry *ETE, int scanline,
/*
* now insert the edge in the right bucket
*/
- prev = (EdgeTableEntry *)NULL;
+ prev = NULL;
start = pSLL->edgelist;
while (start && (start->bres.minor < ETE->bres.minor))
{
@@ -175,18 +174,18 @@ miCreateETandAET(int count, DDXPointPtr pts, EdgeTable *ET, EdgeTableEntry *AET,
/*
* initialize the Active Edge Table
*/
- AET->next = (EdgeTableEntry *)NULL;
- AET->back = (EdgeTableEntry *)NULL;
- AET->nextWETE = (EdgeTableEntry *)NULL;
+ AET->next = NULL;
+ AET->back = NULL;
+ AET->nextWETE = NULL;
AET->bres.minor = MININT;
/*
* initialize the Edge Table.
*/
- ET->scanlines.next = (ScanLineList *)NULL;
+ ET->scanlines.next = NULL;
ET->ymax = MININT;
ET->ymin = MAXINT;
- pSLLBlock->next = (ScanLineListBlock *)NULL;
+ pSLLBlock->next = NULL;
PrevPt = &pts[count-1];
@@ -305,7 +304,7 @@ micomputeWAET(EdgeTableEntry *AET)
int inside = 1;
int isInside = 0;
- AET->nextWETE = (EdgeTableEntry *)NULL;
+ AET->nextWETE = NULL;
pWETE = AET;
AET = AET->next;
while (AET)
@@ -324,7 +323,7 @@ micomputeWAET(EdgeTableEntry *AET)
}
AET = AET->next;
}
- pWETE->nextWETE = (EdgeTableEntry *)NULL;
+ pWETE->nextWETE = NULL;
}
/*
diff --git a/mi/mipushpxl.c b/mi/mipushpxl.c
index 4b9789047..3844519d8 100644
--- a/mi/mipushpxl.c
+++ b/mi/mipushpxl.c
@@ -123,7 +123,7 @@ miPushPixels(GCPtr pGC, PixmapPtr pBitMap, DrawablePtr pDrawable,
LONG2CHARSDIFFORDER((MiBits)(-1) >> 1);
#endif
- pwLineStart = (MiBits *)xalloc(BitmapBytePad(dx));
+ pwLineStart = xalloc(BitmapBytePad(dx));
if (!pwLineStart)
return;
ipt = 0;
diff --git a/mi/miregion.c b/mi/miregion.c
index d9c6fb252..c48befc6f 100644
--- a/mi/miregion.c
+++ b/mi/miregion.c
@@ -171,7 +171,7 @@ Equipment Corporation.
((r1)->y1 <= (r2)->y1) && \
((r1)->y2 >= (r2)->y2) )
-#define xallocData(n) (RegDataPtr)xalloc(REGION_SZOF(n))
+#define xallocData(n) xalloc(REGION_SZOF(n))
#define xfreeData(reg) if ((reg)->data && (reg)->data->size) xfree((reg)->data)
#define RECTALLOC_BAIL(pReg,n,bail) \
@@ -654,7 +654,7 @@ miRegionOp(
assert(r1 != r1End);
assert(r2 != r2End);
- oldData = (RegDataPtr)NULL;
+ oldData = NULL;
if (((newReg == reg1) && (newSize > 1)) ||
((newReg == reg2) && (numRects > 1)))
{
@@ -808,7 +808,7 @@ miRegionOp(
{
newReg->extents = *REGION_BOXPTR(newReg);
xfreeData(newReg);
- newReg->data = (RegDataPtr)NULL;
+ newReg->data = NULL;
}
else
{
@@ -1039,7 +1039,7 @@ miRegionAppend(RegionPtr dstrgn, RegionPtr rgn)
if (!rgn->data && (dstrgn->data == &miEmptyData))
{
dstrgn->extents = rgn->extents;
- dstrgn->data = (RegDataPtr)NULL;
+ dstrgn->data = NULL;
return TRUE;
}
@@ -1343,7 +1343,7 @@ miRegionValidate(RegionPtr badreg, Bool *pOverlap)
rit->prevBand = 0;
rit->curBand = 0;
rit->reg.extents = *box;
- rit->reg.data = (RegDataPtr)NULL;
+ rit->reg.data = NULL;
if (!miRectAlloc(&rit->reg, (i+numRI) / numRI)) /* MUST force allocation */
goto bail;
NextRect: ;
@@ -1362,7 +1362,7 @@ NextRect: ;
if (reg->data->numRects == 1) /* keep unions happy below */
{
xfreeData(reg);
- reg->data = (RegDataPtr)NULL;
+ reg->data = NULL;
}
}
@@ -1428,7 +1428,7 @@ miRectsToRegion(int nrects, xRectangle *prect, int ctype)
pRgn->extents.y1 = y1;
pRgn->extents.x2 = x2;
pRgn->extents.y2 = y2;
- pRgn->data = (RegDataPtr)NULL;
+ pRgn->data = NULL;
}
return pRgn;
}
diff --git a/mi/miscrinit.c b/mi/miscrinit.c
index 157a17fa3..93a6c4bda 100644
--- a/mi/miscrinit.c
+++ b/mi/miscrinit.c
@@ -180,7 +180,7 @@ miScreenDevPrivateInit(ScreenPtr pScreen, int width, pointer pbits)
* to the screen, until CreateScreenResources can put them in the
* screen pixmap.
*/
- pScrInitParms = (miScreenInitParmsPtr)xalloc(sizeof(miScreenInitParmsRec));
+ pScrInitParms = xalloc(sizeof(miScreenInitParmsRec));
if (!pScrInitParms)
return FALSE;
pScrInitParms->pbits = pbits;
diff --git a/mi/mispans.c b/mi/mispans.c
index 33882a9e1..5504341c4 100644
--- a/mi/mispans.c
+++ b/mi/mispans.c
@@ -405,8 +405,8 @@ void miFillUniqueSpanGroup(DrawablePtr pDraw, GCPtr pGC, SpanGroup *spanGroup)
ylength = spanGroup->ymax - ymin + 1;
/* Allocate Spans for y buckets */
- yspans = (Spans *) xalloc(ylength * sizeof(Spans));
- ysizes = (int *) xalloc(ylength * sizeof (int));
+ yspans = xalloc(ylength * sizeof(Spans));
+ ysizes = xalloc(ylength * sizeof (int));
if (!yspans || !ysizes)
{
@@ -479,8 +479,8 @@ void miFillUniqueSpanGroup(DrawablePtr pDraw, GCPtr pGC, SpanGroup *spanGroup)
} /* for i thorough Spans */
/* Now sort by x and uniquify each bucket into the final array */
- points = (DDXPointPtr) xalloc(count * sizeof(DDXPointRec));
- widths = (int *) xalloc(count * sizeof(int));
+ points = xalloc(count * sizeof(DDXPointRec));
+ widths = xalloc(count * sizeof(int));
if (!points || !widths)
{
int i;
diff --git a/mi/misprite.c b/mi/misprite.c
index 467fd8f3e..f4b281a46 100644
--- a/mi/misprite.c
+++ b/mi/misprite.c
@@ -226,7 +226,7 @@ miSpriteInitialize (ScreenPtr pScreen,
if (!DamageSetup (pScreen))
return FALSE;
- pScreenPriv = (miSpriteScreenPtr) xalloc (sizeof (miSpriteScreenRec));
+ pScreenPriv = xalloc (sizeof (miSpriteScreenRec));
if (!pScreenPriv)
return FALSE;
diff --git a/mi/mivaltree.c b/mi/mivaltree.c
index 2585422bc..cfcdab756 100644
--- a/mi/mivaltree.c
+++ b/mi/mivaltree.c
@@ -769,7 +769,7 @@ miValidateTree (
if (pScreen->ClipNotify)
(* pScreen->ClipNotify) (pWin, 0, 0);
REGION_EMPTY( pScreen, &pWin->borderClip);
- pWin->valdata = (ValidatePtr)NULL;
+ pWin->valdata = NULL;
}
}
}
diff --git a/mi/miwideline.c b/mi/miwideline.c
index 5c16d3ccc..210a6251e 100644
--- a/mi/miwideline.c
+++ b/mi/miwideline.c
@@ -95,10 +95,10 @@ miFillPolyHelper (DrawablePtr pDrawable, GCPtr pGC, unsigned long pixel,
if (!spanData)
{
- pptInit = (DDXPointPtr) xalloc (overall_height * sizeof(*ppt));
+ pptInit = xalloc (overall_height * sizeof(*ppt));
if (!pptInit)
return;
- pwidthInit = (int *) xalloc (overall_height * sizeof(*pwidth));
+ pwidthInit = xalloc (overall_height * sizeof(*pwidth));
if (!pwidthInit)
{
xfree (pptInit);
@@ -116,10 +116,10 @@ miFillPolyHelper (DrawablePtr pDrawable, GCPtr pGC, unsigned long pixel,
}
else
{
- spanRec.points = (DDXPointPtr) xalloc (overall_height * sizeof (*ppt));
+ spanRec.points = xalloc (overall_height * sizeof (*ppt));
if (!spanRec.points)
return;
- spanRec.widths = (int *) xalloc (overall_height * sizeof (int));
+ spanRec.widths = xalloc (overall_height * sizeof (int));
if (!spanRec.widths)
{
xfree (spanRec.points);
@@ -221,10 +221,10 @@ miFillRectPolyHelper (
}
else
{
- spanRec.points = (DDXPointPtr) xalloc (h * sizeof (*ppt));
+ spanRec.points = xalloc (h * sizeof (*ppt));
if (!spanRec.points)
return;
- spanRec.widths = (int *) xalloc (h * sizeof (int));
+ spanRec.widths = xalloc (h * sizeof (int));
if (!spanRec.widths)
{
xfree (spanRec.points);
@@ -1045,10 +1045,10 @@ miLineArc (
}
if (!spanData)
{
- points = (DDXPointPtr)xalloc(sizeof(DDXPointRec) * pGC->lineWidth);
+ points = xalloc(sizeof(DDXPointRec) * pGC->lineWidth);
if (!points)
return;
- widths = (int *)xalloc(sizeof(int) * pGC->lineWidth);
+ widths = xalloc(sizeof(int) * pGC->lineWidth);
if (!widths)
{
xfree(points);
@@ -1064,10 +1064,10 @@ miLineArc (
}
else
{
- points = (DDXPointPtr) xalloc (pGC->lineWidth * sizeof (DDXPointRec));
+ points = xalloc (pGC->lineWidth * sizeof (DDXPointRec));
if (!points)
return;
- widths = (int *) xalloc (pGC->lineWidth * sizeof (int));
+ widths = xalloc (pGC->lineWidth * sizeof (int));
if (!widths)
{
xfree (points);
diff --git a/mi/miwindow.c b/mi/miwindow.c
index e2af77d48..31c028482 100644
--- a/mi/miwindow.c
+++ b/mi/miwindow.c
@@ -245,7 +245,7 @@ miHandleValidateExposures(WindowPtr pWin)
(*WindowExposures)(pChild, &val->after.exposed, NullRegion);
REGION_UNINIT(pScreen, &val->after.exposed);
xfree(val);
- pChild->valdata = (ValidatePtr)NULL;
+ pChild->valdata = NULL;
if (pChild->firstChild)
{
pChild = pChild->firstChild;
@@ -305,10 +305,10 @@ miMoveWindow(WindowPtr pWin, int x, int y, WindowPtr pNextSib, VTKind kind)
{
if (pLayerWin == pWin)
anyMarked |= (*pScreen->MarkOverlappedWindows)
- (pWin, windowToValidate, (WindowPtr *)NULL);
+ (pWin, windowToValidate, NULL);
else
anyMarked |= (*pScreen->MarkOverlappedWindows)
- (pWin, pLayerWin, (WindowPtr *)NULL);
+ (pWin, pLayerWin, NULL);
if (anyMarked)
@@ -500,10 +500,10 @@ miSlideAndSizeWindow(WindowPtr pWin,
if (pLayerWin == pWin)
anyMarked |= (*pScreen->MarkOverlappedWindows)(pWin, pFirstChange,
- (WindowPtr *)NULL);
+ NULL);
else
anyMarked |= (*pScreen->MarkOverlappedWindows)(pWin, pLayerWin,
- (WindowPtr *)NULL);
+ NULL);
if (pWin->valdata)
{
@@ -729,7 +729,7 @@ miSetShape(WindowPtr pWin)
if (WasViewable)
{
anyMarked |= (*pScreen->MarkOverlappedWindows)(pWin, pWin,
- (WindowPtr *)NULL);
+ NULL);
if (anyMarked)
diff --git a/mi/mizerarc.c b/mi/mizerarc.c
index 83a269d46..9c8df3415 100644
--- a/mi/mizerarc.c
+++ b/mi/mizerarc.c
@@ -737,7 +737,7 @@ miZeroPolyArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc *parcs)
dospans = (pGC->fillStyle != FillSolid);
if (dospans)
{
- widths = (int *)xalloc(sizeof(int) * numPts);
+ widths = xalloc(sizeof(int) * numPts);
if (!widths)
return;
maxw = 0;
@@ -754,7 +754,7 @@ miZeroPolyArc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc *parcs)
(unsigned char *) pGC->dash, (int)pGC->numInDashList,
&dinfo.dashOffsetInit);
}
- points = (DDXPointPtr)xalloc(sizeof(DDXPointRec) * numPts);
+ points = xalloc(sizeof(DDXPointRec) * numPts);
if (!points)
{
if (dospans)
diff --git a/mi/mizerline.c b/mi/mizerline.c
index d9ecd89fa..46e2e2adc 100644
--- a/mi/mizerline.c
+++ b/mi/mizerline.c
@@ -155,8 +155,8 @@ miZeroLine(
width = xright - xleft + 1;
height = ybottom - ytop + 1;
list_len = (height >= width) ? height : width;
- pspanInit = (DDXPointPtr)xalloc(list_len * sizeof(DDXPointRec));
- pwidthInit = (int *)xalloc(list_len * sizeof(int));
+ pspanInit = xalloc(list_len * sizeof(DDXPointRec));
+ pwidthInit = xalloc(list_len * sizeof(int));
if (!pspanInit || !pwidthInit)
return;