Commit 132b464d authored by Adam Jackson's avatar Adam Jackson 🎧

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.
parent 0fb43905
......@@ -203,7 +203,7 @@ MultibufferExtensionInit()
for (i = 0; i < screenInfo.numScreens; i++)
{
pScreen = screenInfo.screens[i];
if (!(pMultibufferScreen = (MultibufferScreenPtr) xalloc (sizeof (MultibufferScreenRec))))
if (!(pMultibufferScreen = xalloc (sizeof (MultibufferScreenRec))))
{
for (j = 0; j < i; j++)
xfree (dixLookupPrivate(&screenInfo.screens[j]->devPrivates, MultibufferScreenPrivKey));
......@@ -348,8 +348,7 @@ CreateImageBuffers (pWin, nbuf, ids, action, hint)
xRectangle clearRect;
DestroyImageBuffers(pWin);
pMultibuffers = (MultibuffersPtr) xalloc (sizeof (MultibuffersRec) +
nbuf * sizeof (MultibufferRec));
pMultibuffers = xalloc (sizeof (MultibuffersRec) + nbuf * sizeof (MultibufferRec));
if (!pMultibuffers)
return BadAlloc;
pMultibuffers->pWindow = pWin;
......@@ -504,8 +503,8 @@ ProcDisplayImageBuffers (client)
return Success;
minDelay = stuff->minDelay;
ids = (XID *) &stuff[1];
ppMultibuffers = (MultibuffersPtr *) xalloc(nbuf * sizeof (MultibuffersPtr));
pMultibuffer = (MultibufferPtr *) xalloc(nbuf * sizeof (MultibufferPtr));
ppMultibuffers = xalloc(nbuf * sizeof (MultibuffersPtr));
pMultibuffer = xalloc(nbuf * sizeof (MultibufferPtr));
if (!ppMultibuffers || !pMultibuffer)
{
if (ppMultibuffers) xfree(ppMultibuffers);
......@@ -645,7 +644,7 @@ ProcGetMBufferAttributes (client)
pMultibuffers = (MultibuffersPtr)LookupIDByType (pWin->drawable.id, MultibuffersResType);
if (!pMultibuffers)
return BadAccess;
ids = (XID *) xalloc (pMultibuffers->numMultibuffer * sizeof (XID));
ids = xalloc (pMultibuffers->numMultibuffer * sizeof (XID));
if (!ids)
return BadAlloc;
for (i = 0; i < pMultibuffers->numMultibuffer; i++)
......@@ -782,8 +781,7 @@ ProcGetBufferInfo (client)
pDepth = &pScreen->allowedDepths[i];
nInfo += pDepth->numVids;
}
pInfo = (xMbufBufferInfo *)
xalloc (nInfo * sizeof (xMbufBufferInfo));
pInfo = xalloc (nInfo * sizeof (xMbufBufferInfo));
if (!pInfo)
return BadAlloc;
......@@ -1264,7 +1262,7 @@ DisplayImageBuffers (ids, nbuf)
MultibuffersPtr *pMultibuffers;
int i, j;
pMultibuffer = (MultibufferPtr *) xalloc (nbuf * sizeof *pMultibuffer +
pMultibuffer = xalloc (nbuf * sizeof *pMultibuffer +
nbuf * sizeof *pMultibuffers);
if (!pMultibuffer)
return BadAlloc;
......@@ -1390,7 +1388,7 @@ MultibufferExpose (pMultibuffer, pRegion)
numRects = REGION_NUM_RECTS(pRegion);
pBox = REGION_RECTS(pRegion);
pEvent = (xEvent *) xalloc(numRects * sizeof(xEvent));
pEvent = xalloc(numRects * sizeof(xEvent));
if (pEvent) {
pe = pEvent;
......@@ -1744,7 +1742,7 @@ EventSelectForMultibuffer (pMultibuffer, client, mask)
}
if (!other)
{ /* new client that never selected events on this buffer before */
other = (OtherClients *) xalloc (sizeof (OtherClients));
other = xalloc (sizeof (OtherClients));
if (!other)
return BadAlloc;
other->mask = mask;
......
......@@ -221,7 +221,7 @@ bufMultibufferInit(pScreen, pMBScreen)
pMBScreen->WrapScreenFuncs = bufWrapScreenFuncs;
pMBScreen->ResetProc = bufResetProc;
/* Create devPrivate part */
pMBPriv = (mbufBufferPrivPtr) xalloc(sizeof *pMBPriv);
pMBPriv = xalloc(sizeof *pMBPriv);
if (!pMBPriv)
return (FALSE);
......@@ -611,8 +611,7 @@ bufDrawSelectPlane(pScreen, selectPlane, prgn, bufferNum)
if (!pGC)
return;
prect = (xRectangle *)xalloc(REGION_NUM_RECTS(prgn) *
sizeof(xRectangle));
prect = xalloc(REGION_NUM_RECTS(prgn) * sizeof(xRectangle));
if (!prect)
{
FreeScratchGC(pGC);
......
......@@ -90,7 +90,7 @@ pixMultibufferInit(pScreen, pMBScreen)
nInfo += pDepth->numVids;
}
pInfo = (xMbufBufferInfo *) xalloc (nInfo * sizeof (xMbufBufferInfo));
pInfo = xalloc (nInfo * sizeof (xMbufBufferInfo));
if (!pInfo)
return FALSE;
......@@ -114,7 +114,7 @@ pixMultibufferInit(pScreen, pMBScreen)
* Setup the devPrivate to mbufScreenRec
*/
pMBPriv = (mbufPixmapPrivPtr) xalloc(sizeof(* pMBPriv));
pMBPriv = xalloc(sizeof(* pMBPriv));
if (!pMBPriv)
{
xfree(pInfo);
......@@ -261,7 +261,7 @@ MultibufferPaintBackgroundRegion(pWin, pDrawable, pRegion)
int nrects = REGION_NUM_RECTS(pRegion);
BoxPtr pbox = REGION_RECTS(pRegion);
pRects = (xRectangle *)xalloc(nrects * sizeof(xRectangle));
pRects = xalloc(nrects * sizeof(xRectangle));
if (pRects)
{
int i;
......
......@@ -116,7 +116,7 @@ int PanoramiXCreateWindow(ClientPtr client)
}
}
if(!(newWin = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes))))
if(!(newWin = xalloc(sizeof(PanoramiXRes))))
return BadAlloc;
newWin->type = XRT_WINDOW;
......@@ -644,7 +644,7 @@ int PanoramiXCreatePixmap(ClientPtr client)
client, stuff->drawable, XRC_DRAWABLE, DixReadAccess)))
return BadDrawable;
if(!(newPix = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes))))
if(!(newPix = xalloc(sizeof(PanoramiXRes))))
return BadAlloc;
newPix->type = XRT_PIXMAP;
......@@ -744,7 +744,7 @@ int PanoramiXCreateGC(ClientPtr client)
}
}
if(!(newGC = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes))))
if(!(newGC = xalloc(sizeof(PanoramiXRes))))
return BadAlloc;
newGC->type = XRT_GC;
......@@ -1256,7 +1256,7 @@ int PanoramiXPolyPoint(ClientPtr client)
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
npoint = ((client->req_len << 2) - sizeof(xPolyPointReq)) >> 2;
if (npoint > 0) {
origPts = (xPoint *) xalloc(npoint * sizeof(xPoint));
origPts = xalloc(npoint * sizeof(xPoint));
memcpy((char *) origPts, (char *) &stuff[1], npoint * sizeof(xPoint));
FOR_NSCREENS_FORWARD(j){
......@@ -1314,7 +1314,7 @@ int PanoramiXPolyLine(ClientPtr client)
isRoot = (draw->type == XRT_WINDOW) && draw->u.win.root;
npoint = ((client->req_len << 2) - sizeof(xPolyLineReq)) >> 2;
if (npoint > 0){
origPts = (xPoint *) xalloc(npoint * sizeof(xPoint));
origPts = xalloc(npoint * sizeof(xPoint));
memcpy((char *) origPts, (char *) &stuff[1], npoint * sizeof(xPoint));
FOR_NSCREENS_FORWARD(j){
......@@ -1375,7 +1375,7 @@ int PanoramiXPolySegment(ClientPtr client)
if(nsegs & 4) return BadLength;
nsegs >>= 3;
if (nsegs > 0) {
origSegs = (xSegment *) xalloc(nsegs * sizeof(xSegment));
origSegs = xalloc(nsegs * sizeof(xSegment));
memcpy((char *) origSegs, (char *) &stuff[1], nsegs * sizeof(xSegment));
FOR_NSCREENS_FORWARD(j){
......@@ -1437,7 +1437,7 @@ int PanoramiXPolyRectangle(ClientPtr client)
if(nrects & 4) return BadLength;
nrects >>= 3;
if (nrects > 0){
origRecs = (xRectangle *) xalloc(nrects * sizeof(xRectangle));
origRecs = xalloc(nrects * sizeof(xRectangle));
memcpy((char *)origRecs,(char *)&stuff[1],nrects * sizeof(xRectangle));
FOR_NSCREENS_FORWARD(j){
......@@ -1497,7 +1497,7 @@ int PanoramiXPolyArc(ClientPtr client)
if(narcs % sizeof(xArc)) return BadLength;
narcs /= sizeof(xArc);
if (narcs > 0){
origArcs = (xArc *) xalloc(narcs * sizeof(xArc));
origArcs = xalloc(narcs * sizeof(xArc));
memcpy((char *) origArcs, (char *) &stuff[1], narcs * sizeof(xArc));
FOR_NSCREENS_FORWARD(j){
......@@ -1553,7 +1553,7 @@ int PanoramiXFillPoly(ClientPtr client)
count = ((client->req_len << 2) - sizeof(xFillPolyReq)) >> 2;
if (count > 0){
locPts = (DDXPointPtr) xalloc(count * sizeof(DDXPointRec));
locPts = xalloc(count * sizeof(DDXPointRec));
memcpy((char *)locPts, (char *)&stuff[1], count * sizeof(DDXPointRec));
FOR_NSCREENS_FORWARD(j){
......@@ -1614,7 +1614,7 @@ int PanoramiXPolyFillRectangle(ClientPtr client)
if(things & 4) return BadLength;
things >>= 3;
if (things > 0){
origRects = (xRectangle *) xalloc(things * sizeof(xRectangle));
origRects = xalloc(things * sizeof(xRectangle));
memcpy((char*)origRects,(char*)&stuff[1], things * sizeof(xRectangle));
FOR_NSCREENS_FORWARD(j){
......@@ -1673,7 +1673,7 @@ int PanoramiXPolyFillArc(ClientPtr client)
IF_RETURN((narcs % sizeof(xArc)), BadLength);
narcs /= sizeof(xArc);
if (narcs > 0) {
origArcs = (xArc *) xalloc(narcs * sizeof(xArc));
origArcs = xalloc(narcs * sizeof(xArc));
memcpy((char *) origArcs, (char *)&stuff[1], narcs * sizeof(xArc));
FOR_NSCREENS_FORWARD(j){
......@@ -2071,7 +2071,7 @@ int PanoramiXCreateColormap(ClientPtr client)
client, stuff->window, XRT_WINDOW, DixReadAccess)))
return BadWindow;
if(!(newCmap = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes))))
if(!(newCmap = xalloc(sizeof(PanoramiXRes))))
return BadAlloc;
newCmap->type = XRT_COLORMAP;
......@@ -2140,7 +2140,7 @@ PanoramiXCopyColormapAndFree(ClientPtr client)
DixReadAccess | DixWriteAccess)))
return BadColor;
if(!(newCmap = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes))))
if(!(newCmap = xalloc(sizeof(PanoramiXRes))))
return BadAlloc;
newCmap->type = XRT_COLORMAP;
......
......@@ -235,7 +235,7 @@ static DevPrivateKey ScreenPrivateKey = &ScreenPrivateKeyIndex;
dixSetPrivate(&(s)->devPrivates, ScreenPrivateKey, v);
#define SetupScreen(s) ScreenSaverScreenPrivatePtr pPriv = (s ? GetScreenPrivate(s) : NULL)
#define New(t) ((t *) xalloc (sizeof (t)))
#define New(t) (xalloc (sizeof (t)))
/****************
* ScreenSaverExtensionInit
......@@ -639,8 +639,7 @@ CreateSaverWindow (ScreenPtr pScreen)
wantMap = wColormap (pWin);
if (wantMap == None)
return TRUE;
installedMaps = (Colormap *) xalloc (pScreen->maxInstalledCmaps *
sizeof (Colormap));
installedMaps = xalloc (pScreen->maxInstalledCmaps * sizeof (Colormap));
numInstalled = (*pWin->drawable.pScreen->ListInstalledColormaps)
(pScreen, installedMaps);
for (i = 0; i < numInstalled; i++)
......@@ -977,7 +976,7 @@ ScreenSaverSetAttributes (ClientPtr client)
goto bail;
}
/* over allocate for override redirect */
values = (unsigned long *) xalloc ((len + 1) * sizeof (unsigned long));
values = xalloc ((len + 1) * sizeof (unsigned long));
if (!values)
{
ret = BadAlloc;
......@@ -1379,7 +1378,7 @@ ProcScreenSaverSuspend (ClientPtr client)
* to the record, so the screensaver will be reenabled and the record freed
* if the client disconnects without reenabling it first.
*/
this = (ScreenSaverSuspensionPtr) xalloc (sizeof (ScreenSaverSuspensionRec));
this = xalloc (sizeof (ScreenSaverSuspensionRec));
if (!this)
return BadAlloc;
......
......@@ -407,7 +407,7 @@ SecurityEventSelectForAuthorization(
}
}
pEventClient = (OtherClients *) xalloc(sizeof(OtherClients));
pEventClient = xalloc(sizeof(OtherClients));
if (!pEventClient)
return BadAlloc;
pEventClient->mask = mask;
......@@ -539,7 +539,7 @@ ProcSecurityGenerateAuthorization(
/* associate additional information with this auth ID */
pAuth = (SecurityAuthorizationPtr)xalloc(sizeof(SecurityAuthorizationRec));
pAuth = xalloc(sizeof(SecurityAuthorizationRec));
if (!pAuth)
{
err = BadAlloc;
......
......@@ -804,8 +804,7 @@ ProcShapeSelectInput (ClientPtr client)
}
/* build the entry */
pNewShapeEvent = (ShapeEventPtr)
xalloc (sizeof (ShapeEventRec));
pNewShapeEvent = xalloc (sizeof (ShapeEventRec));
if (!pNewShapeEvent)
return BadAlloc;
pNewShapeEvent->next = 0;
......@@ -827,7 +826,7 @@ ProcShapeSelectInput (ClientPtr client)
*/
if (!pHead)
{
pHead = (ShapeEventPtr *) xalloc (sizeof (ShapeEventPtr));
pHead = xalloc (sizeof (ShapeEventPtr));
if (!pHead ||
!AddResource (pWin->drawable.id, EventType, (pointer)pHead))
{
......@@ -1014,7 +1013,7 @@ ProcShapeGetRectangles (ClientPtr client)
}
if (!region) {
nrects = 1;
rects = (xRectangle *) xalloc (sizeof (xRectangle));
rects = xalloc (sizeof (xRectangle));
if (!rects)
return BadAlloc;
switch (stuff->kind) {
......@@ -1041,7 +1040,7 @@ ProcShapeGetRectangles (ClientPtr client)
BoxPtr box;
nrects = REGION_NUM_RECTS(region);
box = REGION_RECTS(region);
rects = (xRectangle *) xalloc (nrects * sizeof (xRectangle));
rects = xalloc (nrects * sizeof (xRectangle));
if (!rects && nrects)
return BadAlloc;
for (i = 0; i < nrects; i++, box++) {
......
......@@ -198,7 +198,7 @@ static Bool CheckForShmSyscall(void)
if (shmid != -1)
{
/* Successful allocation - clean up */
shmctl(shmid, IPC_RMID, (struct shmid_ds *)NULL);
shmctl(shmid, IPC_RMID, NULL);
}
else
{
......@@ -265,7 +265,7 @@ ShmResetProc(ExtensionEntry *extEntry)
for (i = 0; i < MAXSCREENS; i++)
{
shmFuncs[i] = (ShmFuncsPtr)NULL;
shmFuncs[i] = NULL;
}
}
......@@ -422,7 +422,7 @@ ProcShmAttach(ClientPtr client)
}
else
{
shmdesc = (ShmDescPtr) xalloc(sizeof(ShmDescRec));
shmdesc = xalloc(sizeof(ShmDescRec));
if (!shmdesc)
return BadAlloc;
shmdesc->addr = shmat(stuff->shmid, 0,
......@@ -727,7 +727,7 @@ CreatePmap:
VERIFY_SHMSIZE(shmdesc, stuff->offset, size, client);
if(!(newPix = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes))))
if(!(newPix = xalloc(sizeof(PanoramiXRes))))
return BadAlloc;
newPix->type = XRT_PIXMAP;
......
......@@ -93,7 +93,7 @@ ClientSleepUntil (ClientPtr client,
SertafiedGeneration = serverGeneration;
BlockHandlerRegistered = FALSE;
}
pRequest = (SertafiedPtr) xalloc (sizeof (SertafiedRec));
pRequest = xalloc (sizeof (SertafiedRec));
if (!pRequest)
return FALSE;
pRequest->pClient = client;
......
......@@ -883,7 +883,7 @@ SyncCreateSystemCounter(
}
}
pCounter = SyncCreateCounter((ClientPtr)NULL, FakeClientID(0), initial);
pCounter = SyncCreateCounter(NULL, FakeClientID(0), initial);
if (pCounter)
{
......
......@@ -284,7 +284,7 @@ XaceCensorImage(
/* convert region to list-of-rectangles for PolyFillRect */
pRects = (xRectangle *)xalloc(nRects * sizeof(xRectangle));
pRects = xalloc(nRects * sizeof(xRectangle));
if (!pRects)
{
failed = TRUE;
......
......@@ -125,7 +125,7 @@ CheckForShmSyscall(void)
if (shmid != -1)
{
/* Successful allocation - clean up */
shmctl(shmid, IPC_RMID, (struct shmid_ds *)NULL);
shmctl(shmid, IPC_RMID, NULL);
}
else
{
......@@ -229,7 +229,7 @@ shmalloc(
if (size < 3500)
return (ShmDescPtr) NULL;
pDesc = (ShmDescRec *) xalloc(sizeof(ShmDescRec));
pDesc = xalloc(sizeof(ShmDescRec));
if (!pDesc)
return (ShmDescPtr) NULL;
......@@ -473,8 +473,7 @@ ProcXF86BigfontQueryFont(
shmid = pDesc->shmid;
} else {
#endif
pCI = (xCharInfo *)
xalloc(nCharInfos * sizeof(xCharInfo));
pCI = xalloc(nCharInfos * sizeof(xCharInfo));
if (!pCI)
return BadAlloc;
#ifdef HAS_SHM
......@@ -536,8 +535,7 @@ ProcXF86BigfontQueryFont(
if (hashModulus > nCharInfos+1)
hashModulus = nCharInfos+1;
tmp = (CARD16*)
xalloc((4*nCharInfos+1) * sizeof(CARD16));
tmp = xalloc((4*nCharInfos+1) * sizeof(CARD16));
if (!tmp) {
if (!pDesc) xfree(pCI);
return BadAlloc;
......@@ -621,8 +619,7 @@ ProcXF86BigfontQueryFont(
? nUniqCharInfos * sizeof(xCharInfo)
+ (nCharInfos+1)/2 * 2 * sizeof(CARD16)
: 0);
xXF86BigfontQueryFontReply* reply =
(xXF86BigfontQueryFontReply *) xalloc(rlength);
xXF86BigfontQueryFontReply* reply = xalloc(rlength);
char* p;
if (!reply) {
if (nCharInfos > 0) {
......
......@@ -273,7 +273,7 @@ XvScreenInit(ScreenPtr pScreen)
/* ALLOCATE SCREEN PRIVATE RECORD */
pxvs = (XvScreenPtr) xalloc (sizeof (XvScreenRec));
pxvs = xalloc (sizeof (XvScreenRec));
if (!pxvs)
{
ErrorF("XvScreenInit: Unable to allocate screen private structure\n");
......@@ -367,11 +367,10 @@ XvDestroyPixmap(PixmapPtr pPix)
{
XvdiSendVideoNotify(pp, pp->pDraw, XvPreempted);
(void)(* pp->pAdaptor->ddStopVideo)((ClientPtr)NULL, pp,
pp->pDraw);
(void)(* pp->pAdaptor->ddStopVideo)(NULL, pp, pp->pDraw);
pp->pDraw = (DrawablePtr)NULL;
pp->client = (ClientPtr)NULL;
pp->pDraw = NULL;
pp->client = NULL;
pp->time = currentTime;
}
pp++;
......@@ -419,11 +418,10 @@ XvDestroyWindow(WindowPtr pWin)
{
XvdiSendVideoNotify(pp, pp->pDraw, XvPreempted);
(void)(* pp->pAdaptor->ddStopVideo)((ClientPtr)NULL, pp,
pp->pDraw);
(void)(* pp->pAdaptor->ddStopVideo)(NULL, pp, pp->pDraw);
pp->pDraw = (DrawablePtr)NULL;
pp->client = (ClientPtr)NULL;
pp->pDraw = NULL;
pp->client = NULL;
pp->time = currentTime;
}
pp++;
......@@ -455,8 +453,8 @@ XvdiVideoStopped(XvPortPtr pPort, int reason)
XvdiSendVideoNotify(pPort, pPort->pDraw, reason);
pPort->pDraw = (DrawablePtr)NULL;
pPort->client = (ClientPtr)NULL;
pPort->pDraw = NULL;
pPort->client = NULL;
pPort->time = currentTime;
return Success;
......@@ -472,7 +470,7 @@ XvdiDestroyPort(pointer pPort, XID id)
static int
XvdiDestroyGrab(pointer pGrab, XID id)
{
((XvGrabPtr)pGrab)->client = (ClientPtr)NULL;
((XvGrabPtr)pGrab)->client = NULL;
return Success;
}
......@@ -481,7 +479,7 @@ XvdiDestroyVideoNotify(pointer pn, XID id)
{
/* JUST CLEAR OUT THE client POINTER FIELD */
((XvVideoNotifyPtr)pn)->client = (ClientPtr)NULL;
((XvVideoNotifyPtr)pn)->client = NULL;
return Success;
}
......@@ -490,7 +488,7 @@ XvdiDestroyPortNotify(pointer pn, XID id)
{
/* JUST CLEAR OUT THE client POINTER FIELD */
((XvPortNotifyPtr)pn)->client = (ClientPtr)NULL;
((XvPortNotifyPtr)pn)->client = NULL;
return Success;
}
......@@ -852,7 +850,7 @@ XvdiGrabPort(
if ((pPort->pDraw) && (client != pPort->client))
{
XvdiStopVideo((ClientPtr)NULL, pPort, pPort->pDraw);
XvdiStopVideo(NULL, pPort, pPort->pDraw);
}
pPort->grab.client = client;
......@@ -891,7 +889,7 @@ XvdiUngrabPort(
/* FREE THE GRAB RESOURCE; AND SET THE GRAB CLIENT TO NULL */
FreeResource(pPort->grab.id, XvRTGrab);
pPort->grab.client = (ClientPtr)NULL;
pPort->grab.client = NULL;
pPort->time = currentTime;
......@@ -921,9 +919,9 @@ XvdiSelectVideoNotify(
if (!pn)
{
if (!(tpn = (XvVideoNotifyPtr)xalloc(sizeof(XvVideoNotifyRec))))
if (!(tpn = xalloc(sizeof(XvVideoNotifyRec))))
return BadAlloc;
tpn->next = (XvVideoNotifyPtr)NULL;
tpn->next = NULL;
if (!AddResource(pDraw->id, XvRTVideoNotifyList, tpn))
{
xfree(tpn);
......@@ -934,13 +932,13 @@ XvdiSelectVideoNotify(
{
/* LOOK TO SEE IF ENTRY ALREADY EXISTS */
fpn = (XvVideoNotifyPtr)NULL;
fpn = NULL;
tpn = pn;
while (tpn)
{
if (tpn->client == client)
{
if (!onoff) tpn->client = (ClientPtr)NULL;
if (!onoff) tpn->client = NULL;
return Success;
}
if (!tpn->client) fpn = tpn; /* TAKE NOTE OF FREE ENTRY */
......@@ -959,7 +957,7 @@ XvdiSelectVideoNotify(
}
else
{
if (!(tpn = (XvVideoNotifyPtr)xalloc(sizeof(XvVideoNotifyRec))))
if (!(tpn = xalloc(sizeof(XvVideoNotifyRec))))
return BadAlloc;
tpn->next = pn->next;
pn->next = tpn;
......@@ -969,7 +967,7 @@ XvdiSelectVideoNotify(
/* INIT CLIENT PTR IN CASE WE CAN'T ADD RESOURCE */
/* ADD RESOURCE SO THAT IF CLIENT EXITS THE CLIENT PTR WILL BE CLEARED */
tpn->client = (ClientPtr)NULL;
tpn->client = NULL;
tpn->id = FakeClientID(client->index);
AddResource(tpn->id, XvRTVideoNotify, tpn);
......@@ -988,7 +986,7 @@ XvdiSelectPortNotify(
/* SEE IF CLIENT IS ALREADY IN LIST */
tpn = (XvPortNotifyPtr)NULL;
tpn = NULL;
pn = pPort->pNotify;
while (pn)
{
......@@ -1005,7 +1003,7 @@ XvdiSelectPortNotify(
if (!onoff)
{
pn->client = (ClientPtr)NULL;
pn->client = NULL;
FreeResource(pn->id, XvRTPortNotify);
}
......@@ -1017,7 +1015,7 @@ XvdiSelectPortNotify(
if (!tpn)
{
if (!(tpn = (XvPortNotifyPtr)xalloc(sizeof(XvPortNotifyRec))))
if (!(tpn = xalloc(sizeof(XvPortNotifyRec))))
return BadAlloc;
tpn->next = pPort->pNotify;
pPort->pNotify = tpn;
......@@ -1060,7 +1058,7 @@ XvdiStopVideo(
status = (* pPort->pAdaptor->ddStopVideo)(client, pPort, pDraw);
pPort->pDraw = (DrawablePtr)NULL;
pPort->pDraw = NULL;
pPort->client = (ClientPtr)client;
pPort->time = currentTime;
......@@ -1084,7 +1082,7 @@ XvdiPreemptVideo(
status = (* pPort->pAdaptor->ddStopVideo)(client, pPort, pPort->pDraw);
pPort->pDraw = (DrawablePtr)NULL;
pPort->pDraw = NULL;
pPort->client = (ClientPtr)client;
pPort->time = currentTime;
......
......@@ -710,7 +710,7 @@ XvMCScreenInit(ScreenPtr pScreen, int num, XvMCAdaptorPtr pAdapt)
XvMCScreenKey = &XvMCScreenKeyIndex;
if(!(pScreenPriv = (XvMCScreenPtr)xalloc(sizeof(XvMCScreenRec))))
if(!(pScreenPriv = xalloc(sizeof(XvMCScreenRec))))
return BadAlloc;
dixSetPrivate(&pScreen->devPrivates, XvMCScreenKey, pScreenPriv);
......
......@@ -109,7 +109,7 @@ MakeAtom(char *string, unsigned len, Bool makeit)
{
NodePtr nd;
nd = (NodePtr) xalloc(sizeof(NodeRec));
nd = xalloc(sizeof(NodeRec));
if (!nd)
return BAD_RESOURCE;
if (lastAtom < XA_LAST_PREDEFINED)
......@@ -118,7 +118,7 @@ MakeAtom(char *string, unsigned len, Bool makeit)
}
else
{
nd->string = (char *) xalloc(len + 1);
nd->string = xalloc(len + 1);
if (!nd->string) {
xfree(nd);
return BAD_RESOURCE;
......@@ -201,7 +201,7 @@ InitAtoms(void)
{
FreeAllAtoms();
tableLength = InitialTableSize;
nodeTable = (NodePtr *)xalloc(InitialTableSize*sizeof(NodePtr));
nodeTable = xalloc(InitialTableSize*sizeof(NodePtr));
if (!nodeTable)
AtomError();
nodeTable[None] = (NodePtr)NULL;
......
......@@ -274,7 +274,7 @@ CreateColormap (Colormap mid, ScreenPtr pScreen, VisualPtr pVisual,
if ((class | DynamicClass) == DirectColor)
sizebytes *= 3;
sizebytes += sizeof(ColormapRec);
pmap = (ColormapPtr) xalloc(sizebytes);
pmap = xalloc(sizebytes);
if (!pmap)
return (BadAlloc);
#if defined(_XSERVER64)
......@@ -310,7 +310,7 @@ CreateColormap (Colormap mid, ScreenPtr pScreen, VisualPtr pVisual,
for (pent = &pmap->red[size - 1]; pent >= pmap->red; pent--)
pent->refcnt = AllocPrivate;
pmap->freeRed = 0;
ppix = (Pixel *)xalloc(size * sizeof(Pixel));
ppix = xalloc(size * sizeof(Pixel));
if (!ppix)
{
xfree(pmap);
......@@ -356,7 +356,7 @@ CreateColormap (Colormap mid, ScreenPtr pScreen, VisualPtr pVisual,
for(pent = &pmap->green[size-1]; pent >= pmap->green; pent--)
pent->refcnt = AllocPrivate;
pmap->freeGreen = 0;