diff options
author | Adam Jackson <ajax@redhat.com> | 2009-01-22 02:11:16 -0500 |
---|---|---|
committer | Adam Jackson <ajax@redhat.com> | 2009-01-22 02:11:16 -0500 |
commit | 132b464d734b077038e19b21e46d3a6258f4b998 (patch) | |
tree | 4fe179cf69d6013a32aaa8e17a28b3fc905e6274 /Xext | |
parent | 0fb4390526bb829ab17ff4635d41a3012f63c1b2 (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 'Xext')
-rw-r--r-- | Xext/mbuf.c | 22 | ||||
-rw-r--r-- | Xext/mbufbf.c | 5 | ||||
-rw-r--r-- | Xext/mbufpx.c | 6 | ||||
-rw-r--r-- | Xext/panoramiXprocs.c | 26 | ||||
-rw-r--r-- | Xext/saver.c | 9 | ||||
-rw-r--r-- | Xext/security.c | 4 | ||||
-rw-r--r-- | Xext/shape.c | 9 | ||||
-rw-r--r-- | Xext/shm.c | 8 | ||||
-rw-r--r-- | Xext/sleepuntil.c | 2 | ||||
-rw-r--r-- | Xext/sync.c | 2 | ||||
-rw-r--r-- | Xext/xace.c | 2 | ||||
-rw-r--r-- | Xext/xf86bigfont.c | 13 | ||||
-rw-r--r-- | Xext/xvmain.c | 52 | ||||
-rw-r--r-- | Xext/xvmc.c | 2 |
14 files changed, 76 insertions, 86 deletions
diff --git a/Xext/mbuf.c b/Xext/mbuf.c index 336ef194f..09399b65e 100644 --- a/Xext/mbuf.c +++ b/Xext/mbuf.c @@ -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,8 +1262,8 @@ DisplayImageBuffers (ids, nbuf) MultibuffersPtr *pMultibuffers; int i, j; - pMultibuffer = (MultibufferPtr *) xalloc (nbuf * sizeof *pMultibuffer + - nbuf * sizeof *pMultibuffers); + pMultibuffer = xalloc (nbuf * sizeof *pMultibuffer + + nbuf * sizeof *pMultibuffers); if (!pMultibuffer) return BadAlloc; pMultibuffers = (MultibuffersPtr *) (pMultibuffer + nbuf); @@ -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; diff --git a/Xext/mbufbf.c b/Xext/mbufbf.c index 877ccaabd..7d9d60a4f 100644 --- a/Xext/mbufbf.c +++ b/Xext/mbufbf.c @@ -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); diff --git a/Xext/mbufpx.c b/Xext/mbufpx.c index 01811d9a2..8421ba9eb 100644 --- a/Xext/mbufpx.c +++ b/Xext/mbufpx.c @@ -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; diff --git a/Xext/panoramiXprocs.c b/Xext/panoramiXprocs.c index 0f9096fe5..72a207ab8 100644 --- a/Xext/panoramiXprocs.c +++ b/Xext/panoramiXprocs.c @@ -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; diff --git a/Xext/saver.c b/Xext/saver.c index dd8ebe890..3aaec3405 100644 --- a/Xext/saver.c +++ b/Xext/saver.c @@ -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; diff --git a/Xext/security.c b/Xext/security.c index e37906366..fc4691b0e 100644 --- a/Xext/security.c +++ b/Xext/security.c @@ -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; diff --git a/Xext/shape.c b/Xext/shape.c index d8d564390..8827a0274 100644 --- a/Xext/shape.c +++ b/Xext/shape.c @@ -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++) { diff --git a/Xext/shm.c b/Xext/shm.c index ce566b601..7b63484a5 100644 --- a/Xext/shm.c +++ b/Xext/shm.c @@ -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; diff --git a/Xext/sleepuntil.c b/Xext/sleepuntil.c index 4d2a333d0..2616a5e5b 100644 --- a/Xext/sleepuntil.c +++ b/Xext/sleepuntil.c @@ -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; diff --git a/Xext/sync.c b/Xext/sync.c index d529bec49..9236fab87 100644 --- a/Xext/sync.c +++ b/Xext/sync.c @@ -883,7 +883,7 @@ SyncCreateSystemCounter( } } - pCounter = SyncCreateCounter((ClientPtr)NULL, FakeClientID(0), initial); + pCounter = SyncCreateCounter(NULL, FakeClientID(0), initial); if (pCounter) { diff --git a/Xext/xace.c b/Xext/xace.c index 86d70fe74..6eaba6dbc 100644 --- a/Xext/xace.c +++ b/Xext/xace.c @@ -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; diff --git a/Xext/xf86bigfont.c b/Xext/xf86bigfont.c index dabbdd6e0..60189666e 100644 --- a/Xext/xf86bigfont.c +++ b/Xext/xf86bigfont.c @@ -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) { diff --git a/Xext/xvmain.c b/Xext/xvmain.c index 6184e4e77..477194684 100644 --- a/Xext/xvmain.c +++ b/Xext/xvmain.c @@ -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; diff --git a/Xext/xvmc.c b/Xext/xvmc.c index 091e5a1a0..9166cf892 100644 --- a/Xext/xvmc.c +++ b/Xext/xvmc.c @@ -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); |